Commit Graph

185 Commits

Author SHA1 Message Date
Rijk van Zanten
61f2e48ced Allow any of grant's (nested) configuration parameters (oAuth) (#6155)
* Allow underscore configuration extraction

* Allow any of grants config properties
2021-06-09 12:08:48 -04:00
rijkvanzanten
91253a241d Fix linter warning 2021-06-04 12:44:10 -04:00
Rijk van Zanten
85d33d9ffc Fixed an issue that would cause "text" fields to show up as varchar with length -1 in MS SQL (#6055)
Fixes #5944
2021-06-03 22:35:07 -04:00
Rijk van Zanten
2270d870f9 Prevent foreign key constraint names from exceeding 64 characters (#6043)
* Add index name generator function

* Ensure foreign keys are 64 chars or less
2021-06-03 17:31:58 -04:00
Rijk van Zanten
77e00b7db4 Don't initialize database on file require (#6003) 2021-06-02 11:41:42 -04:00
Rijk van Zanten
02fc696c53 Fix env var validation in database loading step (#6002)
Fixes #5980
2021-06-02 11:17:50 -04:00
rijkvanzanten
c3589d138f Remove remaining leftovers from deprecated single query param 2021-05-25 11:38:33 -04:00
Rijk van Zanten
ce59ce0d2f Support top-level filter through relational m2a items (#5855)
Fixes #5850
2021-05-24 12:20:15 -04:00
Oreille
bb14309b9c Add support for mssql uniqueidentifier type (#5804) 2021-05-21 10:08:02 -04:00
Rijk van Zanten
9335372400 Foreign Key Constraints (#5615)
* Bump knex-schema-inspector

* Fix cli role name attr

* Update relation type

* Restructure relations

* Restructure relations table

* Update api type for relation record

* Fetch relations in new structure

* Update schema-inspector

* Use new relations schema structure in api

* Update relations GETters

* Add default value to one deselect

* Add create relationship on existing field

* Add updating existing relationship

* Add delete relations

* Add relations query resolver

* Add graphql mutations for relations

* Fix reading from wrong name

* Fix wrong method name

* No idea why this flip flops every install

* Update relation type

* Accept null in use-collection composable

* Use new relations structure in translations

* Use new relations structure in new-collection

* Start updating field detail store

* Renames for new relations structure

* Silently ignore passed collection/field in relation update

* Fix setting pk field in m2o relational setup

* Small tweaks in o2m setup

* Fix m2m setup

* Tweak m2o setup

* Fix m2a setup

* Allow null for related collection (m2a)

* Fix languages code name

* Fix migration default value

* Fix relational cleanup in collections/fields

* Fix transaction problem in field delete

* Fix inserting relational o2m items

* Don't execute updateByQuery on empty item set

Fixes #5710, fixes #5070

* Show referential action input on m2o

* Finish language for m2o

* Show triggers config on o2m

* Delete items on one_deselect_item delete

* Fix naming, show relational trigger config on m2m

* Tweak language, add setup to m2a

* Fix linter warnings

* Add trigger setup for translations

* fix Edit non-schema relationship issue

* Sync existing on_delete triggers in o2m setup

* Add migration to setup foreign key constraints

* Update illegal FK values before setting constraint

* Fix MySQL unsigned vs not-unsigned in FK creation

* Use pretty names for labels in relational triggers

* Prefix auto-junction when system table

Fixes #5493

* Add system foreign key triggers

Fixes #5749

* Update docs
2021-05-19 12:29:16 -04:00
mcarlson
7531585ccd Fixes #5599 - add jsonb field type mapping for postgres (#5611) 2021-05-11 19:55:19 +00:00
dependabot[bot]
bc30ee2bde Bump prettier from 2.2.1 to 2.3.0 (#5593)
* Bump prettier from 2.2.1 to 2.3.0

Bumps [prettier](https://github.com/prettier/prettier) from 2.2.1 to 2.3.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.1...2.3.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix lint issues for updated prettier

* Lets remove dev: true again so we can auto-add it later why don't we

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-05-11 10:38:42 -04:00
Rijk van Zanten
b6964fa1a1 Add XML export (#5526) 2021-05-07 12:55:03 -04:00
Ilya Belousov
4217ace3b4 * Ignore undefined in array filter values (#5506)
* Ignore non 2-length value for between-filters

Ref #4471
2021-05-06 15:10:26 +00:00
rijkvanzanten
99fcf12e73 Fix linter workflow 2021-04-29 16:24:31 -04:00
Aiden Foxx
c255afd7f1 Update get-local-type.ts (#5375) 2021-04-29 20:00:17 +00:00
rijkvanzanten
801e868554 Fix remaining eslint errors
h/t @paescuj
2021-04-29 15:55:12 -04:00
Pascal Jufer
acd41eb0be Syntax fixes (#5367)
* Declare return types on functions

And a very few other type related minor fixes

* Minor syntax fixes

* Remove unnecessary escape chars in regexes
* Remove unnecessary awaits
* Replace deprecated req.connection with req.socket
* Replace deprecated upload with uploadOne
* Remove unnecessary eslint-disable-next-line comments
* Comment empty functions / catch or finally clauses
* Fix irregular whitespaces
* Add missing returns (null)
* Remove unreachable code
* A few logical fixes
* Remove / Handle non-null assertions which are certainly unnecessary (e.g. in
tests)
2021-04-29 12:11:43 -04:00
Martijn Boland
d9baa0b92d Also join o2m relations when not in subquery but at non-root level (#5338) 2021-04-28 22:21:56 +00:00
rijkvanzanten
98c9b9a9ff Ignore invalid array filter values as well
Ref #4471
2021-04-28 15:29:21 -04:00
rijkvanzanten
40ecaec4c7 Skip empty filters
Fixes #4471

Squashed commit of the following:

commit 58f7e60710808e927c636a0f0a8c7c91611e8fcb
Author: rijkvanzanten <rijkvanzanten@me.com>
Date:   Mon Apr 26 12:34:15 2021 -0400

    Skip empty filters
2021-04-26 12:36:24 -04:00
Rijk van Zanten
f1e2338142 Add auth password policy / login attempts support (#5225)
* Check auth password policy on user modifications

* Show validation errors in drawer-batch

* Allow custom password policy, add placeholder

* Add UserSuspended exception

* Add user suspended error translation

* Move rate limiter creation into root helper

* Add login attempts support to authentication service

* Don't authenticate into settings service when checking password policy
2021-04-23 17:42:46 -04:00
rijkvanzanten
f873f184f5 Fix deep querying in nested o2m in m2a structure 2021-04-22 10:10:41 -04:00
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
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
Rijk van Zanten
40b9fb0fe6 Allow disabling activity/revisions (#5112)
* Add accountability column

* Add field info for accountability

* Add accountability to collection type

* Fetch accountability info from collection meta

* Add field name translation for accountability field

* Hide revisions drawer detail if revisions aren't available

* Only save activity where accountability flag matches

* Disable revisions for directus_presets

Fixes #3767

* Tweak field option naming
2021-04-16 16:26:18 -04:00
rijkvanzanten
86e3850e4f Fix 0 as default value 2021-04-16 11:51:20 -04:00
Rijk van Zanten
1fb4db1fda Add _regex validation operator (#5089)
Closes #2917
2021-04-15 17:25:51 -04:00
Pavlo Savenko
b160ae733b fix: use nullish coalescing operator for setting nullable and defaultValue properties in the getSchema function instead of the ||(or) logical operator which always causes assigning true to the nullable property and ignores 0 and false default values (#5063) 2021-04-14 17:18:39 -04:00
cristobalbahe
b1f36b1939 Return instance of Date from payload.ts (#4992)
* Return instance of Date from payload.ts

* Revert formatter to date

* Use non-JS-Date object date scalar

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-12 17:59:37 -04:00
rijkvanzanten
a75c1ae8f4 Return ISO8601 date strings as GraphQLStrings
Fixes #4938
2021-04-09 18:44:26 -04:00
Rijk van Zanten
d49898d54d fix/4873 (#4885)
* Fix permissions check for /system endpoint

* Filter out empty / corrupted fields/collections rows in get-schema

Fixes #4873
2021-04-07 11:39:54 -04:00
rijkvanzanten
9859212253 Fix o2m fields missing by default 2021-04-05 16:39:30 -04:00
Fatih Kaya
da4b66aca8 fix: exclude aliases from the payload. fixes #4810 (#4822)
* fix: exclude aliases from the payload

* Use alias from columns

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-05 16:20:18 -04:00
WoLfulus
3c1204b928 SDK 2.0 (#4510)
* add new sdk

* update version

* fixes and sdk documentation

* typing updates, documentation

* added missing endpoints

* targeting minified version for unpkg

* removed unused types file

* fixed non minified versions

* fix sdk exports

* fix the fix

* Remove old sdk

* Remove old sdk docs

* Install types for Jest, add npm test

* Rely on npm exclusively

* Remove examples folder

* Move typescript down

* Update sdk.md

* added auto refresh and requested changes

added more http test calls
fixed typing issue in customized types

* remove unused endpoint

* updated docs

* added singletons, fixed typing issues, added password handlers

* rename graphql function and fixed system endpoint

* Remove unused imports, fix build

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Ben Haynes <ben@rngr.org>
2021-03-30 18:23:23 -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
Rijk van Zanten
b562ceeb0c Add Tree-View Interface (#4602)
* Fix local type extraction

* Render basic tree in tree-view

* Render drawer-item in tree-view-group

* Retrieve nested draggable changes

* Default sort query to configured sortField

* Store nested group / sort to API

* Allow updating item values

* Figure out a dropzone approach on preview

* Finish editable tree view

* Set sort value based on sort field in relation

* Add create-new / add-existing

* Respect previously made nested edits

* Add description in setup

* Fix fetching level of o2m sort field

* Remove min height on empty root

* Remove unused types

* Add notice for invalid relationship type

* Allow recursive o2m in setup

* Styling tweak

* Revert changes in v-list

* Revert changes in groupable
2021-03-26 17:12:55 -04:00
Rijk van Zanten
c310afa846 Rely on npm Workspaces for module resolving (#4656)
* Move devDeps to API

* Move app to npm workspaces

* Tweaks / add lockfiles

* Add locks, fix devdeps across packages

* Move eslint config rootlevel

* Use eslint fix for vue files instead of vue-cli-service

* Add global prettier format option

* Create lockfiles for all packages

* Replace husky with simple-git-hooks
2021-03-24 16:01:49 -04:00
alejandro-tss
fba39e0c3a Fixed ambiguous column when field name exists in some join table (#4649) 2021-03-24 10:16:14 -04:00
rijkvanzanten
5c08b8412c Fix type issue 2021-03-11 18:56:03 -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
Rijk van Zanten
97dcdad847 OracleDB baby steps (#4464)
* Allow external connections in oracle debug

* Fix oracle overview query

* Use correct alive check for oracle

* Remove unused import

* Validate correct env vars for oracle
2021-03-10 16:58:49 -05:00
rijkvanzanten
ada85b20ce Fix build on rc 45
Fixes #4418
2021-03-08 11:18:14 -05:00
rijkvanzanten
6b78c34e43 Parse deep object structure as json
Fixes #4428
2021-03-08 08:22:25 -05:00
rijkvanzanten
d3c58e2e8c Parse between/nbetween as arrays 2021-03-05 10:13:16 -05:00
rijkvanzanten
61c5522c06 Treat filter "null" as null
Closes #4386
2021-03-04 17:12:44 -05:00
Martijn Boland
bed7890a6b Filter O2M collections with a subquery instead of joins to prevent cartesian products (#4278)
* Cherry-picked fix for 4078 from mssql-to-success branch

* Only use o2m joins in subqueries

* Allow more array nesting in query params

* Clarify naming

* Return empty nested o2m sets as array

Co-authored-by: Martijn Boland <martijn@taiga.nl>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-04 16:58:13 -05:00
Rijk van Zanten
30f631b0b2 Allow deeply nested queries with deep (#4384)
* Allow deeply nested query using _prefix

* Support deeply nested deep-queries

* Parse nested deep in GraphQL correctly

* Update docs
2021-03-04 12:59:54 -05:00
Nicola Krumschmidt
08293b8570 Update Knex to version 0.95.0 (#4374)
* Update Knex to version 0.95.0

* Fix formatting in schema dialects

* Fix Knex imports

* Update package-lock

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-03 19:37:44 -05:00
rijkvanzanten
09a4b673eb Fix filtering by number
Fixes #3917
2021-02-26 17:30:20 -05:00