Commit Graph

34 Commits

Author SHA1 Message Date
Rijk van Zanten
9c49c4eb46 Fixed unique constraint violation error extraction for MySQL 5.7 (#6059)
* Add MySQL 5.7 docker debug instance

* Fix unique error constraint extraction in MySQL 5.7

Fixes #5719
2021-06-03 23:33:31 -04:00
Rijk van Zanten
77e00b7db4 Don't initialize database on file require (#6003) 2021-06-02 11:41:42 -04:00
Rijk van Zanten
8d3102fbad Add max concurrency and max image transform size support (#5795)
* Add assets concurrency and max size controls

* Render no-thumbnail images nicer in app

* Document new asset environment variables

* Update package-lock
2021-05-20 18:18:10 -04:00
Rijk van Zanten
f3574deae0 Ask for value when changing nullable to not-nullable (#5400)
* Add ContainsNullValues exception abstraction

* Add dialog for null values when disabling non-null

Fixes #2934

* Add translation for CONTAINS_NULL_VALUE error

* Make dialog title translated
2021-04-30 15:27:18 -04:00
rijkvanzanten
801e868554 Fix remaining eslint errors
h/t @paescuj
2021-04-29 15:55:12 -04:00
Pascal Jufer
acd41eb0be Syntax fixes (#5367)
* Declare return types on functions

And a very few other type related minor fixes

* Minor syntax fixes

* Remove unnecessary escape chars in regexes
* Remove unnecessary awaits
* Replace deprecated req.connection with req.socket
* Replace deprecated upload with uploadOne
* Remove unnecessary eslint-disable-next-line comments
* Comment empty functions / catch or finally clauses
* Fix irregular whitespaces
* Add missing returns (null)
* Remove unreachable code
* A few logical fixes
* Remove / Handle non-null assertions which are certainly unnecessary (e.g. in
tests)
2021-04-29 12:11:43 -04:00
rijkvanzanten
26850b08d3 Make unique error nicer on duplicate email invite
Fixes #5157
2021-04-23 19:06:41 -04:00
Rijk van Zanten
f1e2338142 Add auth password policy / login attempts support (#5225)
* Check auth password policy on user modifications

* Show validation errors in drawer-batch

* Allow custom password policy, add placeholder

* Add UserSuspended exception

* Add user suspended error translation

* Move rate limiter creation into root helper

* Add login attempts support to authentication service

* Don't authenticate into settings service when checking password policy
2021-04-23 17:42:46 -04:00
Rijk van Zanten
3b05372713 Finalize services API (#5170)
* Start the xOne/xMany work

* Update update/upsert

* Finish updating itemsservice

* Add comments, add nested revisions on update

* Use new internal api

* Update collectionService to one/many structure

* Move files to one/many structure

* Move permissions to one/many structure

* Move relations service to one/many structure

* Move roles to one/many structure

* Move users service over

* Move webhooks to updated structure

* Move deprecated methods to the bottom

* Replace deprecated uses

* Use new methods in controllers, add batch update/delete by query

* Use updated methods in API

* Fix email being required

* Remove unnecessary DB call

* Fix batch update/delete validation
2021-04-20 18:06:27 -04:00
Rijk van Zanten
1fb4db1fda Add _regex validation operator (#5089)
Closes #2917
2021-04-15 17:25:51 -04:00
rijkvanzanten
0f5a98f4f2 Fix unique error extraction in MySQL
Fixes #4995
2021-04-12 17:28:41 -04:00
Rijk van Zanten
f90c31b798 GraphQL 2.0 (#4625)
* Start on GraphQL "2.0", add methodnotallowed exceptoin

* Fix relative file pointer in peer dep

* [WIP] Add pre-filtered schema to SchemaOverview

* Use root schema as is, add reduce-schema util

* Use reduceSchema in the wild

* Base schema on local reduced schema

* Remove todo

* Use graphql-compose to build out schema

* Start restructuring resolvers

* Add create mutation

* Return boolean true for empty create mutation selections

* Add update mutation

* Add delete mutation

* Add system/items scoping

* Fix merge conflicts for real now

* Use system services, rename ids->keys

* Start on docs on mutations

* Updates to match main

* Add fetch-by-id

* Add one/many resolvers for mutations

* Check system collection rows for singleton

* Fix resolver extraction for single read

* Share delete return type

* Add comments

* Use collection root name for readable type

* Add specs endpoint for GraphQL SDL

* Update docs

* Add note on SDL spec

* Fix delete single example

* Remove package-lock

* Fix collection read scoping in non-read
2021-03-30 17:06:35 -04:00
Rijk van Zanten
971a18c219 Database Error Abstraction (#4465)
* Start on database-error abstraction layer

* Add SQLite error abstraction

* Enable SQLite foreign key support

* Cleanup sqlite dialect slightly

Does it matter? Not really!

* Add MySQL error abstraction

* WIP Almost done with MSSQL

* Add correct error handling for MS SQL

* Fix mysql errors by not relying on value order

* Don't rely on sql in postgres exception translation

* Fix sqlite error parsing

* Remove foreign key constraint from activity to collections

A collection can be DB-only, but we still want to track activity for non-meta collections

* Translate error on update as well
2021-03-10 17:16:15 -05:00
rijkvanzanten
c3dd7023a7 Don't surface forbidden reasoning 2021-03-03 17:33:11 -05:00
Rijk van Zanten
b81cfe0a49 Implement byte-range requests on /assets (#4136)
Fixes #3640
2021-02-17 17:56:44 -05:00
rijkvanzanten
ea7ad5481a Add unprocessable entity exception 2020-10-13 16:26:59 -04:00
rijkvanzanten
46dc2bedc6 Add invalid IP exception 2020-10-13 15:49:57 -04:00
rijkvanzanten
c1fa0b1e0d Remove missing imports 2020-10-05 12:21:31 -04:00
rijkvanzanten
35074d1285 Update docs 2020-10-05 12:18:18 -04:00
rijkvanzanten
67b60860df Use allow null to validate payload on submit 2020-09-29 17:52:38 -04:00
rijkvanzanten
a54221f8a9 Remove stray console.log 2020-09-29 11:54:40 -04:00
rijkvanzanten
2af75e3cfb Fix 500 on singleton retrieval
Fixes #418
2020-09-24 14:10:20 -04:00
rijkvanzanten
be3c414b05 Return validation errors 2020-09-09 15:17:28 -04:00
rijkvanzanten
9f3e12f8f2 Run prettier 2020-09-08 16:03:38 -04:00
rijkvanzanten
457a9859aa Add extensions support to hit rate limit exception 2020-09-08 15:51:49 -04:00
rijkvanzanten
c8c0342ae5 Replace service exceptions with serviceunavailableexception 2020-09-08 13:33:18 -04:00
rijkvanzanten
12af165323 Merge branch 'main' into feature-rate-limiting 2020-09-01 11:15:01 -04:00
rijkvanzanten
e10c288920 Add error alert on delete / soft delete from browse 2020-08-31 15:04:36 -04:00
Tanya Byrne
db3c2f675f Updating cache so memory used by default 2020-08-27 16:53:35 +01:00
rijkvanzanten
d87038ee5d Use updated errors output format 2020-08-25 15:26:35 -04:00
Tanya Byrne
6b6e3f5f2e update to 503 2020-08-17 18:59:50 +01:00
Tanya Byrne
eee7746165 Adding better exception handling to match everything else 2020-08-17 17:44:35 +01:00
Tanya Byrne
504d3014aa remove not needed 2020-08-17 17:31:09 +01:00
rijkvanzanten
bde7069cce Move api into api subdirectory 2020-07-29 11:22:56 -04:00