Commit Graph

158 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
Pascal Jufer
c82d0b4198 Remove refresh token cookie on logout (#5182)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-04-21 16:53:11 +00: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
rijkvanzanten
423279f5c0 Fix asset cache control header being in ms
Fixes #5160
2021-04-20 17:23:43 -04:00
Pyll Gomez
c3ef71298c Add oauth hook (#5045)
* 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 #4653

* added docs and cleaned up the hooks payload

* use req.accountability

* added req.params.provider to payload

* provide scope for login

* docs updated for oauth hook

* Update api/src/controllers/auth.ts

* updated provider to redirect and docs

* added payload

* Make schema available in redirect hook

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-16 15:51:15 +00:00
Tomáš Petržela
07b85b7eb7 Global cookie parser (#5071)
* removed local cookie parser

* add global cookie parser

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-04-15 14:55:07 +00:00
Rijk van Zanten
1b1e500ee9 Make user email case insensitive (#4941) 2021-04-09 12:33:31 -04:00
Pyll Gomez
48b287a5b8 Sso login issue 4570 (#4675)
* 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 SSO redirect with Json error

* Remove dependency on qs

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-08 17:18:00 -04:00
Jakob
183af8dd64 Fix extension path wildcard (#4906) 2021-04-08 09:13:34 -04:00
rijkvanzanten
cdbd6e820b Tweak static handler path for extensions 2021-04-07 12:54:23 -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
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
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
914a02c6c2 Return HEAD requests with correct headers on /assets
Fixes #4578
2021-03-17 21:51:10 -04:00
Rijk van Zanten
2cdf18545e Remove support for CSV in PK param (#4514)
* Remove csv in pk param

Closes #3933

* Remove last uses of csv in route pk params in app
2021-03-12 18:06:35 -05:00
Evgeny Vlasov
76b31eda78 add cookie's domain to another endpoints (#4499) 2021-03-12 07:56:36 -05: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
Evgeny Vlasov
7bd5dc5c9f Add env for cookie domain (#4490)
* Add env for cookie domain

* fix doc

Co-authored-by: Власов Евгений <yavlas12@mts.ru>
2021-03-11 14:10:15 -05:00
rijkvanzanten
e8222d2a28 Add reset_url allow list for password reset request 2021-03-08 13:48:59 -05:00
rijkvanzanten
ec436170a0 Fix file import for admins 2021-03-04 17:02:29 -05:00
rijkvanzanten
ba4810bac3 Prevent direct(us_) access through /items 2021-02-26 17:30:51 -05:00
rijkvanzanten
f2d8c9e5be Check file create permissions before fetching external file 2021-02-25 19:03:38 -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
rijkvanzanten
3d33b9db55 Allow and ignore null schema in field update
Fixes #4254
2021-02-23 17:06:35 -05:00
rijkvanzanten
0233e56c88 Fix type check of refresh cookie secure env var
Fixes #4205
2021-02-22 11:14:39 -05:00
rijkvanzanten
f9685b0d4a Base content-length on stat instead of saved value 2021-02-18 13:33:03 -05:00
Rijk van Zanten
6661633031 Fetch all meta rows when retrieving collections (#4142) 2021-02-17 18:55:29 -05:00
Rijk van Zanten
b81cfe0a49 Implement byte-range requests on /assets (#4136)
Fixes #3640
2021-02-17 17:56:44 -05:00
rijkvanzanten
76f1a387c7 Throw error on reading forbidden collection
Ref #4043
2021-02-15 13:50:44 -05:00
Nitwel
953b141245 fix fields not updateable because type is null (#4061) 2021-02-15 12:01:26 -05:00
Rijk van Zanten
81fc8443df Don't wrap text in nav (#4035)
* Move v-list-item-text to v-text-overflow, use in tables

* Fix type issue
2021-02-12 16:39:17 -05:00
Rijk van Zanten
ee3f5cbad3 Various m2a builder fixes (#4032)
* Fix drawer opening empty item after sort

* Fix null sorting

* Fix sending null for a type in field creation

* Fix sort / edit existing on sorted values in m2a builder

Fixes #4005, fixes #4007

* Remove stray console log
2021-02-12 15:23:23 -05:00
andriusign
d74e121dc2 Add missing invite_url key to inviteSchema. (#4028) 2021-02-12 09:58:16 -05:00
rijkvanzanten
351a6991dd Fix field name validation on field update 2021-02-11 14:46:53 -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
41240fae14 Revert patch on fields root (#3994)
Fixes #3991
2021-02-10 09:51:10 -05:00
rijkvanzanten
82f9af67e0 Validate field update payload
Fixes #3928
2021-02-09 18:45:21 -05:00
Rijk van Zanten
e6fa07dba8 Allow field creation with just field/type combo (#3990)
Fixes #3926
2021-02-09 18:43:25 -05:00
andriusign
c00e89a8c0 Allow to pass custom URL for user invitation (#3972)
* Allow to pass custom URL for invitation to enable verification of user's email on custom Frond-End page (other than Directus Admin page).

* Update api/src/services/users.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

* Update api/src/services/users.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

* Update api/src/services/users.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-02-08 16:39:11 -05:00
WoLfulus
b8e7c80b72 Application initialization events (#3680)
* Adds `not_found` hook

* Separate hooks and endpoints initialization process

* Adds additional application events

* Remove unused import

* Change the event order to accound for notFound and errorHandler

* Change emitAsync.catch to use the emitAsyncSafe function

* Updated docs, reordered table by lifecycle and usage
2021-02-08 12:30:09 -05:00
Rijk van Zanten
817ccf3620 Overhaul docs (#3951)
* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

Co-authored-by: Ben Haynes <ben@rngr.org>
2021-02-05 18:51:54 -05:00
rijkvanzanten
a0fb2abbe9 Remove batch delete for fields/collections
It's too destructive
2021-02-04 11:19:32 -05:00
rijkvanzanten
fbd6a4a6b2 Validate that to-be-deleted record is comment before allowing 2021-02-03 18:18:09 -05:00
rijkvanzanten
4992a17a8b Validate comment update 2021-02-03 18:12:13 -05:00
Rijk van Zanten
5a019b4284 Implemented Union Types in GraphQL (#3852)
* Fetch correct amount of data

* Allow system required data to be returned in items service

* Fetch non-requested required data, find type through context

Fixes #3718
2021-01-29 16:23:33 -05:00
rijkvanzanten
d2705713e1 Use body for moving files to folder
Fixes #19
2021-01-20 21:37:46 -05:00
rijkvanzanten
d98300d528 Fix graphql response type 2021-01-14 12:52:57 -05:00
Justin Hiller
ff399f94b6 fix: mode not correctly set in refresh handler 2021-01-14 14:22:48 +01:00