2371 Commits

Author SHA1 Message Date
rijkvanzanten
d6b8e5963d v9.21.2 2022-11-28 15:44:12 -05:00
rijkvanzanten
51b1daec58 v9.21.1 2022-11-28 15:09:00 -05:00
ian
8a3dc4b68b Propagate mutation options for schema apply (#16562)
* Propagate mutation options for schema apply

* Fix unit test

* Add bypassCache flag and remove flushCaches calls

* remove accountability option from getSchema

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-11-22 14:57:17 -05:00
José Varela
f3e4ae0b6f Add nonce to request (#16563) 2022-11-22 10:02:38 -05:00
Pascal Jufer
47db8e5d2f Clean-up dependencies (#16481)
* Clean-up api

- Remove unnecessary deps
- rimraf -> del-cli

* Clean-up app

- bytes -> pretty-bytes
- Remove ms as we already have pretty-ms
- Remove other unnecessary deps
- Add storybook build to gitignore

* Clean-up drive packages

- Simplify cleanup scripts
- rimraf -> del-cli
- Remove unnecessary deps

* Clean-up schema

- Remove unnecessary dep (lodash)
- Replace 'npm-watch' with native watch mode

* Clean-up shared

- Remove unnecessary dep (c8, adding @vitest/coverage-c8 will be addressed in
  other PR)
- rimraf -> del-cli
- npm-run-all -> concurrently

* Clean-up root

- Add missing eslint-plugin-jest dep
- listr -> listr2

* Make build output a bit friendlier

* Remove cleanup scripts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-18 17:02:41 +00:00
Azri Kahar
f0da901af4 Set auth_data to null when updating user (#16501) 2022-11-18 11:46:55 -05:00
ian
06aca3329c Remove named timezone usage on MySQL (#16499) 2022-11-18 11:46:29 -05:00
rijkvanzanten
ba00c28bf3 v9.21.0 2022-11-17 16:31:59 -05:00
rijkvanzanten
4ab04f67f3 Add getEnv wrapper 2022-11-17 12:20:57 -05:00
Azri Kahar
5e4d7972b1 use pnpm shell-emulator instead of cross-env (#16486)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-17 11:21:22 -05:00
ian
0ac08da7ed Fix legacy permissions for M2O fields in GraphQL (#16430)
* Remove relation for legacy permission without allowed field

* Remove deprecated formatError and improve error handling

* Add unit test

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-17 11:04:56 -05:00
Azri Kahar
ed53673b0f Fix condition operation passing even when the checked field isn't present in the payload (#16483)
* use requireAll in validatePayload for condition

* add/update tests
2022-11-17 10:55:43 -05:00
Rijk van Zanten
0bb34f0f0d Patch Tuesday 🐸 (#16475)
* Update monorepo root

* Update API dependencies

* Use unranged version

* Update app deps

* Upgrade packages dependencies

* Fix shared build

* Fix type warning in api

* Fix test runner

* Get rekt by ya boy comma-,

* Fix missing unit deprecation for sass color.mix()

Co-authored-by: ian <licitdev@gmail.com>
2022-11-17 08:51:42 -05:00
Nicola Krumschmidt
7bf90efa62 Add support for a package extension bundle type (#15672)
* Add bundle type to constants and types

* Add support for API bundle extensions

* Rename generateExtensionsEntry to generateExtensionsEntrypoint

* Add support for App bundle extensions

* Refactor App extension registration

* Replace extensions inject with useExtensions()

* Replace getInterfaces() with useExtensions()

* Replace getDisplays() with useExtensions()

* Replace getLayouts() with useExtensions()

* Replace getModules() with useExtensions()

* Replace getPanels() with useExtensions()

* Replace getOperations() with useExtensions()

* Add useExtension() composable

* Replace useExtensions() with useExtension() where applicable

* Remove interface getters

* Remove display getters

* Remove layout getters

* Remove module getter

* Remove panel getters

* Remove operation getters

* Rename extension register.ts files to index.ts

* Perform module pre register check in parallel

* Remove Refs from AppExtensionConfigs type

* Remove old extension shims

* Ensure registration of modules is awaited when hydrating

* Add support for scaffolding package extensions

* Add support for building bundle extensions

* Add JsonValue type

* Use json for complex command line flags

* Load internal extensions if custom ones are not available

* Fix extension manifest validation for pack extensions

* Fix tests in shared

* Add SplitEntrypoint type

* Move command specific utils to helpers

* Add SDK version getter

* Move extension dev deps generation to helpers

* Move template path to getter util

* Move template copying to a helper

* Only rename copied template files

* Add directus-extension add command

* Convert provided extension source path to url

* Replace deprecated import.meta.globEager

* Mock URL.createObjectURL to make App unit tests pass

* Update rollup-plugin-typescript2

* indentation

* sort vite glob imported modules

* fix unintentional wrong commit

* Simplify app extension import logic

* reinstall @rollup/plugin-virtual

* add test for getInterfaces() expected sort order

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-11-16 11:28:52 -05:00
Pascal Jufer
45eb4941fc Small clean-up after Jest to Vitest switch in API (#16462)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-15 17:20:45 -05:00
ian
e79720735a Fix unsupported date_part() in CrDB (#16461) 2022-11-15 15:22:12 -05:00
Pascal Jufer
adeabdfe7b Clean-up and unify all package.json files (#16447)
* Clean-up & unify all package.json files

* Sort all package.json files the same way

Using 'sort-package-json'

* Add funding link to packages
2022-11-15 11:35:28 -05:00
Azri Kahar
b0529d4951 Optimize number of times cache is being cleared in ItemsService updateBatch (#16453)
* improve cache clearing for updateBatch

* add service level data-is-array check

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-15 10:14:35 -05:00
ian
addb077d48 Emit action events with updated schema (#15576)
* Emit action events with updated schema

* Fix collections service consistency

* Pass action event upstream for createMany item

* Pass action event upstream when processing payload

* Skip unnecessary retrival of updated schema

* Fix folder tests

* Fields service consistency

* Prevent duplicate cache clearing when deleting fields

* Add tests_extensions_log table

* Update collections crud tests

* Add fields crud tests

* Add action verify schema tests

* Bypass system cache purge in relations service

* Bypass system cache purge in nested field deletion

* Update source for consistency when creating from collection
2022-11-15 10:02:45 -05:00
Pascal Jufer
df495edae0 Exclude unnecessary files from packages (#16374)
* Exclude unnecessary files from packages

* Add back 'copyfiles' in api to copy yaml and liquid files to dist

* Exclude declaration maps and all declaration files for drive packages

Excluding all declaration map files from published packages

Since the "drive" packages are only expected to be used internally, it's
enough to have the declaration files present when developing locally - no
need to include the types in the published packages

* Remove unnecessary entries in "files" field of app/package.json

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-15 09:51:04 -05:00
Pascal Jufer
c303bdcf10 Finish switch from Jest to Vitest in API (#16263)
* build:  add vitest and update test scripts

* build: 🔧 add vitest config

* build:  Migrate tests to vitest

Remove jest references from test api test files and replace with vitest equivalents.

Tests: 13 tests are failing.

* build: 🚚 move vite.config.ts to api/src folder

* build: 🔥 remove unused vitest.config from api root

* build:  import vitest modules for tests

* build:  add type conversion for actual object

* Finish switch from Jest to Vitest in API

* Replace some leftovers

* Load "sharp" before tests

* Try with cjs

* Temporary enable verbose reporter

* Try with globalSetup

* Fix path to globalSetup

* Provide default export in globalSetup

* Final clean-up

* Remove @vitest/ui & update vitest to 0.25.0

* Add vitest c8 coverage dependency

* Update vitest to v0.25.1

* Replace unnecessary Vitest workaround

* Rework new tests

* Resolve build errors

Co-authored-by: Dorian C Brown <brown.3794@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-14 16:09:47 -05:00
Azri Kahar
0fc4c501c3 Allow admin to update Directus User provider and external_identifier (#16436)
* allow admin to update `provider` & `external_id`

* remove unused external_id field

* test for provider and external_identifier

* remove unused test code
2022-11-14 09:46:22 -05:00
Azri Kahar
d3388eb139 fix cast-csv read action for csv field's revisions (#16438)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-14 14:44:47 +00:00
ian
4dfc00cf74 Fix limit in nested a2o queries (#16435)
* Set the limit into the correct query for a2o

* Revert -1 limit and set foreignIds size as limit
2022-11-14 09:41:36 -05:00
ian
6cf77668d1 Check original field name when aliased (#16234)
* Check original field name when aliased

* Rename to aliasMap

* Extract original field name

* Refactor for legibility

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

* Fix linting

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-14 09:40:15 -05:00
ian
282d5ae54e Fix date functions for databases not in UTC timezone (#16027)
* Fix date functions for databases not in UTC timezone

* Fix passing raw date objects to DB

* Add unit test

* Use global timezone for mysql and maria

* Fix unit test timezone inconsistency as date object is in local timezone

* Date and datetime fields should be in local timezone

* Fix missing padStart in local string

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-14 09:38:40 -05:00
Brainslug
692b8c4807 CockroachDB can't recreate constraints with the same name (#15984)
* use a different constraint name whyen recreating constraints for cockroachdb

* implement cockroach specific logic in the appropriate helper

Co-authored-by: ian <licitdev@gmail.com>
2022-11-14 13:21:23 +01:00
ian
8e400504ea Fix __typename selection for functions in GraphQL (#16413) 2022-11-11 17:32:00 -08:00
Azri Kahar
cc55d5608e Fix "create an item" requestBody schema in OAS (#16294) 2022-11-09 19:50:01 -08:00
Azri Kahar
24f1e539ba Fix base email template footer link & logo aspect ratio (#16233)
* fix email base template footer link

* fix logo box to be square

* clean up unused classes & attributes

* only add url if user has app access

* add test for notifications service

* re-add database mock

* attempt to fix mock in test

* mock PUBLIC_URL

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-09 07:52:44 -08:00
Azri Kahar
f1448e2e73 fix numeric precision and scale default value (#16368) 2022-11-09 07:49:44 -08:00
keesvanbemmel
37894fd71b Returns the nodemailer promise (#16099)
* Returns the nodemailer promise

* Requested change

* Added code to add type to return value
2022-11-09 07:47:12 -08:00
ian
6e730956af Update last value when triggering nested flows with array values (#16180)
* Update last payload when triggering array values

* Reuse keyedData when triggering other flows

* Expose flows data chain variables in run script operation

* Fix unit test

* Separate context for child flows

* Remove global variables from run script operation

* Simplify by using omit
2022-11-08 17:37:12 -08:00
ian
adff255d91 Skip checking of virtual alias fields (#16320)
* Default virtual fields as alias type

* Make the condition more verbose instead of defaulting

* Remove unnecessary optional chaining

* Add tests

* Revert to alias defaulting in #d06d62

* Shift condition up
2022-11-08 15:49:49 -08:00
ian
13d8dde534 v9.20.4 2022-11-03 11:01:46 +00:00
ian
64bffa60e9 Skip serialization for empty or string bigint values in GraphQL (#16297) 2022-11-03 18:37:56 +08:00
rijkvanzanten
c70211c48d v9.20.3 2022-11-02 12:12:52 -04:00
José Varela
0dce20c0b8 Fix check for alias fields (#16282)
They do not exist on fields definition
2022-11-03 00:10:28 +08:00
rijkvanzanten
d09d087fc9 v9.20.2 2022-11-02 08:56:09 -04:00
ian
ca2c761bde Skip alias type change check when type is not updated (#16270) 2022-11-02 08:54:35 -04:00
rijkvanzanten
b5d7db2ea0 v9.20.1 2022-11-01 21:36:16 -04:00
Roger Stringer
6ba97ea422 move @authenio/samlify-node-xmllint from dev to prod dependencies (#16260) 2022-11-01 19:59:54 -04:00
rijkvanzanten
15613d5853 v9.20.0 2022-11-01 19:08:33 -04:00
Roger Stringer
53a3194d5c Add support for SAML Part 2 (#16145)
* new saml branch

* put saml info back in

* put saml info back in

* clean up code

* validate saml config

* validate schema

* Add saml auth flow tests

* use RelayState for redirects

* Update tests for RelayState

* Fix linting

* remove validateMeta as samlify does it already

* Fix linting

* change catch on login

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

Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>

* remove login since not needed here

* clear cookie if set on logout

* empty login method

* invalidate logout in db

* if relayState and login failed, redirect back with a reason

* Cleanup linter warnings

* Remove range from packages

* Opinions opinions opinions opinions

Just a couple personal opinion cleanup pieces

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-01 22:09:31 +00:00
rijkvanzanten
8c5cda446a Use urlencoded thru express instead 2022-11-01 16:52:06 -04:00
Aiden Foxx
05c045e9ff Handle "form_post" OAuth and OpenID responses (#16231)
* Allow both POST and GET responses in OAuth flow

* Be more explicit about which method we fetch OAuth data from

* Removed unnecessary error handling in OAuth router

* Fixed method check in OAuth router

* Simplified method check

* Added POST support to OpenID flow

* Prefer redirect on OpenID POST to retain LAX cookie policy

* Prefer redirect on OAuth2 POST to retain LAX cookie policy

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

* Update api/src/auth/drivers/openid.ts
2022-11-01 16:44:17 -04:00
Azri Kahar
5780bb174f Fix custom hook mocked path in api cli test (#15271)
* fix custom hook mocked path in api cli test

* update @types/jest

* update to latest

* update and pin dependencies

* correct pnpm lock

* remove unrelated changes
2022-11-01 12:12:31 -04:00
Azri Kahar
17c0ef9182 Remove Content-Type header check in Files POST requests (#16176)
* remove request header check in files POST

* basic test

* it's filename_download instead of file_download

* unused vars begone

* make type required when creating file via JSON

* fix blackbox test

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-01 12:06:09 -04:00
Aiden Foxx
2adbb3bfd2 Convert some trace logs to warnings in OAuth flows (#16213)
* Less trace, more warn in OpenID provider

* Less trace, more warn in OAuth provider
2022-10-29 15:59:50 -04:00
Brainslug
9106fc78d6 strip function from fieldnames for validation (#16179) 2022-10-27 15:17:09 +08:00