Commit Graph

352 Commits

Author SHA1 Message Date
Rijk van Zanten
b40c62d257 Add support for SEARCH method (#5183)
* Add search method support for advanced get

* Add docs for SEARCH
2021-04-21 13:35:16 -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
José Varela
7fbba272ad Fix before hook items transaction (#5136)
Since we might need information from database, we must provide the
current transaction, instead of the connection.
Otherwise, databases like SQLite which only accepts a single connection
will throw an error of knex timeout.

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-04-19 11:34:18 -04:00
Rijk van Zanten
40b9fb0fe6 Allow disabling activity/revisions (#5112)
* Add accountability column

* Add field info for accountability

* Add accountability to collection type

* Fetch accountability info from collection meta

* Add field name translation for accountability field

* Hide revisions drawer detail if revisions aren't available

* Only save activity where accountability flag matches

* Disable revisions for directus_presets

Fixes #3767

* Tweak field option naming
2021-04-16 16:26:18 -04:00
José Varela
e765d50783 Fix singleton primary key on update (#5096)
Since primary key is dynamic, we should use it instead of expect it would be 'id'
2021-04-16 10:16:28 -04:00
Rijk van Zanten
1fb4db1fda Add _regex validation operator (#5089)
Closes #2917
2021-04-15 17:25:51 -04:00
rijkvanzanten
25e7daf433 Parse fragments inside inlinefragments too
Ref #4283
2021-04-15 10:44:23 -04:00
rijkvanzanten
447eea4b3b Fix chaining filters w/ and/or in GQL
Fixes #5020
2021-04-14 12:16:48 -04:00
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