Commit Graph

1242 Commits

Author SHA1 Message Date
Azri Kahar
0575cb4836 Add custom JWTs support for static token (#7830)
* add support for custom JWTs as static token

* check issuer during jwt.verify in authentication

* add issuer in JWTs for pwd resets & user invites
2021-09-09 14:47:28 -04:00
Azri Kahar
3b16686180 add spatial_ref_sys as default for DB_EXCLUDE_TABLES (#7923) 2021-09-08 12:17:56 -04:00
Nicola Krumschmidt
c89b694324 Fix the collections column in directus_webhooks being nullable (#7910) 2021-09-08 11:44:34 -04:00
Oreille
86a5a5087d Fix basemap tileSize condition (#7921)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-09-08 11:39:46 -04:00
Oreille
f28a052974 Add tileSize parameter to basemap options (#7918)
* Added tileSize parameter to basemap options

* Fix blurry icon in map interface.
2021-09-08 10:37:14 -04:00
Sam Milledge
7186c4e381 Allow custom CLI commands to be added by extensions (#7675)
* Fix typescript errors in shared package

* Hooks for adding custom CLI commands

* Add CLI hooks to documentation
2021-09-07 16:18:16 -04:00
Sam Milledge
3b7be6282b Add ability to customise database errors (#7833)
* Add hook for database errors

* Handle multiple returned values

* Add db error hook dosc

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-09-07 16:00:26 -04:00
Oreille
2895d50d32 Use node promisify. (#7841) 2021-09-07 15:53:52 -04:00
Tony DevOps
eaa97a9272 Make Argon2.hash parameters configurable to allow for stronger user password hashes. (#7755)
* 1.  Create generatePasswordHash util function to standardize how user
        passwords are hashed throughout the API instead of directly calling
        argon2.hash directly;
    2.  Add configuration parameters to modify the behavior of the argon2.hash
        function used for generating user password hashes;
    3.  Add docs and placeholders in api/example.env for new parameters;
    4.  Update argon2 to latest release.

* Also update CLI init command to call generatePasswordHash vs. calling argon2.hash directly.

* docs: sdk auth.password.request url argument (#7757)

* Show a warning if PostGIS is missing (#7759)

* Show a warning if PostGIS is missing

* Remove sqlite-extensions flag

* Remove unused import

* Update WYSIWYG styling

* translations: fix user.status_invited (#7760)

* New Crowdin updates (#7739)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Czech)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Russian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Czech)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* Fix postgis check

* Fix branch emitter logic from grand-to-child (#7763)

* New Crowdin updates (#7762)

* New translations en-US.yaml (Russian)

* New translations en-US.yaml (Slovenian)

* New translations en-US.yaml (Chinese Simplified)

* New translations en-US.yaml (French)

* New translations en-US.yaml (Arabic)

* New translations en-US.yaml (Catalan)

* New translations en-US.yaml (German)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (German)

* New translations en-US.yaml (Hungarian)

* Fix tree-select not allowing groups to be opened in selection mode

* Optimize tree-select open state

* Warn the user when a collapsed group field had an error (#7738)

* warn the user when a collapsed group field had an error

* Replace icon

* Reduce icon size

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

* New translations en-US.yaml (Hungarian) (#7764)

* fix WYSIWYG field focus event (#7756)

* Update vue monorepo to v3.2.7 (#7766)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Fix hash link in docs module (#7768)

* Update dependency knex-schema-inspector to v1.6.0 (#7769)

* Use OpenMapTiles font instead of ArcGIS (#7780)

* tiny rewrite in docs/reference/filter-rules (#7771)

* Update dependency sass to v1.39.0 (#7770)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Expose logger through ExtensionContext (#7777)

Fixes #7737.

* Fixes bug when trying to edit geometry in code interface. (#7778)

* Update vue monorepo to v3.2.8 (#7785)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency npm to v7.22.0 (#7786)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Improve card selection styling (#7787)

* Add environment variable to force-exclude tables from Directus (#7789)

* New Crowdin updates (#7765)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Polish)

* v9.0.0-rc.92

* Update changelog.md

* Update logging in CLI commands (#7676)

* Replace console logs with logger in CLI commands

* Fix double sparkles in migration command

* Apply suggestions from code review

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

* Use stdout for init command output

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

* Fix WYSIWYG field not being cleared after "Save and Create New" (#7754)

* fix WYSIWYG field not being cleared

* return empty string when null for tinymce

* Update app/src/components/v-form/form-field.vue

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

* fix wrong icon (#7800)

* fix false is proper value (#7796)

* Fix incorrect database exclude tables environment variable in docs. (#7798)

* Datetime interface "Set to now" sets seconds to 0 (#7794)

When "Include seconds" is disabled.

Fixes #7779

* Use https for openmaptiles fonts. (#7801)

* fix type for deep query with underscore prefix (#7815)

* Map selection behaviour (#7811)

* Use https for openmaptiles fonts.

* Changed map selection behaviour: replace instead of adding them by default.

* Fix map interface controls not showing (#7812)

* Fix return error for GraphQL mutations (#7814)

* Apply "in" to query even if array is empty (#7816)

* fetch only avatar id for current user

* apply "in" to query even if array is empty
if the "in" array is empty we need to add it to query anyways,
otherwise all records will be attached causing out of memory on
subsequent calls

* Update dependency pinia to v2.0.0-rc.7 (#7817)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update modules.md (#7795)

* make csv imports try to parse values to json (#7820)

* fix minor typo in api-hooks.md (#7821)

* Update dependency knex to v0.95.11 (#7819)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Rename hash utils file/function to be not password-specific, update all calls to argon2.hash to use the new function, update docs.

* 1.  Create generatePasswordHash util function to standardize how user
        passwords are hashed throughout the API instead of directly calling
        argon2.hash directly;
    2.  Add configuration parameters to modify the behavior of the argon2.hash
        function used for generating user password hashes;
    3.  Add docs and placeholders in api/example.env for new parameters;
    4.  Update argon2 to latest release.

* Also update CLI init command to call generatePasswordHash vs. calling argon2.hash directly.

* Rename hash utils file/function to be not password-specific, update all calls to argon2.hash to use the new function, update docs.

* Preserve old behavior of hash function in PayloadService, in case 'value' is not a String.

* Tweak docs

Co-authored-by: José Varela <joselcvarela@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Ben Haynes <ben@directus.io>
Co-authored-by: Nitwel <nitwel@arcor.de>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Oreille <33065839+Oreilles@users.noreply.github.com>
Co-authored-by: mikhail sergienko <mikhail.sergienko@gmail.com>
Co-authored-by: Dieter Luypaert <dieterluypaert@gmail.com>
Co-authored-by: Ben Haynes <ben@rngr.org>
Co-authored-by: Sam Milledge <sam@sammilledge.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Harun Kilic <harunkilic@live.dk>
2021-09-07 15:21:59 -04:00
mooori
88b81908a4 fix default of env var EMAIL_MAILGUN_HOST (#7847)
nodemailer uses `dns.resolve()` for dns resolution as described [here](https://nodemailer.com/smtp/). Hence, `host` should not include a scheme.
2021-09-07 15:04:21 -04:00
Azri Kahar
ff9c78b137 Fix display labels translations (#7858)
* translate choice text in display labels

* fix translation keys for directus_activity fields

* add activity fields translations
2021-09-07 10:50:23 -04:00
Azri Kahar
ef53869afb make csv imports try to parse values to json (#7820) 2021-09-03 17:25:33 -04:00
José Varela
a98ca0c184 Apply "in" to query even if array is empty (#7816)
* fetch only avatar id for current user

* apply "in" to query even if array is empty
if the "in" array is empty we need to add it to query anyways,
otherwise all records will be attached causing out of memory on
subsequent calls
2021-09-03 12:12:19 -04:00
José Varela
85b6d5c366 Fix return error for GraphQL mutations (#7814) 2021-09-03 12:09:19 -04:00
Sam Milledge
62af357b53 Update logging in CLI commands (#7676)
* Replace console logs with logger in CLI commands

* Fix double sparkles in migration command

* Apply suggestions from code review

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

* Use stdout for init command output

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-09-03 02:06:05 +00:00
Rijk van Zanten
2abb1674ed Add environment variable to force-exclude tables from Directus (#7789) 2021-09-02 20:39:11 -04:00
Dieter Luypaert
da6f492a44 Expose logger through ExtensionContext (#7777)
Fixes #7737.
2021-09-02 13:46:51 -04:00
rijkvanzanten
77c90363b1 Fix postgis check 2021-09-01 17:25:46 -04:00
Rijk van Zanten
88e0e9e269 Show a warning if PostGIS is missing (#7759)
* Show a warning if PostGIS is missing

* Remove sqlite-extensions flag

* Remove unused import
2021-09-01 15:34:33 -04:00
Nitwel
d9d8edc217 Remove permission.limit (#7711)
* remove permission.limit

* set limit to amount of primaryKeys
2021-08-31 11:56:17 -04:00
Nicola Krumschmidt
6286edf6a9 Remove /custom subpath for endpoints and add a way to customize the endpoint subpath (#7695)
* Remove /custom subpath for endpoints

* Add a way to customize the endpoint subpath
2021-08-30 10:09:12 -04:00
Nicola Krumschmidt
d64ca14348 Explicitly set catch parameters to any type (#7654)
This fixes not being able to build the repo due to type issues
introduced by the Typescript 4.4 option "useUnknownInCatchVariables",
which is enabled by default in strict mode.
2021-08-27 10:33:30 -04:00
Nicola Krumschmidt
7dfc5dc6af Use root-relative base url for app and extensions (#6923)
* Add Url util class

* Use relative base url for app and extensions

Also use utils/url when working with PUBLIC_URL in other places.
2021-08-26 17:11:21 -04:00
Azri Kahar
50fdea1709 fix(api): merge original user object into payload from auth hook (#7568)
* merge user object into payload from auth hook

* fix incorrect param names in reduce function

* change updatedUser to updatedOptions
2021-08-25 11:46:42 -04:00
Zeb Pykosz
aaeb2d6750 log localhost url so it's clickable in terminals (#7604)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-25 15:13:52 +00:00
Azri Kahar
2d3f1c4aa3 fix asset transformation withEnlargement type (#7553) 2021-08-24 14:49:11 -04:00
Rijk van Zanten
de8c2f5c67 Fix uploaded_by not always setting user (#7581)
Fixes #7498
2021-08-24 14:12:35 -04:00
Oreille
5b6354d6be Add postgres constructor to getGeometryHelper (#7561) 2021-08-24 08:56:53 -04:00
Jay Cammarano
ba8e30ab2e added translation vars to fields (#7554) 2021-08-23 21:19:51 +00:00
rijkvanzanten
256139ffd2 Fix double drop relation 2021-08-19 17:11:49 -04:00
Rijk van Zanten
c1c05d4c4f Allow fetching singleton content through pk route (#7509)
Fixes #7351
2021-08-19 22:19:46 +02:00
Oreille
49e4a9b0de Don't allow empty filter for non-string types. Add null filter. (#7501) 2021-08-19 10:02:54 -04:00
rijkvanzanten
3ec8d6443d Re-enable the default retrystrategy 2021-08-17 17:45:13 -04:00
Nitwel
07f4acdaca Add edge case using mysql for tinyint as boolean (#7460)
* revert #7287

* add edge case for mysql to tinyint/boolean

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-17 12:56:41 -04:00
rijkvanzanten
cf69cc814a Don't read icc information
Save some space, we don't need the color profile information
2021-08-17 10:51:01 -04:00
Sam Milledge
19424feefa Fixes for GraphQL variables in HTTP GET requests (#7416)
* Fix missing GraphQL variables in HTTP GET requests

* Fix GraphQL query request caching

 - Fix incorrect response when the query contains variables
 - Added tests for cache keys and cache middleware

* Update api/src/utils/get-cache-key.test.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-16 23:16:41 +00:00
rijkvanzanten
1b950b07de Still join them on create tho 2021-08-13 12:09:05 -04:00
rijkvanzanten
8d5ce4e91d Don't double split csv values 2021-08-13 12:03:58 -04:00
Rijk van Zanten
3b409fe385 Fix typecasting of required field (#7392)
Fixes #7356
2021-08-13 00:53:40 +02:00
Oreille
83e8814b2d Add support for Geometry type, add Map Layout & Interface (#5684)
* Added map layout

* Cleanup and bug fixes

* Removed package-lock

* Cleanup and fixes

* Small fix

* Added back package-lock

* Saved camera, autofitting option, bug fixes

* Refactor and ui improvements

* Improvements

* Added seled mode

* Removed unused dependency

* Changed selection behaviour, cleanup.

* update import and dependencies

* make custom style into drawer

* remove unused imports

* use lodash functions

* add popups

* allow header to become small

* reorganize settings

* add styling to popup

* change default template

* add projection option

* add basic map interface

* finish simple map

* add mapbox style

* support more mapbox layouts

* add api key option

* add mapbox backgrounds to layout

* warn when no api key is set

* fix for latest version

* Improved map layout and interface, bug fixes, refactoring.

.

.

* Added postgis geometry format, added marker icon shadow

* Made map buttons bigger and their icons thinner. Added transition to header bar.

* Bug fixes and error handling in map interface.

* Moved box-select control out of the map component. Removed material icons sprite and use addImage for marker support.

* Handle MultiGeometry -> Geometry interface error.

* Removed hardcoded styles. Added migrations for basemap column. Lots of refactoring.

Removed hardcoded styles. Added migrations for basemap column. Lots of refactoring.

* Fixed style reloading error. Added translations.

* Moved worker code to lib.

* Removed worker code. Prevent Mapbox from removing access_token from the URL.

* Refactoring.

* Change basemap selection to in-map dropdown for layout and interface.

* Touchscreen selection support and small fixes.

* Small change.

* Fixed unused imports.

* Added support for PostgreSQL identity column

* Renamed migration. Added crs translation.

* Only show fields using the map interface in the map layout.

* Removed logging.

* Reverted Dockerfile change.

* Improved crs support.

* Fixed translations.

* Check for schema identity before updating it.

* Fixed popup not updating on feature hover.

* Added feature hover styling. Fixed layer customization input. Added out of bounds error handling.

* Added geometry type and support for database native geometries.

* Fixed linting.

* Fixed layout.

* Fixed layout.

* Actually fixed linting

* Full support for native geometries
Fixed basemap input
Improved feature popup on hover
Locked interfaced support

* Fixed geometryType option not updating

* Bug fixes in interface

* Fixed crash when empty basemap settings. Fixed fitBounds option not updating.

* Added back storage type option. Improved interface behaviour.

* Dropped wkb because of vendor inconsistency with binary data

* Updated layout to match new geometry type. Fixed geojson payload transform.

* Added missing geometry_format attributes to local types.

* Fixed typos & refactoring

* Removed dependency on proj4

* Fix error when empty map interface options

* Set geometry SRID to 4326 when inserting into the database

* Add support for selectMode

* Fix error on initial source load

* Added geocoder, use GeoJSON for api i/o, removed geometry_format option, refactoring

* Added geometry intersects filter. Created geometry helper class.

* Fix error when null geometryOptions, added mapbox_key setting.

* Moved all geometry parsing/serializing into processGeometries in `payload.ts`. Fixed type errors.

* Migrate to Vue 3

* Use wellknown instead of wkx

* Fixed basemap selection.

* Added available operator for geometry type

* Added nintersects filter, fixed map interface for filter input

* Added intersects_bbox filter & bug fixes.

* Fixed icons rendering

* Fixed cursor icon in select mode

* Added geometry aggregate function

* Fixed geometry processing bug when imported from relational field.

* Fixed error with geocoder instanciation

* Removed @types/maplibre-gl dependency

* Removed fitViewToData options

* Merge remote-tracking branch 'upstream/main' into map-layout

* Fixed style and geometryType in map interface options

* Fixed style change on map interface.

* Improved fitViewToData behaviour

* Fixed type imports and previous merge conflict

* Fixed linting

* Added available operators

* Fix and merge migrations

* Remove outdated p-queue dep

* Fix get-schema column extract

* Replace pg with postgis for local debugging

* Re-add missing import

* Add mapbox as a basemap when key exists

* Remove unused tz flag

* Process delta in payloadservice

* Set default map, add limit number styling

* Default display template to just PK

* Tweak styling of error dialog

* Fix method usage in helpers

* Move sdo_geo to oracle section

* Remove extensions from ts config exclude

* Move geo types to shared, remove _Geometry

* Remove unused type

* Tiny Tweaks

* Remove fit to bounds option in favor of on

* Validate incoming intersects query

* Deepmap filter values

* Add GraphQL support

* No defaultValue for geometryType

* Resolve c

* Fix translations

Co-authored-by: Nitwel <nitwel@arcor.de>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-12 22:01:34 +02:00
Adrian Dimitrov
8fefc31a31 Add missing translations (#7358) 2021-08-11 13:42:00 -04:00
rijkvanzanten
bf733afe4b Treat alias-only fields properly 2021-08-11 12:07:42 -04:00
rijkvanzanten
a31523aed1 Add import ref for TS 2021-08-10 15:23:06 -04:00
Rijk van Zanten
8d78f70050 Check for non-existing parent pk records (#7331)
Fixes #7330
2021-08-10 20:46:30 +02:00
Rijk van Zanten
2789e27c26 Check for related collection before creation relation (#7323)
Fixes #7302
2021-08-10 18:39:58 +02:00
Rijk van Zanten
3f3b3f0e16 Fix graphql GET request cache query extraction (#7319)
Fixes #7298
2021-08-10 17:16:29 +02:00
rijkvanzanten
5b92d7fa66 Import access from fs-extra instead of fs/promises 2021-08-10 10:52:16 -04:00
Rijk van Zanten
64fdc48ade Clear the file payload after file upload (#7315)
Fixes #7305
2021-08-10 16:14:51 +02:00
Rijk van Zanten
0214b9a1bb Fix uuid resolving in SQLite (#7312)
Fixes #7306
2021-08-10 16:00:22 +02:00
Pascal Jufer
123c3b1182 Add perm check for sqlite, upload, extensions dirs (#7310)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-10 09:39:47 -04:00