Commit Graph

46 Commits

Author SHA1 Message Date
rijkvanzanten
ecce005226 Merge branch 'main' into aggregation 2021-06-07 09:31:44 -04:00
Rijk van Zanten
77e00b7db4 Don't initialize database on file require (#6003) 2021-06-02 11:41:42 -04:00
rijkvanzanten
51bc0a8c9f Check permissions before aggregating fields 2021-05-25 14:30:33 -04:00
Rijk van Zanten
bc8399c362 Fix validation short circuit on _or (#5806)
* Fix _or validation step when in nested context

Fixes #5405

* Add changeset
2021-05-21 12:30:13 -04:00
rijkvanzanten
ba98f23d3d Fix TS errors 2021-04-29 16:18:09 -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
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
9e90030d2a Ignore duplicate permissions row for same collection
Fixes #4985
2021-04-12 17:42:12 -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
rijkvanzanten
f3683c9cf7 Parse filter structure on validation step
Fixes #4446
2021-03-11 18:25:14 -05:00
Rijk van Zanten
b613ce1d18 Improve recursive filtering (#4493)
* Use lowercase chars only

* Fix join alias mapping

* Pass keys as array in delete

* Cleanup delete controller

* Don't catch unexpected errors
2021-03-11 17:56:04 -05:00
Nicola Krumschmidt
08293b8570 Update Knex to version 0.95.0 (#4374)
* Update Knex to version 0.95.0

* Fix formatting in schema dialects

* Fix Knex imports

* Update package-lock

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-03 19:37:44 -05:00
rijkvanzanten
c3dd7023a7 Don't surface forbidden reasoning 2021-03-03 17:33:11 -05:00
rijkvanzanten
738ef8622d Don't leak collection name in param exception 2021-03-03 17:04:44 -05:00
alejandro-tss
d9cff2f8f3 Fixed authorization service (#4130)
Fix permission filter when validate payload in authorization service
2021-02-17 11:19:07 -05:00
Rijk van Zanten
b7d87e581a System permissions for app access (#4004)
* Pass relations through schema, instead of individual reads

* Fetch field transforms upfront

* Fix length check

* List if user has app access or not in accountability

* Load permissions up front, merge app access minimal permissions

* Show app access required permissions in permissions overview

* Show system minimal permissions in permissions detail

* Fix app access check in authenticate for jwt use

* Fix minimal permissions for presets

* Remove /permissions/me in favor of root use w/ permissions

* Fix logical nested OR in an AND

* Use root permissions endpoint with filter instead of /me

* Allow filter query on /permissions

* Add system minimal app access permissions into result of /permissions

* Remove stray console log

* Remove stray console.dir

* Set current role as role for minimal permissions

* Fix no-permissions state for user detail

* Add filter items function that allows altering existing result set
2021-02-11 12:50:56 -05:00
Rijk van Zanten
4144cecef5 Fix validation structure in authorization service (#3967)
Fixes #3597
2021-02-08 15:13:14 -05:00
Igor Savin
7cddb458cb Run prettier across app and api 2020-12-08 02:22:00 +02:00
rijkvanzanten
56979b3ae3 Add overview support to mysql 2020-11-09 18:20:37 -05:00
rijkvanzanten
8cbdfb409b Use prefetched schema info 2020-11-09 17:13:48 -05:00
rijkvanzanten
528112314d Remove outdated tests, fix imports 2020-11-09 12:29:01 -05:00
rijkvanzanten
2f3e406022 Fix too strict update permission check
Fixes #817
2020-11-04 11:02:38 -05:00
rijkvanzanten
a11e2800b6 Fix permissions not using preset variables 2020-11-02 16:19:05 -05:00
rijkvanzanten
ee9baf02c0 Move system fields out of DB 2020-10-29 13:06:37 -04:00
rijkvanzanten
53fb7a099a Fix validation error on empty permissions
Fixes #791 (maybe)
2020-10-28 15:01:38 -04:00
rijkvanzanten
dae2ca530f Fix type casting in authorization service
Fixes #776
2020-10-26 11:30:21 +01:00
rijkvanzanten
592ab925db Add toArray util 2020-10-15 18:00:27 -04:00
rijkvanzanten
5dba15082f Handle non-o2m cases 2020-10-09 13:13:49 -04:00
rijkvanzanten
d8bd6c82ab Consider root ast a collection 2020-10-09 13:07:15 -04:00
rijkvanzanten
2e6b295ee4 Fix type check 2020-10-09 13:07:15 -04:00
rijkvanzanten
5b91bc3577 Rework nested ast typings to nodes 2020-10-09 13:07:15 -04:00
rijkvanzanten
0a20cc8d65 Replace .flat() to support node 10
Fixes #459
2020-09-30 14:34:14 -04:00
rijkvanzanten
d165babcd7 Allow generated UUID/date/role/user value to pass required
Fixes #446, fixes #448
2020-09-30 09:31:25 -04:00
rijkvanzanten
67b60860df Use allow null to validate payload on submit 2020-09-29 17:52:38 -04:00
rijkvanzanten
a5be4e3e48 Rework AST runner
Way cleaner to read / maintain now. Should also fix a couple issues.

Ref #406, ref #376, ref #350
2020-09-23 15:57:32 -04:00
rijkvanzanten
48fca55651 Restructure exports for services 2020-09-22 13:16:14 -04:00
rijkvanzanten
be3c414b05 Return validation errors 2020-09-09 15:17:28 -04:00
rijkvanzanten
7f1f105349 Merge branch 'main' into feature-rate-limiting 2020-09-08 12:31:57 -04:00
rijkvanzanten
46f1969448 Allow permissions variables in filter query param 2020-09-02 18:31:01 -04:00
rijkvanzanten
38e1cf4a55 Add permission variables support 2020-09-02 18:20:02 -04:00
rijkvanzanten
e10c288920 Add error alert on delete / soft delete from browse 2020-08-31 15:04:36 -04:00
rijkvanzanten
d8ae3b9a8d Finish soft delete 2020-08-31 12:30:19 -04:00
rijkvanzanten
4b5aaaa1ff Rename operation->action, add validate step 2020-08-27 11:56:01 -04:00
rijkvanzanten
bde7069cce Move api into api subdirectory 2020-07-29 11:22:56 -04:00