feat: Recipe Actions (#3448)

Co-authored-by: boc-the-git <3479092+boc-the-git@users.noreply.github.com>
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2024-05-01 09:20:52 +02:00
1 parent ee87a14401
commit 3807778e2f
22 files changed
+860 -10

No files matched your search

@@ -81,12 +81,60 @@ The meal planner has the concept of plan rules. These offer a flexible way to us
The shopping lists feature is a great way to keep track of what you need to buy for your next meal. You can add items directly to the shopping list or link a recipe and all of it's ingredients to track meals during the week.
!!! warning
At this time there isn't a tight integration between meal-plans and shopping lists; however, it's something we have planned for the future.
[Shopping List Demo](https://demo.mealie.io/shopping-lists){ .md-button .md-button--primary }
## Integrations
Mealie is designed to integrate with many different external services. There are several ways you can integrate with Mealie to achieve custom IoT automations, data synchronization, and anything else you can think of. [You can work directly with Mealie through the API](./api-usage.md), or leverage other services to make seamless integrations.
### Notifiers
Notifiers are event-driven notifications sent when specific actions are performed within Mealie. Some actions include:
- creating a recipe
- adding items to a shopping list
- creating a new mealplan
Notifiers use the [Apprise library](https://github.com/caronc/apprise/wiki), which integrates with a large number of notification services. In addition, certain custom notifiers send basic event data to the consumer (e.g. the `id` of the resource). These include:
- `form` and `forms`
- `json` and `jsons`
- `xml` and `xmls`
[Notifiers Demo](https://demo.mealie.io/group/notifiers){ .md-button .md-button--primary }
### Webhooks
Unlike notifiers, which are event-driven notifications, Webhooks allow you to send scheduled notifications to your desired endpoint. Webhooks are sent on the day of a scheduled mealplan, at the specified time, and contain the mealplan data in the request.
[Webhooks Demo](https://demo.mealie.io/group/webhooks){ .md-button .md-button--primary }
### Recipe Actions
Recipe Actions are custom actions you can add to all recipes in Mealie. This is a great way to add custom integrations that are fired manually. There are two types of recipe actions:
1. link - these actions will take you directly to an external page
2. post - these actions will send a `POST` request to the specified URL, with the recipe JSON in the request body. These can be used, for instance, to manually trigger a webhook in Home Assistant
Recipe Action URLs can include merge fields to inject the current recipe's data. For instance, you can use the following URL to include a Google search with the recipe's slug:
```
https://www.google.com/search?q=${slug}
```
When the action is clicked on, the `${slug}` field is replaced with the recipe's slug value. So, for example, it might take you to this URL on one of your recipes:
```
https://www.google.com/search?q=pasta-fagioli
```
A common use case for "link" recipe actions is to integrate with the Bring! shopping list. Simply add a Recipe Action with the following URL:
```
https://api.getbring.com/rest/bringrecipes/deeplink?url=${url}&source=web
```
Below is a list of all valid merge fields:
- ${id}
- ${slug}
- ${url}
To add, modify, or delete Recipe Actions, visit the Data Management page (more on that below).
## Data Management
+1 -1
View File
@@ -14,7 +14,7 @@
<div id="redoc-container"></div>
<script src="https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
<script>
var spec = {"openapi": "3.1.0", "info": {"title": "Mealie", "description": "\nMealie is a web application for managing your recipes, meal plans, and shopping lists. This is the Restful\nAPI interactive documentation that can be used to explore the API. If you're justing getting started with\nthe API and want to get started quickly, you can use the\n[API Usage | Mealie Docs](https://nightly.mealie.io/documentation/getting-started/api-usage/)\nas a reference for how to get started.\n\n\nAs of this release <b>develop</b>, Mealie is still in rapid development and therefore some of these APIs may\nchange from version to version.\n\n\nIf you have any questions or comments about mealie, please use the discord server to talk to the developers or other\ncommunity members. If you'd like to file an issue, please use the\n[GitHub Issue Tracker | Mealie](https://github.com/mealie-recipes/mealie/issues/new/choose)\n\n\n## Helpful Links\n- [Home Page](https://mealie.io)\n- [Documentation](https://nightly.mealie.io)\n- [Discord](https://discord.gg/QuStdQGSGK)\n- [Demo](https://demo.mealie.io)\n- [Beta](https://demo.mealie.io)\n", "version": "develop"}, "paths": {"/api/app/about": {"get": {"tags": ["App: About"], "summary": "Get App Info", "description": "Get general application information", "operationId": "get_app_info_api_app_about_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppInfo"}}}}}}}, "/api/app/about/startup-info": {"get": {"tags": ["App: About"], "summary": "Get Startup Info", "description": "returns helpful startup information", "operationId": "get_startup_info_api_app_about_startup_info_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppStartupInfo"}}}}}}}, "/api/app/about/theme": {"get": {"tags": ["App: About"], "summary": "Get App Theme", "description": "Get's the current theme settings", "operationId": "get_app_theme_api_app_about_theme_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppTheme"}}}}}}}, "/api/app/about/oidc": {"get": {"tags": ["App: About"], "summary": "Get Oidc Info", "description": "Get's the current OIDC configuration needed for the frontend", "operationId": "get_oidc_info_api_app_about_oidc_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OIDCInfo"}}}}}}}, "/api/auth/token": {"post": {"tags": ["Users: Authentication"], "summary": "Get Token", "operationId": "get_token_api_auth_token_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"allOf": [{"$ref": "#/components/schemas/Body_get_token_api_auth_token_post"}], "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/auth/refresh": {"get": {"tags": ["Users: Authentication"], "summary": "Refresh Token", "description": "Use a valid token to get another token", "operationId": "refresh_token_api_auth_refresh_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/users/register": {"post": {"tags": ["Users: Registration"], "summary": "Register New User", "operationId": "register_new_user_api_users_register_post", "parameters": [{"name": "group_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid4"}, {"type": "null"}], "title": "Group Id"}}, {"name": "accept-language", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Accept-Language"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateUserRegistration"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/users/group-users": {"get": {"tags": ["Users: CRUD"], "summary": "Get All Group Users", "description": "Returns all users from the current group", "operationId": "get_all_group_users_api_users_group_users_get", "security": [{"OAuth2PasswordBearer": []}, {"OAuth2PasswordBearer": []}], "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "default": 1, "title": "Page"}}, {"name": "perPage", "in": "query", "required": false, "schema": {"type": "integer", "default": 50, "title": "Perpage"}}, {"name": "orderBy", "in":Line truncated
var spec = {"openapi": "3.1.0", "info": {"title": "Mealie", "description": "\nMealie is a web application for managing your recipes, meal plans, and shopping lists. This is the Restful\nAPI interactive documentation that can be used to explore the API. If you're justing getting started with\nthe API and want to get started quickly, you can use the\n[API Usage | Mealie Docs](https://nightly.mealie.io/documentation/getting-started/api-usage/)\nas a reference for how to get started.\n\n\nAs of this release <b>develop</b>, Mealie is still in rapid development and therefore some of these APIs may\nchange from version to version.\n\n\nIf you have any questions or comments about mealie, please use the discord server to talk to the developers or other\ncommunity members. If you'd like to file an issue, please use the\n[GitHub Issue Tracker | Mealie](https://github.com/mealie-recipes/mealie/issues/new/choose)\n\n\n## Helpful Links\n- [Home Page](https://mealie.io)\n- [Documentation](https://nightly.mealie.io)\n- [Discord](https://discord.gg/QuStdQGSGK)\n- [Demo](https://demo.mealie.io)\n- [Beta](https://demo.mealie.io)\n", "version": "develop"}, "paths": {"/api/app/about": {"get": {"tags": ["App: About"], "summary": "Get App Info", "description": "Get general application information", "operationId": "get_app_info_api_app_about_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppInfo"}}}}}}}, "/api/app/about/startup-info": {"get": {"tags": ["App: About"], "summary": "Get Startup Info", "description": "returns helpful startup information", "operationId": "get_startup_info_api_app_about_startup_info_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppStartupInfo"}}}}}}}, "/api/app/about/theme": {"get": {"tags": ["App: About"], "summary": "Get App Theme", "description": "Get's the current theme settings", "operationId": "get_app_theme_api_app_about_theme_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AppTheme"}}}}}}}, "/api/app/about/oidc": {"get": {"tags": ["App: About"], "summary": "Get Oidc Info", "description": "Get's the current OIDC configuration needed for the frontend", "operationId": "get_oidc_info_api_app_about_oidc_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/OIDCInfo"}}}}}}}, "/api/auth/token": {"post": {"tags": ["Users: Authentication"], "summary": "Get Token", "operationId": "get_token_api_auth_token_post", "requestBody": {"content": {"application/x-www-form-urlencoded": {"schema": {"allOf": [{"$ref": "#/components/schemas/Body_get_token_api_auth_token_post"}], "title": "Body"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/auth/refresh": {"get": {"tags": ["Users: Authentication"], "summary": "Refresh Token", "description": "Use a valid token to get another token", "operationId": "refresh_token_api_auth_refresh_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}, "security": [{"OAuth2PasswordBearer": []}]}}, "/api/users/register": {"post": {"tags": ["Users: Registration"], "summary": "Register New User", "operationId": "register_new_user_api_users_register_post", "parameters": [{"name": "group_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string", "format": "uuid4"}, {"type": "null"}], "title": "Group Id"}}, {"name": "accept-language", "in": "header", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Accept-Language"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/CreateUserRegistration"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UserOut"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/api/users/group-users": {"get": {"tags": ["Users: CRUD"], "summary": "Get All Group Users", "description": "Returns all users from the current group", "operationId": "get_all_group_users_api_users_group_users_get", "security": [{"OAuth2PasswordBearer": []}, {"OAuth2PasswordBearer": []}], "parameters": [{"name": "page", "in": "query", "required": false, "schema": {"type": "integer", "default": 1, "title": "Page"}}, {"name": "perPage", "in": "query", "required": false, "schema": {"type": "integer", "default": 50, "title": "Perpage"}}, {"name": "orderBy", "in":Line truncated
Redoc.init(spec, {}, document.getElementById("redoc-container"));
</script>