@eienjs/adonisjs-api-query 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/config.stub +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ This package provides a set of macros on `ModelQueryBuilder` to build [Lucid](ht
|
|
|
17
17
|
|
|
18
18
|
## Documentation
|
|
19
19
|
|
|
20
|
-
The documentation is available on [EienJS](https://eienjs.com).
|
|
20
|
+
The documentation is available on [EienJS](https://eienjs.com/packages/adonisjs-api-query/getting-started/).
|
|
21
21
|
|
|
22
22
|
## Contributing
|
|
23
23
|
|
package/build/config.stub
CHANGED
|
@@ -5,8 +5,8 @@ import { defineConfig } from '@eienjs/adonisjs-api-query'
|
|
|
5
5
|
|
|
6
6
|
const apiQueryConfig = defineConfig({
|
|
7
7
|
/**
|
|
8
|
-
* By default the package will use the
|
|
9
|
-
* and
|
|
8
|
+
* By default the package will use the include, filter, sort
|
|
9
|
+
* and fields query parameters as described in the readme.
|
|
10
10
|
*
|
|
11
11
|
* You can customize these query string parameters here.
|
|
12
12
|
*/
|
|
@@ -31,20 +31,20 @@ const apiQueryConfig = defineConfig({
|
|
|
31
31
|
existsSuffix: 'Exists',
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* By default the package will throw an
|
|
35
|
-
* URL is not allowed in the
|
|
34
|
+
* By default the package will throw an InvalidFilterQuery exception when a filter in the
|
|
35
|
+
* URL is not allowed in the allowedFilters() method.
|
|
36
36
|
*/
|
|
37
37
|
disableInvalidFilterQueryException: false,
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* By default the package will throw an
|
|
41
|
-
* URL is not allowed in the
|
|
40
|
+
* By default the package will throw an InvalidSortQuery exception when a sort in the
|
|
41
|
+
* URL is not allowed in the allowedSorts() method.
|
|
42
42
|
*/
|
|
43
43
|
disableInvalidSortQueryException: false,
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* By default the package will throw an
|
|
47
|
-
* URL is not allowed in the
|
|
46
|
+
* By default the package will throw an InvalidIncludeQuery exception when an include in the
|
|
47
|
+
* URL is not allowed in the allowedIncludes() method.
|
|
48
48
|
*/
|
|
49
49
|
disableInvalidIncludesQueryException: false,
|
|
50
50
|
|
|
@@ -53,7 +53,7 @@ const apiQueryConfig = defineConfig({
|
|
|
53
53
|
* For example, fetching the id and name for a userOwner relation would look like this:
|
|
54
54
|
* GET /users?fields[userOwner]=id,name
|
|
55
55
|
*
|
|
56
|
-
* Set this to
|
|
56
|
+
* Set this to true if you don't want that and keep the requested relationship names as-is and allows you to
|
|
57
57
|
* request the fields using a snake case relationship name:
|
|
58
58
|
* GET /users?fields[user_owner]=id,name
|
|
59
59
|
*/
|
|
@@ -64,7 +64,7 @@ const apiQueryConfig = defineConfig({
|
|
|
64
64
|
* For example, fetching the id and name for a userOwner relation would look like this:
|
|
65
65
|
* GET /users?fields[userOwner]=id,name
|
|
66
66
|
*
|
|
67
|
-
* Set this to one of
|
|
67
|
+
* Set this to one of snake_case, camelCase or none if you want to enable table name resolution in addition to the relation name resolution
|
|
68
68
|
* GET /users?include=top_orders&fields[orders]=id,name
|
|
69
69
|
*/
|
|
70
70
|
convertRelationTableNameStrategy: false,
|
|
@@ -74,7 +74,7 @@ const apiQueryConfig = defineConfig({
|
|
|
74
74
|
* For example, fetching the field named firstName would look like this:
|
|
75
75
|
* GET /users?fields=firstName
|
|
76
76
|
*
|
|
77
|
-
* Set this to
|
|
77
|
+
* Set this to true if you want to convert the firstName into first_name for the underlying query
|
|
78
78
|
*/
|
|
79
79
|
convertFieldNamesToSnakeCase: false,
|
|
80
80
|
})
|