From e774845ade9bb53d9eeb872667008ee15394b0aa Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 20 May 2021 11:43:31 +0200 Subject: [PATCH] fixed and updates openapi shema --- .../static/vue/js/import_response_view.js | 2 +- cookbook/static/vue/js/recipe_search_view.js | 2 +- cookbook/views/api.py | 2 +- .../RecipeSearchView/RecipeSearchView.vue | 37 +- .../utils/openapi/.openapi-generator/FILES | 1 - vue/src/utils/openapi/api.ts | 655 +++++++++++++++++- 6 files changed, 662 insertions(+), 37 deletions(-) diff --git a/cookbook/static/vue/js/import_response_view.js b/cookbook/static/vue/js/import_response_view.js index 9722a95c5..490f222bd 100644 --- a/cookbook/static/vue/js/import_response_view.js +++ b/cookbook/static/vue/js/import_response_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var r,a,c=t[0],s=t[1],u=t[2],p=0,h=[];p1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en","Recently_Viewed":"Recent bekeken","External":"Externe","Settings":"Instellingen","Meal_Plan":"Maaltijdplan"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,c=n("2877"),s=Object(c["a"])(a,r,i,!1,null,null,null);t["a"]=s.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Meal_Plan":"Meal Plan","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","Settings":"Settings","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var c=(r+o)/(i+a);if(e===c){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var s=Math.floor(r/i);return[s,r-s*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return s(e)}}};function s(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}}}); \ No newline at end of file +(function(e){function t(t){for(var r,a,c=t[0],s=t[1],u=t[2],p=0,h=[];p1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en","Recently_Viewed":"Recent bekeken","External":"Externe","Settings":"Instellingen","Meal_Plan":"Maaltijdplan"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,c=n("2877"),s=Object(c["a"])(a,r,i,!1,null,null,null);t["a"]=s.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Meal_Plan":"Meal Plan","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","Settings":"Settings","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return c})),n.d(t,"e",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var c=(r+o)/(i+a);if(e===c){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var s=Math.floor(r/i);return[s,r-s*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var c={methods:{_:function(e){return s(e)}}};function s(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}}}); \ No newline at end of file diff --git a/cookbook/static/vue/js/recipe_search_view.js b/cookbook/static/vue/js/recipe_search_view.js index b4695d538..1191ac2fe 100644 --- a/cookbook/static/vue/js/recipe_search_view.js +++ b/cookbook/static/vue/js/recipe_search_view.js @@ -1 +1 @@ -(function(e){function t(t){for(var r,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0?t.listRecipes({query:{last_viewed:this.settings.recently_viewed}}).then((function(t){e.last_viewed_recipes=t.data.results})):this.last_viewed_recipes=[]},genericSelectChanged:function(e){this[e.var]=e.val,this.refreshData()},resetSearch:function(){this.search_input="",this.search_internal=!1,this.search_keywords=[],this.search_foods=[],this.search_books=[],this.refreshData()},pageChange:function(e){this.pagination_page=e,this.refreshData()}}},E=C,T=(n("60bc"),Object(g["a"])(E,i,o,!1,null,null,null)),x=T.exports,I=n("9225");r["default"].config.productionTip=!1,new r["default"]({i18n:I["a"],render:function(e){return e(x)}}).$mount("#app")},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Import","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Zubereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen"}')},"7c15":function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return u}));var r=n("bc3a"),i=n.n(r),o=n("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var n="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(n,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.recipe.keywords.length>0?n("div",e._l(e.recipe.keywords,(function(t){return n("small",{key:t.id,staticStyle:{padding:"2px"}},[n("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},i=[],o={name:"Keywords",props:{recipe:Object}},a=o,s=n("2877"),c=Object(s["a"])(a,r,i,!1,null,null,null);t["a"]=c.exports},9225:function(e,t,n){"use strict";n("159b"),n("d3b7"),n("ddb0"),n("ac1f"),n("466d");var r=n("a026"),i=n("a925");function o(){var e=n("49f8"),t={};return e.keys().forEach((function(n){var r=n.match(/([A-Za-z0-9-_]+)\./i);if(r&&r.length>1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en","Recently_Viewed":"Recent bekeken","External":"Externe","Settings":"Instellingen","Meal_Plan":"Maaltijdplan"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,s=n("2877"),c=Object(s["a"])(a,r,i,!1,null,null,null);t["a"]=c.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Meal_Plan":"Meal Plan","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","Settings":"Settings","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var s=(r+o)/(i+a);if(e===s){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var c=Math.floor(r/i);return[c,r-c*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var s={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"dropdown"},[e._m(0),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book")}}},[n("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Book"))+" ")]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log")}}},[n("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")]),n("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[n("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")]),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_share_link",e.recipe.id),target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share")))]):e._e()])]),n("cook-log",{attrs:{recipe:e.recipe}})],1)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[n("i",{staticClass:"fas fa-ellipsis-v"})])}],o=(n("a9e3"),n("fa7d")),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log",title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[n("p",[e._v(e._s(e.$t("all_fields_optional")))]),n("form",[n("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),n("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),n("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),n("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),n("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},s=[],c=n("c1df"),u=n.n(c),d=n("a026"),p=n("5f5b"),h=n("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var b={name:"CookLog",props:{recipe:Object},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:u()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(h["d"])(this.logObject)}}},l=b,f=n("2877"),j=Object(f["a"])(l,a,s,!1,null,null,null),O=j.exports,v={name:"RecipeContextMenu",mixins:[o["b"]],components:{CookLog:O},data:function(){return{servings_value:0}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings}},g=v,m=Object(f["a"])(g,r,i,!1,null,null,null);t["a"]=m.exports}}); \ No newline at end of file +(function(e){function t(t){for(var r,a,s=t[0],c=t[1],u=t[2],p=0,h=[];p0?t.listRecipes({query:{last_viewed:this.settings.recently_viewed}}).then((function(t){e.last_viewed_recipes=t.data.results})):this.last_viewed_recipes=[]},genericSelectChanged:function(e){this[e.var]=e.val,this.refreshData()},resetSearch:function(){this.search_input="",this.search_internal=!1,this.search_keywords=[],this.search_foods=[],this.search_books=[],this.refreshData()},pageChange:function(e){this.pagination_page=e,this.refreshData()}}},I=C,E=(n("60bc"),Object(g["a"])(I,i,o,!1,null,null,null)),T=E.exports,x=n("9225");r["default"].config.productionTip=!1,new r["default"]({i18n:x["a"],render:function(e){return e(T)}}).$mount("#app")},"6ce2":function(e){e.exports=JSON.parse('{"Import":"Import","import_running":"Import läuft, bitte warten!","Import_finished":"Import fertig","View_Recipes":"Rezepte Ansehen","Information":"Information","all_fields_optional":"Alle Felder sind optional und können leer gelassen werden.","convert_internal":"Zu internem Rezept wandeln","Log_Recipe_Cooking":"Kochen protokollieren","External_Recipe_Image":"Externes Rezept Bild","Add_to_Book":"Zu Buch hinzufügen","Add_to_Shopping":"Zu Einkaufsliste hinzufügen","Add_to_Plan":"Zu Plan hinzufügen","Step_start_time":"Schritt Startzeit","Select_Book":"Buch wählen","Recipe_Image":"Rezept Bild","Log_Cooking":"Kochen protokollieren","Proteins":"Proteine","Fats":"Fette","Carbohydrates":"Kohlenhydrate","Calories":"Kalorien","Nutrition":"Nährwerte","Keywords":"Stichwörter","Books":"Bücher","show_only_internal":"Nur interne Rezepte anzeigen","Ingredients":"Zutaten","min":"Min","Servings":"Portionen","Waiting":"Wartezeit","Preparation":"Zubereitung","Edit":"Bearbeiten","Open":"Öffnen","Save":"Speichern","Step":"Schritt","Search":"Suchen","Print":"Drucken","New_Recipe":"Neues Rezept","Url_Import":"URL Import","Reset_Search":"Suche zurücksetzen","or":"oder","and":"und","Recently_Viewed":"Kürzlich angesehen","External":"Extern","Settings":"Einstellungen","Meal_Plan":"Speiseplan","Date":"Datum","Share":"Teilen","Export":"Exportieren","Rating":"Bewertung","Close":"Schließen","Add":"Hinzufügen"}')},"7c15":function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return u}));var r=n("bc3a"),i=n.n(r),o=n("fa7d");function a(e){var t=Object(o["g"])("api:recipe-detail",e);return void 0!==window.SHARE_UID&&(t+="?share="+window.SHARE_UID),i.a.get(t).then((function(e){return e.data})).catch((function(e){d(e,"There was an error loading a resource!","danger")}))}function s(e){return i.a.post(Object(o["g"])("api:cooklog-list"),e).then((function(e){Object(o["f"])("Saved","Cook Log entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function c(e){return i.a.get(Object(o["g"])("api:recipebook-list")+"?query="+e).then((function(e){return e.data})).catch((function(e){}))}function u(e){return i.a.post(Object(o["g"])("api:recipebookentry-list"),e).then((function(e){Object(o["f"])("Saved","Recipe Book entry saved!","success")})).catch((function(e){d(e,"There was an error creating a resource!","danger")}))}function d(e,t){if("response"in e){console.log(e.response);var n="statusText"in e.response?e.response.statusText:Object(o["e"])("Error");t+="\n\n"+JSON.stringify(e.response.data),Object(o["f"])(n,t,"danger")}else Object(o["f"])("Error",t,"danger"),console.log(e)}i.a.defaults.xsrfCookieName="csrftoken",i.a.defaults.xsrfHeaderName="X-CSRFTOKEN"},"81d5":function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.recipe.keywords.length>0?n("div",e._l(e.recipe.keywords,(function(t){return n("small",{key:t.id,staticStyle:{padding:"2px"}},[n("b-badge",{attrs:{pill:"",variant:"light"}},[e._v(e._s(t.label))])],1)})),0):e._e()},i=[],o={name:"Keywords",props:{recipe:Object}},a=o,s=n("2877"),c=Object(s["a"])(a,r,i,!1,null,null,null);t["a"]=c.exports},9225:function(e,t,n){"use strict";n("159b"),n("d3b7"),n("ddb0"),n("ac1f"),n("466d");var r=n("a026"),i=n("a925");function o(){var e=n("49f8"),t={};return e.keys().forEach((function(n){var r=n.match(/([A-Za-z0-9-_]+)\./i);if(r&&r.length>1){var i=r[1];t[i]=e(n)}})),t}r["default"].use(i["a"]),t["a"]=new i["a"]({locale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_LOCALE||"en",fallbackLocale:Object({NODE_ENV:"production",BASE_URL:""}).VUE_APP_I18N_FALLBACK_LOCALE||"en",messages:o()})},a625:function(e){e.exports=JSON.parse('{"import_running":"Er wordt geïmporteerd, even geduld!","all_fields_optional":"Alle velden zijn optioneel en kunnen leeg gelaten worden.","convert_internal":"Zet om naar intern recept","Log_Recipe_Cooking":"Log Bereiding","External_Recipe_Image":"Externe Afbeelding Recept","Add_to_Book":"Voeg toe aan Boek","Add_to_Shopping":"Voeg toe aan Boodschappenlijst","Add_to_Plan":"Voeg toe aan Plan","Step_start_time":"Starttijd stap","Select_Book":"Selecteer Boek","Recipe_Image":"Afbeelding Recept","Import_finished":"Importeren gereed","View_Recipes":"Bekijk Recepten","Log_Cooking":"Log Bereiding","Proteins":"Eiwitten","Fats":"Vetten","Carbohydrates":"Koolhydraten","Calories":"Calorieën","Nutrition":"Voedingswaarde","Date":"Datum","Share":"Deel","Export":"Exporteren","Rating":"Beoordeling","Close":"Sluiten","Add":"Voeg toe","Ingredients":"Ingrediënten","min":"min","Servings":"Porties","Waiting":"Wachten","Preparation":"Bereiding","Edit":"Bewerken","Open":"Open","Save":"Opslaan","Step":"Stap","Search":"Zoeken","Import":"Importeer","Print":"Afdrukken","Information":"Informatie","Keywords":"Etiketten","Books":"Boeken","show_only_internal":"Toon alleen interne recepten","New_Recipe":"Nieuw Recept","Url_Import":"Importeer URL","Reset_Search":"Zoeken resetten","or":"of","and":"en","Recently_Viewed":"Recent bekeken","External":"Externe","Settings":"Instellingen","Meal_Plan":"Maaltijdplan"}')},d76c:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"row"},[n("div",{staticClass:"col",staticStyle:{"text-align":"center"}},[n("i",{staticClass:"fas fa-spinner fa-spin fa-10x"})])])}],o={name:"LoadingSpinner",props:{recipe:Object}},a=o,s=n("2877"),c=Object(s["a"])(a,r,i,!1,null,null,null);t["a"]=c.exports},edd4:function(e){e.exports=JSON.parse('{"import_running":"Import running, please wait!","all_fields_optional":"All fields are optional and can be left empty.","convert_internal":"Convert to internal recipe","show_only_internal":"Show only internal recipes","Log_Recipe_Cooking":"Log Recipe Cooking","External_Recipe_Image":"External Recipe Image","Add_to_Book":"Add to Book","Add_to_Shopping":"Add to Shopping","Add_to_Plan":"Add to Plan","Step_start_time":"Step start time","Meal_Plan":"Meal Plan","Select_Book":"Select Book","Recipe_Image":"Recipe Image","Import_finished":"Import finished","View_Recipes":"View Recipes","Log_Cooking":"Log Cooking","New_Recipe":"New Recipe","Url_Import":"Url Import","Reset_Search":"Reset Search","Recently_Viewed":"Recently Viewed","Keywords":"Keywords","Books":"Books","Proteins":"Proteins","Fats":"Fats","Carbohydrates":"Carbohydrates","Calories":"Calories","Nutrition":"Nutrition","Date":"Date","Share":"Share","Export":"Export","Rating":"Rating","Close":"Close","Add":"Add","Ingredients":"Ingredients","min":"min","Servings":"Servings","Waiting":"Waiting","Preparation":"Preparation","External":"External","Edit":"Edit","Open":"Open","Save":"Save","Step":"Step","Search":"Search","Import":"Import","Print":"Print","Settings":"Settings","or":"or","and":"and","Information":"Information"}')},fa7d:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"f",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"g",(function(){return d})),n.d(t,"d",(function(){return h}));n("99af");var r=n("59e4");function i(e,t,n){var r=Math.floor(e),i=1,o=r+1,a=1;if(e!==r)while(i<=t&&a<=t){var s=(r+o)/(i+a);if(e===s){i+a<=t?(i+=a,r+=o,a=t+1):i>a?a=t+1:i=t+1;break}et&&(i=a,r=o),!n)return[0,r,i];var c=Math.floor(r/i);return[c,r-c*i,i]}var o={methods:{makeToast:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return a(e,t,n)}}};function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=new r["a"];i.$bvToast.toast(t,{title:e,variant:n,toaster:"b-toaster-top-center",solid:!0})}var s={methods:{_:function(e){return c(e)}}};function c(e){return window.gettext(e)}var u={methods:{resolveDjangoUrl:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return d(e,t)}}};function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==t?window.Urls[e](t):window.Urls[e]()}function p(e){return window.USER_PREF[e]}function h(e,t){if(p("use_fractions")){var n="",r=i(e*t,9,!0);return r[0]>0&&(n+=r[0]),r[1]>0&&(n+=" ".concat(r[1],"").concat(r[2],"")),n}return b(e*t)}function b(e){var t=p("user_fractions")?p("user_fractions"):2;return+(Math.round(e+"e+".concat(t))+"e-".concat(t))}},fc0d:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"dropdown"},[e._m(0),n("div",{staticClass:"dropdown-menu dropdown-menu-right",attrs:{"aria-labelledby":"dropdownMenuLink"}},[n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-pencil-alt fa-fw"}),e._v(" "+e._s(e.$t("Edit")))]),e.recipe.internal?e._e():n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("edit_convert_recipe",e.recipe.id)}},[n("i",{staticClass:"fas fa-exchange-alt fa-fw"}),e._v(" "+e._s(e.$t("convert_internal")))]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_add_book")}}},[n("i",{staticClass:"fas fa-bookmark fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Book"))+" ")]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_shopping")+"?r=["+e.recipe.id+","+e.servings_value+"]",target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-shopping-cart fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Shopping"))+" ")]):e._e(),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_meal_plan")+"?recipe="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-calendar fa-fw"}),e._v(" "+e._s(e.$t("Add_to_Plan"))+" ")]),n("button",{staticClass:"dropdown-item",on:{click:function(t){return e.$bvModal.show("id_modal_cook_log")}}},[n("i",{staticClass:"fas fa-clipboard-list fa-fw"}),e._v(" "+e._s(e.$t("Log_Cooking"))+" ")]),n("button",{staticClass:"dropdown-item",attrs:{onclick:"window.print()"}},[n("i",{staticClass:"fas fa-print fa-fw"}),e._v(" "+e._s(e.$t("Print"))+" ")]),n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("view_export")+"?r="+e.recipe.id,target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-file-export fa-fw"}),e._v(" "+e._s(e.$t("Export")))]),e.recipe.internal?n("a",{staticClass:"dropdown-item",attrs:{href:e.resolveDjangoUrl("new_share_link",e.recipe.id),target:"_blank",rel:"noopener noreferrer"}},[n("i",{staticClass:"fas fa-share-alt fa-fw"}),e._v(" "+e._s(e.$t("Share")))]):e._e()])]),n("cook-log",{attrs:{recipe:e.recipe}})],1)},i=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a",{staticClass:"btn shadow-none",attrs:{href:"#",role:"button",id:"dropdownMenuLink","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"}},[n("i",{staticClass:"fas fa-ellipsis-v"})])}],o=(n("a9e3"),n("fa7d")),a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("b-modal",{staticClass:"modal",attrs:{id:"id_modal_cook_log",title:e.$t("Log_Recipe_Cooking"),"ok-title":e.$t("Save"),"cancel-title":e.$t("Close")},on:{ok:function(t){return e.logCook()}}},[n("p",[e._v(e._s(e.$t("all_fields_optional")))]),n("form",[n("label",{attrs:{for:"id_log_servings"}},[e._v(e._s(e.$t("Servings")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.servings,expression:"logObject.servings"}],staticClass:"form-control",attrs:{type:"number",id:"id_log_servings"},domProps:{value:e.logObject.servings},on:{input:function(t){t.target.composing||e.$set(e.logObject,"servings",t.target.value)}}}),n("label",{staticStyle:{"margin-top":"2vh"}},[e._v(e._s(e.$t("Rating"))+" - "),n("span",{attrs:{id:"id_rating_show"}},[e._v(e._s(e.logObject.rating)+"/5")])]),n("b-form-rating",{model:{value:e.logObject.rating,callback:function(t){e.$set(e.logObject,"rating",t)},expression:"logObject.rating"}}),n("label",{staticStyle:{"margin-top":"2vh"},attrs:{for:"id_date"}},[e._v(e._s(e.$t("Date")))]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.logObject.created_at,expression:"logObject.created_at"}],staticClass:"form-control",attrs:{type:"datetime-local",id:"id_date"},domProps:{value:e.logObject.created_at},on:{input:function(t){t.target.composing||e.$set(e.logObject,"created_at",t.target.value)}}})],1)])],1)},s=[],c=n("c1df"),u=n.n(c),d=n("a026"),p=n("5f5b"),h=n("7c15");d["default"].prototype.moment=u.a,d["default"].use(p["a"]);var b={name:"CookLog",props:{recipe:Object},data:function(){return{logObject:{recipe:this.recipe.id,servings:0,rating:0,created_at:u()().format("yyyy-MM-DDTHH:mm")}}},methods:{logCook:function(){Object(h["d"])(this.logObject)}}},l=b,f=n("2877"),j=Object(f["a"])(l,a,s,!1,null,null,null),O=j.exports,v={name:"RecipeContextMenu",mixins:[o["b"]],components:{CookLog:O},data:function(){return{servings_value:0}},props:{recipe:Object,servings:{type:Number,default:-1}},mounted:function(){this.servings_value=-1===this.servings?this.recipe.servings:this.servings}},g=v,m=Object(f["a"])(g,r,i,!1,null,null,null);t["a"]=m.exports}}); \ No newline at end of file diff --git a/cookbook/views/api.py b/cookbook/views/api.py index 429def37d..1e0b4e546 100644 --- a/cookbook/views/api.py +++ b/cookbook/views/api.py @@ -288,7 +288,7 @@ class RecipeSchema(AutoSchema): def get_path_parameters(self, path, method): if not is_list_view(path, method, self.view): - return [] + return super(RecipeSchema, self).get_path_parameters(path,method) parameters = super().get_path_parameters(path, method) parameters.append({ diff --git a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue index d4f9ccdbe..bf2e2fc07 100644 --- a/vue/src/apps/RecipeSearchView/RecipeSearchView.vue +++ b/vue/src/apps/RecipeSearchView/RecipeSearchView.vue @@ -51,7 +51,8 @@
- +
@@ -92,7 +93,9 @@
- {{$t('Close')}} + {{ $t('Close') }} +
@@ -274,7 +277,7 @@ export default { } this.loadMealPlan() - this.loadRecentlyViewed() + this.loadRecentlyViewed() }) this.refreshData() @@ -287,11 +290,9 @@ export default { deep: true }, 'settings.show_meal_plan': function () { - console.log('Test') this.loadMealPlan() }, 'settings.recently_viewed': function () { - console.log('RV') this.loadRecentlyViewed() }, }, @@ -299,27 +300,25 @@ export default { refreshData: function () { let apiClient = new ApiApiFactory() - apiClient.listRecipes({ - query: { - query: this.search_input, - keywords: this.search_keywords.map(function (A) { + apiClient.listRecipes( + this.search_input, + this.search_keywords.map(function (A) { return A["id"]; }), - foods: this.search_foods.map(function (A) { + this.search_foods.map(function (A) { return A["id"]; }), - books: this.search_books.map(function (A) { + this.search_books.map(function (A) { return A["id"]; }), + this.settings.search_keywords_or, + this.settings.search_foods_or, + this.settings.search_books_or, - keywords_or: this.settings.search_keywords_or, - foods_or: this.settings.search_foods_or, - books_or: this.settings.search_books_or, - - internal: this.search_internal, - page: this.pagination_page, - } - }).then(result => { + this.search_internal, + undefined, + this.pagination_page, + ).then(result => { this.recipes = result.data.results this.pagination_count = result.data.count }) diff --git a/vue/src/utils/openapi/.openapi-generator/FILES b/vue/src/utils/openapi/.openapi-generator/FILES index 964f067f0..d15882fcf 100644 --- a/vue/src/utils/openapi/.openapi-generator/FILES +++ b/vue/src/utils/openapi/.openapi-generator/FILES @@ -1,4 +1,3 @@ api.ts -base.ts common.ts configuration.ts diff --git a/vue/src/utils/openapi/api.ts b/vue/src/utils/openapi/api.ts index b2d625a7e..3b8fc879a 100644 --- a/vue/src/utils/openapi/api.ts +++ b/vue/src/utils/openapi/api.ts @@ -21,6 +21,43 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; +/** + * + * @export + * @interface BookmarkletImport + */ +export interface BookmarkletImport { + /** + * + * @type {number} + * @memberof BookmarkletImport + */ + id?: number; + /** + * + * @type {string} + * @memberof BookmarkletImport + */ + url?: string | null; + /** + * + * @type {string} + * @memberof BookmarkletImport + */ + html: string; + /** + * + * @type {string} + * @memberof BookmarkletImport + */ + created_by?: string; + /** + * + * @type {string} + * @memberof BookmarkletImport + */ + created_at?: string; +} /** * * @export @@ -273,6 +310,37 @@ export interface Ingredient { */ no_amount?: boolean; } +/** + * + * @export + * @interface InlineResponse200 + */ +export interface InlineResponse200 { + /** + * + * @type {number} + * @memberof InlineResponse200 + */ + count?: number; + /** + * + * @type {string} + * @memberof InlineResponse200 + */ + next?: string | null; + /** + * + * @type {string} + * @memberof InlineResponse200 + */ + previous?: string | null; + /** + * + * @type {Array} + * @memberof InlineResponse200 + */ + results?: Array; +} /** * * @export @@ -342,10 +410,10 @@ export interface MealPlan { title?: string; /** * - * @type {number} + * @type {MealPlanRecipe} * @memberof MealPlan */ - recipe?: number | null; + recipe?: MealPlanRecipe | null; /** * * @type {string} @@ -401,6 +469,91 @@ export interface MealPlan { */ meal_type_name?: string; } +/** + * + * @export + * @interface MealPlanRecipe + */ +export interface MealPlanRecipe { + /** + * + * @type {number} + * @memberof MealPlanRecipe + */ + id?: number; + /** + * + * @type {string} + * @memberof MealPlanRecipe + */ + name: string; + /** + * + * @type {string} + * @memberof MealPlanRecipe + */ + description?: string | null; + /** + * + * @type {any} + * @memberof MealPlanRecipe + */ + image?: any; + /** + * + * @type {Array} + * @memberof MealPlanRecipe + */ + keywords: Array; + /** + * + * @type {number} + * @memberof MealPlanRecipe + */ + working_time?: number; + /** + * + * @type {number} + * @memberof MealPlanRecipe + */ + waiting_time?: number; + /** + * + * @type {string} + * @memberof MealPlanRecipe + */ + created_by?: string; + /** + * + * @type {string} + * @memberof MealPlanRecipe + */ + created_at?: string; + /** + * + * @type {string} + * @memberof MealPlanRecipe + */ + updated_at?: string; + /** + * + * @type {boolean} + * @memberof MealPlanRecipe + */ + internal?: boolean; + /** + * + * @type {number} + * @memberof MealPlanRecipe + */ + servings?: number; + /** + * + * @type {string} + * @memberof MealPlanRecipe + */ + file_path?: string; +} /** * * @export @@ -1726,7 +1879,8 @@ export enum UserPreferenceDefaultPageEnum { */ export enum UserPreferenceSearchStyleEnum { Small = 'SMALL', - Large = 'LARGE' + Large = 'LARGE', + New = 'NEW' } /** @@ -1767,6 +1921,39 @@ export interface ViewLog { */ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) { return { + /** + * + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createBookmarkletImport: async (bookmarkletImport?: BookmarkletImport, options: any = {}): Promise => { + const localVarPath = `/api/bookmarklet-import/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(bookmarkletImport, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {CookLog} [cookLog] @@ -2427,6 +2614,39 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + destroyBookmarkletImport: async (id: string, options: any = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('destroyBookmarkletImport', 'id', id) + const localVarPath = `/api/bookmarklet-import/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -3129,6 +3349,35 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listBookmarkletImports: async (options: any = {}): Promise => { + const localVarPath = `/api/bookmarklet-import/`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {*} [options] Override http request option. @@ -3391,11 +3640,22 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * optional parameters - **query**: search recipes for a string contained in the recipe name (case in-sensitive) - **limit**: limits the amount of returned results + * + * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. + * @param {string} [keywords] Id of keyword a recipe should have. For multiple repeat parameter. + * @param {string} [foods] Id of food a recipe should have. For multiple repeat parameter. + * @param {string} [books] Id of book 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. + * @param {string} [internal] true or false. If only internal recipes should be returned or not. + * @param {string} [random] true or false. returns the results in randomized order. + * @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} */ - listRecipes: async (options: any = {}): Promise => { + listRecipes: async (query?: string, keywords?: string, foods?: string, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: 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); @@ -3408,6 +3668,50 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + if (query !== undefined) { + localVarQueryParameter['query'] = query; + } + + if (keywords !== undefined) { + localVarQueryParameter['keywords'] = keywords; + } + + if (foods !== undefined) { + localVarQueryParameter['foods'] = foods; + } + + if (books !== undefined) { + localVarQueryParameter['books'] = books; + } + + if (keywordsOr !== undefined) { + localVarQueryParameter['keywords_or'] = keywordsOr; + } + + if (foodsOr !== undefined) { + localVarQueryParameter['foods_or'] = foodsOr; + } + + if (booksOr !== undefined) { + localVarQueryParameter['books_or'] = booksOr; + } + + if (internal !== undefined) { + localVarQueryParameter['internal'] = internal; + } + + if (random !== undefined) { + localVarQueryParameter['random'] = random; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (pageSize !== undefined) { + localVarQueryParameter['page_size'] = pageSize; + } + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); @@ -3767,6 +4071,43 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + partialUpdateBookmarkletImport: async (id: string, bookmarkletImport?: BookmarkletImport, options: any = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('partialUpdateBookmarkletImport', 'id', id) + const localVarPath = `/api/bookmarklet-import/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(bookmarkletImport, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -4507,6 +4848,39 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retrieveBookmarkletImport: async (id: string, options: any = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('retrieveBookmarkletImport', 'id', id) + const localVarPath = `/api/bookmarklet-import/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -5233,6 +5607,43 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) options: localVarRequestOptions, }; }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateBookmarkletImport: async (id: string, bookmarkletImport?: BookmarkletImport, options: any = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateBookmarkletImport', 'id', id) + const localVarPath = `/api/bookmarklet-import/{id}/` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(bookmarkletImport, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -5983,6 +6394,16 @@ export const ApiApiAxiosParamCreator = function (configuration?: Configuration) export const ApiApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = ApiApiAxiosParamCreator(configuration) return { + /** + * + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createBookmarkletImport(bookmarkletImport?: BookmarkletImport, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createBookmarkletImport(bookmarkletImport, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {CookLog} [cookLog] @@ -6183,6 +6604,16 @@ export const ApiApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.createViewLog(viewLog, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async destroyBookmarkletImport(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.destroyBookmarkletImport(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -6394,6 +6825,15 @@ export const ApiApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.imageRecipe(id, image, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listBookmarkletImports(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listBookmarkletImports(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {*} [options] Override http request option. @@ -6476,12 +6916,23 @@ export const ApiApiFp = function(configuration?: Configuration) { return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** - * optional parameters - **query**: search recipes for a string contained in the recipe name (case in-sensitive) - **limit**: limits the amount of returned results + * + * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. + * @param {string} [keywords] Id of keyword a recipe should have. For multiple repeat parameter. + * @param {string} [foods] Id of food a recipe should have. For multiple repeat parameter. + * @param {string} [books] Id of book 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. + * @param {string} [internal] true or false. If only internal recipes should be returned or not. + * @param {string} [random] true or false. returns the results in randomized order. + * @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 listRecipes(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listRecipes(options); + async listRecipes(query?: string, keywords?: string, foods?: string, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, page?: number, pageSize?: number, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRecipes(query, keywords, foods, books, keywordsOr, foodsOr, booksOr, internal, random, page, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** @@ -6592,6 +7043,17 @@ export const ApiApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.listViewLogs(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async partialUpdateBookmarkletImport(id: string, bookmarkletImport?: BookmarkletImport, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.partialUpdateBookmarkletImport(id, bookmarkletImport, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -6812,6 +7274,16 @@ export const ApiApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.partialUpdateViewLog(id, viewLog, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async retrieveBookmarkletImport(id: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveBookmarkletImport(id, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -7032,6 +7504,17 @@ export const ApiApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.retrieveViewLog(id, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateBookmarkletImport(id: string, bookmarkletImport?: BookmarkletImport, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateBookmarkletImport(id, bookmarkletImport, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -7262,6 +7745,15 @@ export const ApiApiFp = function(configuration?: Configuration) { export const ApiApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = ApiApiFp(configuration) return { + /** + * + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createBookmarkletImport(bookmarkletImport?: BookmarkletImport, options?: any): AxiosPromise { + return localVarFp.createBookmarkletImport(bookmarkletImport, options).then((request) => request(axios, basePath)); + }, /** * * @param {CookLog} [cookLog] @@ -7442,6 +7934,15 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: createViewLog(viewLog?: ViewLog, options?: any): AxiosPromise { return localVarFp.createViewLog(viewLog, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + destroyBookmarkletImport(id: string, options?: any): AxiosPromise { + return localVarFp.destroyBookmarkletImport(id, options).then((request) => request(axios, basePath)); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -7632,6 +8133,14 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: imageRecipe(id: string, image?: any, options?: any): AxiosPromise { return localVarFp.imageRecipe(id, image, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listBookmarkletImports(options?: any): AxiosPromise> { + return localVarFp.listBookmarkletImports(options).then((request) => request(axios, basePath)); + }, /** * * @param {*} [options] Override http request option. @@ -7705,12 +8214,23 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: return localVarFp.listRecipeBooks(options).then((request) => request(axios, basePath)); }, /** - * optional parameters - **query**: search recipes for a string contained in the recipe name (case in-sensitive) - **limit**: limits the amount of returned results + * + * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. + * @param {string} [keywords] Id of keyword a recipe should have. For multiple repeat parameter. + * @param {string} [foods] Id of food a recipe should have. For multiple repeat parameter. + * @param {string} [books] Id of book 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. + * @param {string} [internal] true or false. If only internal recipes should be returned or not. + * @param {string} [random] true or false. returns the results in randomized order. + * @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} */ - listRecipes(options?: any): AxiosPromise> { - return localVarFp.listRecipes(options).then((request) => request(axios, basePath)); + listRecipes(query?: string, keywords?: string, foods?: string, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, page?: number, pageSize?: number, options?: any): AxiosPromise { + return localVarFp.listRecipes(query, keywords, foods, books, keywordsOr, foodsOr, booksOr, internal, random, page, pageSize, options).then((request) => request(axios, basePath)); }, /** * @@ -7808,6 +8328,16 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: listViewLogs(options?: any): AxiosPromise> { return localVarFp.listViewLogs(options).then((request) => request(axios, basePath)); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + partialUpdateBookmarkletImport(id: string, bookmarkletImport?: BookmarkletImport, options?: any): AxiosPromise { + return localVarFp.partialUpdateBookmarkletImport(id, bookmarkletImport, options).then((request) => request(axios, basePath)); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -8008,6 +8538,15 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: partialUpdateViewLog(id: string, viewLog?: ViewLog, options?: any): AxiosPromise { return localVarFp.partialUpdateViewLog(id, viewLog, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + retrieveBookmarkletImport(id: string, options?: any): AxiosPromise { + return localVarFp.retrieveBookmarkletImport(id, options).then((request) => request(axios, basePath)); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -8206,6 +8745,16 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: retrieveViewLog(id: string, options?: any): AxiosPromise { return localVarFp.retrieveViewLog(id, options).then((request) => request(axios, basePath)); }, + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateBookmarkletImport(id: string, bookmarkletImport?: BookmarkletImport, options?: any): AxiosPromise { + return localVarFp.updateBookmarkletImport(id, bookmarkletImport, options).then((request) => request(axios, basePath)); + }, /** * * @param {string} id A unique integer value identifying this cook log. @@ -8416,6 +8965,17 @@ export const ApiApiFactory = function (configuration?: Configuration, basePath?: * @extends {BaseAPI} */ export class ApiApi extends BaseAPI { + /** + * + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiApi + */ + public createBookmarkletImport(bookmarkletImport?: BookmarkletImport, options?: any) { + return ApiApiFp(this.configuration).createBookmarkletImport(bookmarkletImport, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {CookLog} [cookLog] @@ -8636,6 +9196,17 @@ export class ApiApi extends BaseAPI { return ApiApiFp(this.configuration).createViewLog(viewLog, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiApi + */ + public destroyBookmarkletImport(id: string, options?: any) { + return ApiApiFp(this.configuration).destroyBookmarkletImport(id, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {string} id A unique integer value identifying this cook log. @@ -8868,6 +9439,16 @@ export class ApiApi extends BaseAPI { return ApiApiFp(this.configuration).imageRecipe(id, image, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiApi + */ + public listBookmarkletImports(options?: any) { + return ApiApiFp(this.configuration).listBookmarkletImports(options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {*} [options] Override http request option. @@ -8959,13 +9540,24 @@ export class ApiApi extends BaseAPI { } /** - * optional parameters - **query**: search recipes for a string contained in the recipe name (case in-sensitive) - **limit**: limits the amount of returned results + * + * @param {string} [query] Query string matched (fuzzy) against recipe name. In the future also fulltext search. + * @param {string} [keywords] Id of keyword a recipe should have. For multiple repeat parameter. + * @param {string} [foods] Id of food a recipe should have. For multiple repeat parameter. + * @param {string} [books] Id of book 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. + * @param {string} [internal] true or false. If only internal recipes should be returned or not. + * @param {string} [random] true or false. returns the results in randomized order. + * @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 listRecipes(options?: any) { - return ApiApiFp(this.configuration).listRecipes(options).then((request) => request(this.axios, this.basePath)); + public listRecipes(query?: string, keywords?: string, foods?: string, books?: string, keywordsOr?: string, foodsOr?: string, booksOr?: string, internal?: string, random?: string, page?: number, pageSize?: number, options?: any) { + return ApiApiFp(this.configuration).listRecipes(query, keywords, foods, books, keywordsOr, foodsOr, booksOr, internal, random, page, pageSize, options).then((request) => request(this.axios, this.basePath)); } /** @@ -9088,6 +9680,18 @@ export class ApiApi extends BaseAPI { return ApiApiFp(this.configuration).listViewLogs(options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiApi + */ + public partialUpdateBookmarkletImport(id: string, bookmarkletImport?: BookmarkletImport, options?: any) { + return ApiApiFp(this.configuration).partialUpdateBookmarkletImport(id, bookmarkletImport, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {string} id A unique integer value identifying this cook log. @@ -9328,6 +9932,17 @@ export class ApiApi extends BaseAPI { return ApiApiFp(this.configuration).partialUpdateViewLog(id, viewLog, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiApi + */ + public retrieveBookmarkletImport(id: string, options?: any) { + return ApiApiFp(this.configuration).retrieveBookmarkletImport(id, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {string} id A unique integer value identifying this cook log. @@ -9570,6 +10185,18 @@ export class ApiApi extends BaseAPI { return ApiApiFp(this.configuration).retrieveViewLog(id, options).then((request) => request(this.axios, this.basePath)); } + /** + * + * @param {string} id A unique integer value identifying this bookmarklet import. + * @param {BookmarkletImport} [bookmarkletImport] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ApiApi + */ + public updateBookmarkletImport(id: string, bookmarkletImport?: BookmarkletImport, options?: any) { + return ApiApiFp(this.configuration).updateBookmarkletImport(id, bookmarkletImport, options).then((request) => request(this.axios, this.basePath)); + } + /** * * @param {string} id A unique integer value identifying this cook log.