Commit Graph

2379 Commits

Author SHA1 Message Date
Brainslug
bbcf76e030 enforce uppercase UUIDs for MS SQL (#16691)
* add forced uppercase for UUIDs in MS SQL

* test whether mssql returned uuid is uppercase

* use once just for slight better correctness

* once is actually not enough

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
2022-12-15 13:34:31 +08:00
Azri Kahar
431f95210a align ASSETS_CACHE_TTL default value in .env stub (#16755) 2022-12-15 00:34:02 +08:00
Brainslug
807bda3dcb Follow up user Roles not loading (#16278)
* applied the same role fix too users invite

* added same fix when saving permissions

* Prevent loading users unecessarily on the permission page

* Added proper `deep` query typing

* fixed typing for tests

* apply similar fix for navigation folder
2022-12-13 15:05:14 +01:00
Nick Ufer
9405e87a34 fix: adds missing Query and x-metadata to /components/schemas (#16524)
* fix: adds missing Query and x-metadata to /components/schemas

* test: adds Query and x-metadata to specifications.test.ts

* refactor: moves oas schemas to be always included to constants.ts

* refactor: renames OAS_INCLUDE_SCHEMAS to OAS_REQUIRED_SCHEMAS

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-12-06 09:17:23 +01:00
Piotr
018452d141 Fix typo in env stub (#16717) 2022-12-05 14:45:41 +01:00
Rijk van Zanten
86dd593f91 Use node16 module-resolution (#16696)
* Use node16 module-resolution

* Lets not mess with apply-query rn

* I love CJS. Death to CJS.

* Use CJS require in hook import

* Fix type export in schema

* Clean up defaults usage

* Use require instead of import for migrations

* Use a vitest compatible dynamic import

* Uno mas

* Cleanup type export
2022-12-02 15:53:15 -05:00
Azri Kahar
a4de019ead Fix repeated logic caused by updateOne & deleteOne overrides (#16433)
* fix updateOne & deleteOne overrides repeated logic

* replace remaining jest usages

* fix notifications service env mock

* simplify mockImplementation with mockResolvedValue

* fix types in test

Co-authored-by: ian <licitdev@gmail.com>
2022-11-30 21:51:11 +08:00
Brainslug
1eea9d8b0f Missing logs with Pino asynchronous logging (#16299)
* force logger in sync mode when running on the CLI

* using the sync logger for all cli commands

* using cli logger for app initialization

* using pino pretty for log formatting

* installed deps

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-11-29 14:26:37 -05:00
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