89 Commits

Author SHA1 Message Date
renovate[bot]
076410071c
chore(deps): update dependency ruff to ^0.0.252 (#2155)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-23 09:30:02 -09:00
renovate[bot]
0a54285674
fix(deps): update dependency fastapi to ^0.92.0 (#2128)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-19 15:48:33 -09:00
renovate[bot]
8e43fc6848
chore(deps): update dependency ruff to ^0.0.247 (#2125)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-19 15:32:55 -09:00
renovate[bot]
7fe74cf997
fix(deps): update dependency aiofiles to v23 (#2108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-11 10:41:08 -09:00
renovate[bot]
f9ba7711ec
fix(deps): update dependency fastapi to ^0.91.0 (#2106)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-11 10:21:56 -09:00
renovate[bot]
92662b3780
chore(deps): update dependency mypy to v1 (#2101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-11 10:11:25 -09:00
Hayden
9e77a9f367
prs-fleshgolem-2070: feat: sqlalchemy 2.0 (#2096)
* upgrade sqlalchemy to 2.0

* rewrite all db models to sqla 2.0 mapping api

* fix some importing and typing weirdness

* fix types of a lot of nullable columns

* remove get_ref methods

* fix issues found by tests

* rewrite all queries in repository_recipe to 2.0 style

* rewrite all repository queries to 2.0 api

* rewrite all remaining queries to 2.0 api

* remove now-unneeded __allow_unmapped__ flag

* remove and fix some unneeded cases of "# type: ignore"

* fix formatting

* bump black version

* run black

* can this please be the last one. okay. just. okay.

* fix repository errors

* remove return

* drop open API validator

---------

Co-authored-by: Sören Busch <fleshgolem@gmx.net>
2023-02-06 18:43:12 -09:00
Hayden
f3a26f864d
chore: update linters (#2095)
* update deps

* ruff auto-fixes

* refactor match statements where possible
2023-02-05 09:51:44 -09:00
renovate[bot]
28d24875a3
fix(deps): update dependency python-slugify to v8 (#2069)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-28 16:06:27 -09:00
renovate[bot]
ed797ef8b2
chore(deps): update dependency ruff to ^0.0.237 (#2035)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-28 15:47:22 -09:00
Sören
3415a9c310
Convert scraper to use async (#1915)
* add httpx depedency for async http requests

* rework scraper strategies to download recipe html asynchronously

* rework recipe_data_service to download recipe images asynchronously

* fix recipe_parser test, so it can use async results

* fix bulk import so that it also works with async scraper

* fix broken recipe_parser tests

* Fix issues found by scanners

* Add additional checks for ingredient and instruction count in test_create_by_url

* Revert changes in test recipe_data
Since we are checking ingredients and instructions in test_create_url now, these would fail with the stored html of recipe data

* Add explicit type annotation in recipe_data_service.largest_content_len

* Fix typo in annotation
2023-01-28 15:43:27 -09:00
renovate[bot]
f1a31ce33d
chore(deps): update dependency ruff to ^0.0.221 (#2022)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-14 09:32:56 -09:00
renovate[bot]
7d94209f3e
chore(deps): update dependency ruff to ^0.0.215 (#1996)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-08 08:04:58 -09:00
renovate[bot]
9774f17f64
fix(deps): update dependency fastapi to ^0.89.0 (#1997)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-07 18:22:08 -09:00
renovate[bot]
fd71352a1b
chore(deps): update dependency mkdocs-material to v9 (#1974)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-06 21:47:29 -09:00
renovate[bot]
e1bc009faf
chore(deps): update dependency ruff to ^0.0.212 (#1987)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-06 21:41:10 -09:00
renovate[bot]
3b8684265b
chore(deps): update dependency ruff to ^0.0.210 (#1985)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-04 11:33:30 -09:00
renovate[bot]
fcf680fe0b
chore(deps): update dependency ruff to ^0.0.209 (#1975)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-03 16:53:06 -09:00
renovate[bot]
ab13e8e42e
fix(deps): update dependency aniso8601 to v9 (#1971)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-01 15:44:19 -09:00
renovate[bot]
0700220418
fix(deps): update dependency python-slugify to v7 (#1972)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-01 14:07:01 -09:00
Hayden
4d5550ad85
chore: mypy, ruff, extract, openapi, and recipes-scraper updates (#1968)
* bump ruff and mypy

* mypy fixes

* bump and fix openapi

* drop debug statement

* bump extruct

* bump recipes-scrapers
2023-01-01 13:47:27 -09:00
renovate[bot]
51cc034ef9
chore(deps): update dependency coverage to v7 (#1959)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-01 11:53:51 -09:00
renovate[bot]
a71067e3ec
chore(deps): update dependency types-python-slugify to v6 (#1962)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-01 11:29:49 -09:00
renovate[bot]
540ac0a36a
chore(deps): update dependency rich to v13 (#1960)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-01 09:21:01 -08:00
Hayden
d9c39cc1d0
chore: bump aiofiles, dotenv, fastapi, pydantic, uvicorn (#1944)
* update aiofiles and dotenv

* bump fastapi and pydantic

* update testclient

* bump ruff and uvicorn
2022-12-30 11:44:54 -09:00
renovate[bot]
2e51a581f0
fix(deps): update dependency aiofiles to v0.8.0 (#1926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-30 11:12:25 -09:00
renovate[bot]
dc6cb5a0c3
fix(deps): update dependency tzdata to v2022 (#1933)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-29 16:11:07 -09:00
renovate[bot]
befb922739
chore(deps): update dependency rich to v12 (#1931)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-29 15:16:43 -09:00
renovate[bot]
36b6f1eecd
chore(deps): update dependency ruff to ^0.0.200 (#1924)
* chore(deps): update dependency ruff to ^0.0.200

* resolve ruff errors

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-12-29 14:48:32 -09:00
Hayden
3ae72cfda1
chore: fix poetry breaking changes (#1921)
* poetry stop breaking my things

* bump poetry version

* drop dependabot
2022-12-29 14:21:48 -09:00
Hayden
82dc586bac
chores: updates-and-linters (#1868)
* switch to ruff

* add ruff

* run ruff --fix

* update ruff

* resolve ruff errors

* drop isort from CI

* fix decorator order
2022-11-30 20:20:28 -09:00
Hayden
84c23765cd
fix: strict optional errors (#1759)
* fix strict optional errors

* fix typing in repository

* fix backup db files location

* update workspace settings
2022-10-23 13:04:04 -08:00
Hayden
0d953da5b0
fix: require python-dateutil in dependencies (#1752) 2022-10-22 10:44:32 -08:00
Hayden
0bb1b6500f
refactor: implement email with stdlib and drop email dependency (#1746)
* implement email with stdlib and drop dependency

* potentially provide in logs
2022-10-21 19:12:27 -08:00
Hayden
c9929745f8
fix: properly check recipe settings using database value (#1744)
* fix #1742

* bump depts to bust cache

* revert regression

* ensure permission checked on delete
2022-10-21 16:48:31 -08:00
Hayden
9ecef4c25f
chore: file generation cleanup (#1736)
This PR does too many things :( 

1. Major refactoring of the dev/scripts and dev/code-generation folders. 

Primarily this was removing duplicate code and cleaning up some poorly written code snippets as well as making them more idempotent so then can be re-run over and over again but still maintain the same results. This is working on my machine, but I've been having problems in CI and comparing diffs so running generators in CI will have to wait. 

2. Re-Implement using the generated api routes for testing

This was a _huge_ refactor that touched damn near every test file but now we have auto-generated typed routes with inline hints and it's used for nearly every test excluding a few that use classes for better parameterization. This should greatly reduce errors when writing new tests. 

3. Minor Perf improvements for the All Recipes endpoint

  A. Removed redundant loops
  B. Uses orjson to do the encoding directly and returns a byte response instead of relying on the default 
       jsonable_encoder.

4. Fix some TS type errors that cropped up for seemingly no reason half way through the PR.

See this issue https://github.com/phillipdupuis/pydantic-to-typescript/issues/28

Basically, the generated TS type is not-correct since Pydantic will automatically fill in null fields. The resulting TS type is generated with a ? to indicate it can be null even though we _know_ that i can't be.
2022-10-18 14:49:41 -08:00
Hayden
6159b55be9
fix: image and CI errors (#1694)
* bump cache version

* bump version

* delete template file

* maybe fix invalid CI?

* chain status command

* fix add tesseract bin to container & bump poetry (#1676)

* Add tesseract bin to container

* Add tesseract bin

Co-authored-by: Miroito <88556823+Miroito@users.noreply.github.com>
2022-10-02 16:24:13 -08:00
Hayden
1d204e9f48
backend: bump deps (#1671) 2022-09-25 16:01:25 -08:00
Hayden
39adea4ee3
feat (WIP): bring png OCR scanning support (#1670)
* Add pytesseract

* Add simple ocr endpoint

replace extension argument

* feat/ocr-editor gui

* fix frontend linting issues

* Add service unit tests

* Add split text modes & single ingredient/instruction editing

* make split mode really reactive

* Remove default step and ingredient

* make the linter haappy

* Accept only image uploads

* Add automatic recipe title suggestion

* Correct regex

* fix incorrect array.map method usage

* make the linter happy again

* Swap route to use asset name

* Rearange buttons

* fix test data

* feat: Allow making image the recipe image

* Add translation

* Make the linter happy

* Restrict function setPropertyValueByPath generic

* Restrict template literal type

* Add a more friendly icon to creation page

* update poetry lock file

* Correct sloppy ocr classes

* Make MyPy happy

* Rewrite safer tests

* Add tesseract to backend test CI container dependencies

* Make canvas element a component global

* Remove unwanted spaces in selected text

* Add way to know if recipe was created with ocr

* Access to ocr-editor for ocr recipes

* Update Alembic revision

* Make the frontend build

* Fix scrolling offset bug

* Allow creation of recipes with custom settings

* Fix rebasing mistakes

* Add format_tsv_output test

* Exclude the tests data directory only

* Enforce camelCase for frontend functions

* Remove import of unused component

* Fix type and class initialization

* Add multi-language support

* Highlight words in mount

* Fix image ratio bug

* Better ocr creation page

* Revert awkward feature to scroll in Selection mode

* Rebasing alembic migrations sux

* Remove obsolete getShared function

* Add function docstring

* Move down ocr creation option

* Make toolbar icons more generic

* Show help at the bottom of the page

* move ocr types to own file

* Use template ref for the canvas

* Use i18n.tc to get strings directly

* Correct naming mistake

* Move Ocr editor to own directory

* Create Ocr Editor parts

* Safeguard recipe properties access

* Add loading frontend animation due to longer request time

* minor cleanup chores

Co-authored-by: Miroito <alban.vachette@gmail.com>
2022-09-25 15:00:45 -08:00
Hayden
2865bcbb04
fix: missing user agent for scraper (#1586)
* set user agent for requests.get

* bump scraper version
2022-08-20 17:54:06 -08:00
Hayden
ef24705cfa
fix: ignore-place-in-search (#1544)
* pin i18n since it breaks things

* set ignoreLocation to true

* revert composition api demotion

* bump slugify
2022-08-09 20:34:08 -08:00
Hayden
60ecba2f92
chore: deps-dev-bump (#1533)
* bump dev dependencies

* fix/generate font sheets

* bump python deps to nuke cache
2022-08-08 17:58:10 -08:00
Philipp Fischbeck
34cd6eb687
fix: validate OpenAPI spec (#1528)
* init api check test

* Fix openAPI issues

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-08-06 16:54:29 -08:00
Hayden
13850cda1f
security: multiple reported CVE fixes (#1515)
* update out of date license

* update typing / refactor

* fix arbitrarty path injection

* use markdown sanatizer to prevent XSS CWE-79

* fix CWE-918 SSRF by validating url and mime type

* add security docs

* update recipe-scrapers

* resolve DOS from arbitrary url

* update changelog

* bump version

* add ref to #1506

* add #1511 to changelog

* use requests decoder

* actually fix encoding issue
2022-07-31 13:10:20 -08:00
Michael Genson
7f50071312
feat: advanced filtering API (#1468)
* created query filter classes

* extended pagination to include query filtering

* added filtering tests

* type improvements

* move type help to dev depedency

* minor type and perf fixes

* breakup test cases

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
2022-07-09 20:57:09 -08:00
Hayden
5a053cdcd6
feat: mealplan-webhooks (#1403)
* fix type errors on event bus

* webhooks fields required for new implementation

* db migration

* wip: webhook query + tests and stub function

* ignore type checker error

* type and method cleanup

* datetime and time utc validator

* update testing code for utc scheduled time

* fix file cmp function call

* update version_number

* add support for translating "time" objects when restoring backup

* bump recipe-scrapers

* use specific import syntax

* generate frontend types

* utilize names exports

* use utc times

* add task to scheduler

* implement new scheduler functionality

* stub for type annotation

* implement meal-plan data getter

* add experimental banner
2022-06-17 13:25:47 -08:00
Hayden
56eb0bca71
release: prep beta 3 (#1349)
* docs: add tag documentation

* bump docker-compose tags

* minor language changes

* beta3 changelog

* auto-gen API docs

* bump version

* bump recipe-scrapers
2022-06-07 11:19:24 -08:00
Hayden
4c594a48dc
wip: pagination-repository (#1316)
* bump mypy

* add pagination + refactor generic repo

* add pagination test

* remove all query object
2022-05-30 10:30:54 -08:00
Hayden
137bf9de91
bump recipe scrapers version (#1303) 2022-05-28 16:38:47 -08:00
Hayden
8235bd5104
chore: bump deps (#1252)
* bump deps

* fix: add apt-get update
2022-05-22 11:52:57 -08:00