Commit Graph

344 Commits

Author SHA1 Message Date
rijkvanzanten
40ecd1ec37 Fix fragments in nested relational sets
Fixes #4283
2021-04-14 12:12:32 -04:00
MiniDigger | Martin
6cf9008809 Send out error message for graphql execution errors (#5023) 2021-04-13 10:03:52 -04:00
cristobalbahe
b1f36b1939 Return instance of Date from payload.ts (#4992)
* Return instance of Date from payload.ts

* Revert formatter to date

* Use non-JS-Date object date scalar

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-12 17:59:37 -04:00
rijkvanzanten
9e90030d2a Ignore duplicate permissions row for same collection
Fixes #4985
2021-04-12 17:42:12 -04:00
Pierre
816d963c81 Fix error message (#4993)
`url` is an object from the library `url`.
It's `importUrl` that we need.
2021-04-12 09:45:14 -04:00
rijkvanzanten
5d1db82554 Fix auto-inserted timestamp transformers 2021-04-09 19:59:01 -04:00
Rijk van Zanten
c9d70de4c3 Rely on Knex for date parsing to vendor (#4949)
Fixes #3655
2021-04-09 18:36:58 -04:00
Rijk van Zanten
1b1e500ee9 Make user email case insensitive (#4941) 2021-04-09 12:33:31 -04:00
rijkvanzanten
706b07bb02 Run invite in transaction, rollback on error
Fixes #4569
2021-04-08 17:33:04 -04:00
rijkvanzanten
f6e0b2cc81 Clear archive_field / sort_field of directus_collections on field delete
Fixes #3737
2021-04-08 17:11:16 -04:00
rijkvanzanten
5b14a8e715 Fix typo in oas spec output
Fixes #4867
2021-04-08 17:01:14 -04:00
Joonas Palosuo
9c621c6e20 feat: add delete event emitting to fields service (#4840)
* feat: add delete event emitting to fields service

* Inline event scope

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-08 16:39:31 -04:00
rijkvanzanten
86d232c03c Fix deep args + union resolvers 2021-04-07 14:06:23 -04:00
Dustin
632895eb68 Storage: S3 ACL & Content Type (#4694)
* add S3 env config for ACL. pass along file type for S3 upload

* add STORAGE_<LOCATION>_ACL to S3 docs
2021-04-07 12:15:47 -04:00
Rijk van Zanten
d49898d54d fix/4873 (#4885)
* Fix permissions check for /system endpoint

* Filter out empty / corrupted fields/collections rows in get-schema

Fixes #4873
2021-04-07 11:39:54 -04:00
Jakob
239e12959d Fix Graphql filter selection (#4882)
- fix fall through in switch statement
- remove duplicate case
2021-04-07 11:25:47 -04:00
Rijk van Zanten
dd551f3571 Add non-items system Resolvers (#4863)
* Add auth resolvers

* Add password request/reset

* Add up until file import

* Make revisions read only

* Add server resolvers

* Add utils

* Add schema resolvers for schema manipulation
2021-04-06 18:04:35 -04:00
rijkvanzanten
eb79c00756 Don't delete columns for alias fields
Fixes #4802
2021-04-05 17:01:19 -04:00
Fatih Kaya
da4b66aca8 fix: exclude aliases from the payload. fixes #4810 (#4822)
* fix: exclude aliases from the payload

* Use alias from columns

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-05 16:20:18 -04:00
rijkvanzanten
2d316a4a71 Fix type overrides of GQL service getSchema 2021-03-30 18:23:00 -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
03c1a5b5ce Remove forced sort on payloads 2021-03-30 13:15:47 -04:00
Rijk van Zanten
b562ceeb0c Add Tree-View Interface (#4602)
* Fix local type extraction

* Render basic tree in tree-view

* Render drawer-item in tree-view-group

* Retrieve nested draggable changes

* Default sort query to configured sortField

* Store nested group / sort to API

* Allow updating item values

* Figure out a dropzone approach on preview

* Finish editable tree view

* Set sort value based on sort field in relation

* Add create-new / add-existing

* Respect previously made nested edits

* Add description in setup

* Fix fetching level of o2m sort field

* Remove min height on empty root

* Remove unused types

* Add notice for invalid relationship type

* Allow recursive o2m in setup

* Styling tweak

* Revert changes in v-list

* Revert changes in groupable
2021-03-26 17:12:55 -04:00
Pyll Gomez
71c8c4cc2c Assets quality parameter #4557 (#4620)
* Rotate JPG image on upload #4206

* fixes #3949 width/height generated for gif and tif

* API hooks for event added for auth.login #4079

* updated doc for api hooks for new auth.login event

* Style tweaks

* Update docs

* Tweak docs some more

* Spelling error

* Allow non-required flags and pass to hook

* SDK - Persistent login refresh fixes #4113

* Fixed #4145 SDK, Token Expired error

* Spell check

* Docs Spell check

* Docs Spell check

* Docs Spell check

* update docs for sdk-js

* To delete all expired session from db on login

* corrected the condition for the delete

* changed the from Date.now to new date .

* Move it inline

* fixes issue 4557 for asset quality for thumbnail

* asset documentation is updated

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-22 20:08:44 -04:00
rijkvanzanten
45a9f2a06c Don't add alias fields to table when creating nested in /collections
Fixes https://github.com/directus-community/migration-tool/issues/4
2021-03-21 10:27:05 -04:00
Martijn Boland
aca08e24c7 Always remove the primary key field from the update payload (#4576)
* Always remove the primary key field from the update payload to prevent issues with databases that don't allow certain primary key columns (e.g. mssql identity columns)

* Opinionated cleanup

Co-authored-by: Martijn Boland <martijn@taiga.nl>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-17 22:14:08 -04:00
rijkvanzanten
2a71f0c0dd Pass current knex trx instance to hook resolver functions
Closes #4558
2021-03-17 22:07:58 -04:00
Pyll Gomez
4dd69ee5b1 To clear to Expired Sessions#4414 (#4504)
* Rotate JPG image on upload #4206

* fixes #3949 width/height generated for gif and tif

* API hooks for event added for auth.login #4079

* updated doc for api hooks for new auth.login event

* Style tweaks

* Update docs

* Tweak docs some more

* Spelling error

* Allow non-required flags and pass to hook

* SDK - Persistent login refresh fixes #4113

* Fixed #4145 SDK, Token Expired error

* Spell check

* Docs Spell check

* Docs Spell check

* Docs Spell check

* update docs for sdk-js

* To delete all expired session from db on login

* corrected the condition for the delete

* changed the from Date.now to new date .

* Move it inline

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-12 18:11:44 -05:00
rijkvanzanten
909d184778 Respect permissions in item count
Fixes #4422
2021-03-12 14:53:41 -05:00
rijkvanzanten
ed4133a0aa Fix relations fetch in graphql service
Fixes #4458
2021-03-12 09:58:14 -05:00
rijkvanzanten
93c6b157a2 Add a URL allow list for invite urls
Closes #4456
2021-03-11 18:48:52 -05:00
rijkvanzanten
f3683c9cf7 Parse filter structure on validation step
Fixes #4446
2021-03-11 18:25:14 -05:00
rijkvanzanten
ef9f281c3c Fix unique constraint error on field create/update
Fixes #4481
2021-03-11 18:11:58 -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
Rijk van Zanten
4248b187bb Implement unique constraint support (#4467)
* Allow creating unique fields

* Allow removing unique constriant

* Show unique constraint error as validation error in app
2021-03-10 17:35:21 -05: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
e8222d2a28 Add reset_url allow list for password reset request 2021-03-08 13:48:59 -05:00
rijkvanzanten
5afa6c04fc Create field in transaction
Fixes #4211
2021-03-04 17:35:39 -05:00
Rijk van Zanten
30f631b0b2 Allow deeply nested queries with deep (#4384)
* Allow deeply nested query using _prefix

* Support deeply nested deep-queries

* Parse nested deep in GraphQL correctly

* Update docs
2021-03-04 12:59:54 -05:00
rijkvanzanten
d9a09719cf Fix width/height of exif orientation image
Fixes #4323
2021-03-04 10:28:47 -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
Rijk van Zanten
7ab359eacf Throw forbidden error on /fields (#4366)
Fixes #4349
2021-03-03 17:04:39 -05:00
Rijk van Zanten
1d9ffc2d7f Tweak asset metadata on upload (#4317)
* Update sharp

* Only read image metadata after upload

Preserves animated gifs and other files

Fixes #4297

* Rotate thumbnails based on exif data

Ref #4206
2021-02-26 17:18:17 -05:00
rijkvanzanten
f6c4ab0e6a Check if table still exists before auto-dropping columns 2021-02-26 16:08:10 -05:00
Rijk van Zanten
b0f3c0591a Add "explicit" o2m update syntax (#4295)
* Add support for a new o2m relational update structure

* Document these wonders
2021-02-25 14:08:57 -05:00
rijkvanzanten
4cfa64e752 Fix outgoing headers in /graphql
Fixes #4264
2021-02-24 11:06:55 -05:00
Pyll Gomez
aeb4ec0472 API hooks for event added for auth.login (#4255)
* Rotate JPG image on upload #4206

* fixes #3949 width/height generated for gif and tif

* API hooks for event added for auth.login #4079

* updated doc for api hooks for new auth.login event

* Style tweaks

* Update docs

* Tweak docs some more

* Spelling error

* Allow non-required flags and pass to hook

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-02-24 10:37:13 -05:00
Pyll Gomez
08e4400935 Fix for generating meta data gif and tiff images (#4230)
* Rotate JPG image on upload #4206

* fixes #3949 width/height generated for gif and tif
2021-02-22 17:10:24 -05:00