Commit Graph

48 Commits

Author SHA1 Message Date
rijkvanzanten
dd67fdbdfb Merge branch 'main' into aggregation 2021-06-23 18:09:00 -04:00
Rijk van Zanten
1cb9181052 Add support for starts/ends with filters (#6437) 2021-06-22 14:28:11 -04:00
rijkvanzanten
7ea10b2e21 Fix missing knex passthrough 2021-06-16 17:46:49 -04:00
rijkvanzanten
ea79d692e4 Allow functions in sort/filter 2021-06-16 17:39:39 -04:00
rijkvanzanten
d5685d69e9 Setup datetime abstraction 2021-06-16 15:07:09 -04:00
rijkvanzanten
a857ce1c17 Update params to match fields 2021-06-16 14:41:44 -04:00
rijkvanzanten
b80bdb7146 Apply aggregation query to dbQuery 2021-05-25 14:31:01 -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
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
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
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
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
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
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
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
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
rijkvanzanten
2a738b7b52 Scope order by clause to table
Fixes #4246
2021-02-23 10:53:25 -05:00
rijkvanzanten
3615612da0 Apply search to filter_count
Fixes #4121
2021-02-17 10:47:57 -05:00
Rijk van Zanten
b7d87e581a System permissions for app access (#4004)
* Pass relations through schema, instead of individual reads

* Fetch field transforms upfront

* Fix length check

* List if user has app access or not in accountability

* Load permissions up front, merge app access minimal permissions

* Show app access required permissions in permissions overview

* Show system minimal permissions in permissions detail

* Fix app access check in authenticate for jwt use

* Fix minimal permissions for presets

* Remove /permissions/me in favor of root use w/ permissions

* Fix logical nested OR in an AND

* Use root permissions endpoint with filter instead of /me

* Allow filter query on /permissions

* Add system minimal app access permissions into result of /permissions

* Remove stray console log

* Remove stray console.dir

* Set current role as role for minimal permissions

* Fix no-permissions state for user detail

* Add filter items function that allows altering existing result set
2021-02-11 12:50:56 -05:00
Rijk van Zanten
6108de4f3e Scope column name in table on search query (#3966)
Fixes #3964
2021-02-08 14:16:37 -05:00
Oreilles
40a20baa27 Fix wrong number casting in query 2021-01-19 08:46:02 +01:00
rijkvanzanten
8e3151d34f Improve search
Fixes #3443, fixes #3393
2021-01-15 19:07:05 -05:00
Aleksandar Stanisic
9c1308b8b6 Enable reversing _null, _nnull, _empty and _nempty 2020-12-21 00:06:52 +01:00
rijkvanzanten
ea1853acfb Alias joins to prevent naming conflicts in nested queries
Fixes #3294
2020-12-08 17:55:40 -05:00
Igor Savin
7cddb458cb Run prettier across app and api 2020-12-08 02:22:00 +02:00
rijkvanzanten
7891920209 Fix nested or filter in permissions
Fixes #3167
2020-11-23 10:24:00 -05:00
rijkvanzanten
8cbdfb409b Use prefetched schema info 2020-11-09 17:13:48 -05:00
e01
84f902bfac Fix _ncontains typo 2020-11-02 16:39:56 +02:00
rijkvanzanten
d3ca132fad Move system relations out of db 2020-10-29 13:29:07 -04:00
Nicola Krumschmidt
8b601c5b60 Pass knex instance to applyFilter
This fixes a regression introduced in #786.
When using a SQLite database, items could not be updated any more.
This is due to knex by default only allowing a single connection for
SQLite databases and the item update operation using applyFilter inside
a transaction which tries to use a different knex instance to connect to
the database.
2020-10-28 00:33:53 +01:00
rijkvanzanten
c49e1b0279 Extract adding joins to separate function 2020-10-26 18:33:38 +01:00
rijkvanzanten
8ecb8da3ab Default to _eq for filter 2020-10-26 17:30:27 +01:00
rijkvanzanten
febdd0adbd Attempt at resolving joins in nested where queries 2020-10-20 11:02:02 -04:00
rijkvanzanten
0657e290b4 Fix limit being ignored when offset was used
Fixes #522
2020-10-12 17:47:56 -04:00
rijkvanzanten
58f4c944e0 Update filter structure 2020-10-01 18:08:45 -04:00
rijkvanzanten
a5ff0a40c0 Add support for dot notation in filter parameter
Fixes #176
2020-09-25 12:40:52 -04:00
rijkvanzanten
8811d2a3b4 Fix limit=0 case 2020-09-08 12:21:18 -04:00
rijkvanzanten
3f0ae10085 Add support for not-in, empty, not empty, between, not between 2020-08-13 12:33:08 -04:00
rijkvanzanten
93e18a8e96 Add support for gt / gte / lt / lte 2020-08-12 18:27:55 -04:00
rijkvanzanten
06e926ad09 Rework meta service to class, add filter count support 2020-08-07 12:45:50 -04:00