2644 Commits

Author SHA1 Message Date
rijkvanzanten
e908db17b4 v10.6.2 2023-09-19 13:28:29 -04:00
Brainslug
243eed781b Merge pull request from GHSA-hmgw-9jrg-hf2m
* Add extra error handling for invalid messages

* added description and logging

* renamed fix function

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-09-19 13:12:42 -04:00
José Varela
9819049f0c Assets: Handle transformation timeout errors (#19684)
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
2023-09-15 13:32:50 +00:00
Pascal Jufer
9854a2174f Import config.js file as ESM (#19654)
Co-authored-by: Brainslug <tim@brainslug.nl>
2023-09-13 13:19:34 +00:00
Pascal Jufer
0c56c46fdf Attempt to make "require shares fields" migration safer/more reliable (#19619)
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2023-09-12 21:10:58 +02:00
Brainslug
a9116ab5ef Updated sharp dependency (#19658)
* updated sharp dependency

* added package lock

* Create chilly-adults-rule.md
2023-09-11 11:24:15 -04:00
Jan Arends
5c8d3d22c6 Reset auto increment sequence (#19328)
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-09-08 11:19:14 +02:00
Azeem Haider
f770fefc96 Ignore extra envs for mysql (#19589)
* fix #7420 ignore extra envs for mysql

* Update contributors.yml

* Run formatter

* Add changeset

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-09-05 07:33:32 -07:00
Azri Kahar
1857340bcd Add email body for completed exports to file library (#19550)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-08-31 15:08:48 +02:00
Pascal Jufer
425cdd64cc Fix decompression in file import endpoint (#19524)
* Fix decompression in file import endpoint

* Add changeset

* Clean-up decompressResponse function

* Align fn name
2023-08-29 22:57:27 +08:00
rijkvanzanten
3ec4009bb8 v10.6.0 2023-08-25 11:42:24 -04:00
Daniel Biegler
284156426f Replace vm2 with isolated-vm (#19332)
* add isolated-vm@4.6.0

* add mvp replacing vm2 with isolated-vm, two env vars

* make copying async and add tests

* add env vars to docs

* remove isolate-logging function

* update docs for FLOWS_EXEC_ALLOWED_MODULES removal

* further removal of allowed module usage

* rename env vars and their usage, remove script "compiling" and replace Reference with ExternalCopy

* remove logging and catching, let the outer executeOperation function do it

* remove vm2 from dependencies

* remove unused var

* run prettier formatting

* run eslint

* create changeset

* rename env var without unit suffix, add minimum to doc

* add two tests for config testing

* fix 'mb' spelling

* update changeset

* Mark it as major change for `@directus/api`

* Breaking change copy

* add logging from the operation

* run linting

* Update docs/releases/breaking-changes.md

* Update docs/releases/breaking-changes.md

* run linting, make operation cursive

* Mention HTTP requests in breaking changes

* make linter happy

* changed cursive to bold (asked kevin)

* add to the test for timeouts

* run linter

* Update api/src/operations/exec/index.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Update api/src/operations/exec/index.ts

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Update note on run script modules

* Update breaking changes

* Update docs/app/flows/operations.md

Co-authored-by: ian <licitdev@gmail.com>

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Kevin Lewis <kvn@lws.io>
Co-authored-by: ian <licitdev@gmail.com>
2023-08-25 14:11:17 +00:00
ian
7aedf763c0 Redact env values in logs for Flows (#19513)
* Redact env values in revisions for Flows

* Add unit tests

* Create cold-maps-teach.md

* Redact string type envs only

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* Fix linting

* Update test for non-string env

* Ignore zero length strings

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* Add replacementFn to include key of redacted value

* Update cold-maps-teach.md

* Remove case insensitivity

* Update changeset

* Rework

* Add utils to changeset

* Add unit test

* Rename to getRedactedString and add REDACTED_TEXT

* Consistent naming

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-08-25 10:14:35 +02:00
Pascal Jufer
940545dbfe Fix condition for collection & item data in notification operation (#19521)
* Fix condition for collection & item data in notification operation

* Add changeset
2023-08-24 21:22:34 -04:00
Gerard Lamusse
7de52e6720 Fix deep sanitizeQuery (#19436)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-08-24 17:18:18 +02:00
PlanB
e6230ebd84 Docs: Update CACHE_NAMESPACE default value (#19496) 2023-08-23 10:00:02 +02:00
ian
88d4f7cfb1 Add JSON Web Token (JWT) operation (#19434)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-08-16 10:34:18 +00:00
Nitwel
e7ba4b4058 Add missing endpoints to openapi spec (#19390)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-08-16 12:00:57 +02:00
Nitwel
ebb018a5e8 Fix using wrong type for default values (#19439)
* Fix using wrong type for default values

* fix for readAll

* Format file

* Add changeset

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-08-15 12:16:43 -04:00
Pascal Jufer
d6d6cf4b38 Fix "require shares fields" migration for strict MySQL (#19407)
* Fix "require shares fields" migration for strict MySQL

* Add changeset
2023-08-11 09:23:33 -04:00
rijkvanzanten
68ca1d309e v10.5.3 2023-08-10 15:11:51 -04:00
rijkvanzanten
e701313191 v10.5.2 2023-07-28 13:07:10 -04:00
rijkvanzanten
f3d3ee1292 v10.5.1 2023-07-26 10:34:54 -04:00
Pascal Jufer
479c5b55b7 Fix URL seralizing of trailing slashes after adding paths (#19252)
* Fix URL seralizing of trailing slashes after adding paths

* Create rare-shrimps-rescue.md

* Clean-up

* More precise changeset summary
2023-07-26 10:28:21 -04:00
rijkvanzanten
373cc9f4fa v10.5.0 2023-07-25 17:36:33 -04:00
Matthew Rollinson
f9635ac287 Supabase - Storage driver (#19135)
* Initial commit to add supabase as a storage driver

* Working supabase implementation

* Slight cleanup

* Started working on tests for storage-driver-supabase

* Updates

* Initial commit to add supabase as a storage driver

* Working supabase implementation

* Slight cleanup

* Started working on tests for storage-driver-supabase

* Updates

* Nicer working tests

* More working tests

* Readable stream

* Working version with all passing tests and types

* Update contributors.yml

* added documentation

* Ran prettier to fix formatting issues

* Ran linter and added Supabase to dictionary

* Fix tsconfig reference

* Organize imports

* Start at v0

* Add changeset

* Lock versions

* storage-driver-supabse: Added fullpath for move and copy arguments

* storage-driver-supabase: Removed resumable uploads

* Update lockfile

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-07-25 11:01:24 -04:00
José Varela
3a54f0db56 API: Do count distinct since left join duplicates results (#19208)
* Do count distinct since `left join` duplicates results

* Add changeset

* Correctly access count property

* Update .changeset/angry-suits-compete.md

* Optimize for simple filters

* Add tests

* Workaround broken 'as' for countDistinct in SQLite3

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
2023-07-24 13:32:28 +02:00
Pascal Jufer
08f6953822 Require 'collection' & 'item' fields for shares (#19220) 2023-07-24 13:31:43 +02:00
Gerard Lamusse
ad1207a2f9 Remove res.status calculation as it is set later (#19214)
* Remove res.status calculation as it is set later

* Ensure 500 is thrown on multiple errors of different types

* Add changeset

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-07-21 09:56:22 -04:00
Amer @ ValueHeads
174c9fab9c [Bug Fix] utils/url.js removing trailing slashes (#19210)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-07-20 12:26:04 +02:00
Brainslug
4cc55b86ba Using the same data fetching logic for rest and graphql (#19155)
* Using the same data fetching logic for rest and graphql

* Create fresh-snails-knock.md

* checked and tested data fetching code

* always fetch a single result for gql subscriptions

* removed unused import

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-07-20 08:12:17 +02:00
Pascal Jufer
e583c6b6ea Add tsconfig for Vue & CJS (#19197)
* Add tsconfig for Vue

* Delete tsconfig.json

* Use vue tsconfig for composables

* Add changeset

* Update changeset

* Update changeset
2023-07-18 17:36:16 -04:00
Brainslug
56c03e843b Updated websocket registered events (#19189)
* added unused events

* Create plenty-paws-turn.md

* ran prettier
2023-07-18 12:05:05 -04:00
Rijk van Zanten
f1ac443298 Use projectColor for links in emails (#19171)
Fixes #18927
2023-07-14 22:14:29 +02:00
Rijk van Zanten
ea146c3e11 Include PK as secondary sort in batch exports (#19143)
Fixes #19133
2023-07-12 11:46:25 +02:00
rijkvanzanten
d3c9de9dfb v10.4.3 2023-07-11 16:00:17 +02:00
Rijk van Zanten
39fc2915c1 Use warn log levels for unexpected oid/oa2 errors (#19121)
Closes #19003
2023-07-11 10:45:34 +02:00
Connor
77b95e08dd Add Auto Cache Purging to Sorting Utility (#19115)
* add cache purging to sort utility

* update should clear to fail faster

* use shouldClearCache

* clean logic

* Create nervous-onions-relate.md

* fix formatting

* Update api/src/services/utils.ts

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

* Update changeset/

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-07-11 10:32:57 +02:00
Connor
eefde53a86 Add Options to Flow Notification Operation (#19033)
* add collection and item options to notification opperation

* Create stale-tips-relax.md

* fix formatting

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-07-09 17:38:03 +02:00
Pascal Jufer
55f3d4c6e0 v10.4.2 (#19045) 2023-06-30 17:42:11 +02:00
Connor
92621429ee Linting and Formatting Upgrade (#18892)
* add docs to eslint

* update prettier ignore

* fix vitepress linting

* eslint ignore fixes

* prettier run

* update prettier ignore

* fix formatting

* enable linting of markdown files

* revert format command change

* fix irregular whitespace

* update dictionary

* (Changelog) Create four-boxes-shake.md

* Rework ESLint / Prettier setup

- Disable js/ts/vue files for Prettier to ensure linting/formatting is
  only happening via ESLint
- Rework formatting of code blocks in md files
  - Disable formatting of code blocks in md files under '/docs' by Prettier
  - Instead use "eslint-plugin-markdown" to format & __lint__ js*/ts*/vue such code blocks
  - Replace unmaintained "eslint-plugin-md" plugin by official "eslint-plugin-markdown" plugin
  - I'll check whether we can use this to format other code blocks
    (json, html, ...) as well
- Restructure, clean-up and apply some fixes to the ESLint config
  (Note: Not ready for flat config yet since not supported by
  vscode-eslint)
- Enable cache for ESLint / Prettier in scripts
- Clean-up ignore file
  - Explicit folder declaration (.../)
  - Don't ignore all 'extensions' folders in ESLint (only
    '/api/extensions/')
  - Enable formatting in '/.github' folder

* Fix all formatting issues with Prettier

* Update md files under /docs/.typedocs

* Fix lint issues in vue/js files

* ESLint / Prettier config revision v2

Enable Prettier for md code blocks, but only as warnings since it can
get into the way with Vitepress md extensions like '[!code ...]'
comments

* Remove prettier-ignore comments

* Make spellchecker happy

* Remove changeset

* Revert lint setup for code blocks

There are many cases in the docs where linting / formatting of code
blocks doesn't make
sense:
- Code block is only an excerpt - linter fails
- Code block contains special comments (e.g. markdown extensions) which
  needs to remain at the same place - formatting would break it
- ...

* Apply lint issues / formatting from temp lint setup

* Run formatter

* Fix merge failure

* Simplify & modernize ESLint / Prettier setup

No longer run Prettier via ESLint. Nowadays, this is the recommended
setup. There's no real need to run it this way, it's just an additional
layer.

Add VS Code settings to make the work with the new setup easier.

* Remove unused eslint disable directives

* Make editorconfig more useful

* Fix formatting issues reported by editorconfig

* Format files with Prettier

* Enable formatting of source translations file

* Format source translations file

* Remove unnecessary console error

* Remove unnecessary line

* Only ignore md files under .changeset

* Add CI reporter for Prettier

* Fail job on wrongly formatted files

* Fix format

* Test Prettier action on changed/added file

* Use simple CI format check for now & no cache

* Revert "Test Prettier action on changed/added file"

This reverts commit 4f7d8826ad.

* Introduce code blocks check for docs

* Fix code block issues

* Ignore auto-generated packages dir

* Fix comment position

* Also lint `/app/.storybook`

* Reformat modified files

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-06-29 11:54:01 +02:00
Azri Kahar
c80fa6d6b9 Assign sort number when creating field(s) (#18877)
Co-authored-by: Jan Arends <jan.arends@mailbox.org>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-06-28 13:47:15 +00:00
rijkvanzanten
2239ef8db7 v10.4.0 2023-06-27 17:43:26 -04:00
Rijk van Zanten
ca3e7f521f Upgrade previous "Extensions" system to new "Errors" model (#18797)
* Typecheck across packages that are built with esbuild

* Boilerplate new Errors package

* No need, tsup checks with --dts

* Switch to tsup

* Setup dev script

* Add readme

* More boilerplaty things

* Finish createError function

* Install @directus/random

* Downgrade node types

* Add utility function to check if an error is a DirectusError

* Use new is-error check

* Install errors package

* Add failed validation common error

* Export common errors

* Move joi convertion to utils

* Export failed validation

* Use new failed validation error in validate-batch

* Enhance typing output of createError

* Remove outdir (handled by tsup now)

* Replace Exception with Error

* Replace exception in test

* Remove exceptions from app

* Remove exceptions from app

* Remove failed validation exception from users service

* Remove old failed validation exception from shared

* Remove exceptions package in favor of errors

* Uninstall exceptions

* Replace baseexception check

* Migrate content too large error

* Critical detail

* Replace ForbiddenException

* WIP remove exceptions

* Add ForbiddenError to errors

* HitRateLimitError

* Move validation related error/helper to new validation package

* Add index

* Add docs

* Install random

* Convert TokenExpired

* Convert user-suspended

* Convert invalid-credentials

* Move UnsupportedMediaType

* Replace wrong imports for forbidden

* Convert invalid-ip

* Move invalid provider

* Move InvalidOtp

* Convert InvalidToken

* Move MethodNotAllowed

* Convert range not satisfiable

* Move unexpect response

* Move UnprocessableContent

* Move IllegalAssetTransformation

* Move RouteNotFound

* Finalize not found

* Various db errors

* Move value too long

* Move not null

* Move record-not-unique

* Move value out of range

* Finish db errors

* Service unavailable

* GQL errors

* Update packages/validation/src/errors/failed-validation.ts

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* Update packages/validation/src/errors/failed-validation.ts

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* InvalidQuery

* Add test for invalid query message constructor

* Invalid Payload

* Finalize exceptions move

* Improve type of isDirectusError

* Various fixes

* Fix build in api

* Update websocket exceptions use

* Allow optional reason for invalid config

* Update errors usage in utils

* Remove unused package from errors

* Update lockfile

* Update api/src/auth/drivers/ldap.ts

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* Update packages/validation/src/utils/joi-to-error-extensions.ts

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* Put error codes in shared enum

* Replace instanceof checks in api

* Fix tests I think

* Tweak override names

* Fix linter warnings

* Set snapshots

* Start fixing BB tests

* Fix blackbox tests

* Add changeset

* Update changeset

* Update extension docs to use new createError abstraction

* 🙄

* Fix graphql validation error name

* 🥳

* use ErrorCode.Forbidden

* fix blackbox auth login test

* Add license files

* Rename preMutationException to preMutationError

* Remove unused ms dep & sort package.json

* Remove periods from error messages for consistency

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

* Add optional code check

* Use updated error code checker

* Rename InvalidConfigError to InvalidProviderConfigError

---------

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
2023-06-27 17:22:26 -04:00
Rijk van Zanten
63069bd688 Consolidate Redis environment variables (#19010)
* Remove individual redis configurations

* Use shared redis config

* Update stub

* Add changeset

* Update .changeset/grumpy-rice-film.md

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Remove RATE_LIMITER_REDIS_ ref in docs

* Update REDIS config in docker compose example

* Readd missing param

* Fix mention of namespace ind ocs

* Undo moving of cache store env

* Update blackbox tests & docs

* Update api/src/env.ts

Co-authored-by: ian <licitdev@gmail.com>

* Fix casing of wEbSoCkEtS

* Remove redis namespace from env check

* Add global store back in

* Tweak phrasing

* Readd supplementary note 5

* Bring back CACHE_STORE in docs / tests

* Forgot one CACHE_STORE

* Consistent order

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
2023-06-27 13:34:49 -04:00
GitStart
16ed93c9b9 Expose case-insensitive variants of _starts_with and _ends_with (#18941)
Co-authored-by: RubensRafael <rubensrafael2@live.com>
Co-authored-by: v1b3m <vibenjamin6@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-06-27 17:48:29 +02:00
ian
757a5914af Flush cache when applying diff (#18986)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-06-27 15:13:54 +02:00
Rijk van Zanten
513a739b33 Drop support for Memcached (#18980) 2023-06-23 08:54:43 -04:00
Rijk van Zanten
3b52f2d59d Fix custom migrations running not validating against documented file path requirement (#18971)
* Require - to exist in custom migration filepath

* Update docs to mention shared helpers

* Add changeset
2023-06-22 19:00:01 -04:00
Rijk van Zanten
654e09ed5c Improve range type signature (#18970)
* Improve range type signature

Fixes #18793

* Add changeset

* Fix gcs test
2023-06-22 18:41:02 -04:00