quetch 0.13.0 → 0.15.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/dist/tools/filterChildren.d.ts +2 -2
- package/dist/tools/filterChildren.js.map +1 -1
- package/dist/tools/get.d.ts +14 -0
- package/dist/tools/get.js +36 -0
- package/dist/tools/get.js.map +1 -0
- package/dist/tools/queryItemList.js +4 -4
- package/dist/tools/queryItemList.js.map +1 -1
- package/dist/tools/{filterItem.d.ts → testFilter.d.ts} +2 -2
- package/dist/tools/testFilter.js +214 -0
- package/dist/tools/testFilter.js.map +1 -0
- package/dist/tools.d.ts +2 -1
- package/dist/tools.js +2 -1
- package/dist/tools.js.map +1 -1
- package/dist/types/Field.d.ts +2 -0
- package/dist/types/Field.js +2 -0
- package/dist/types/Field.js.map +1 -0
- package/dist/types/FieldFiltered.d.ts +3 -0
- package/dist/types/FieldFiltered.js +2 -0
- package/dist/types/FieldFiltered.js.map +1 -0
- package/dist/types/FieldFunctionFormatDate.d.ts +2 -2
- package/dist/types/FilterArray.d.ts +4 -4
- package/dist/types/FilterBoolean.d.ts +4 -4
- package/dist/types/FilterChildren.d.ts +1 -1
- package/dist/types/FilterField.d.ts +3 -2
- package/dist/types/FilterNumber.d.ts +4 -4
- package/dist/types/FilterString.d.ts +4 -4
- package/dist/types/FilterStringIntersect.d.ts +4 -4
- package/dist/types/FilterStringMatch.d.ts +5 -8
- package/dist/types/Get.d.ts +2 -3
- package/dist/types/{FilterKeys.d.ts → KeyFiltered.d.ts} +1 -1
- package/dist/types/KeyFiltered.js +2 -0
- package/dist/types/KeyFiltered.js.map +1 -0
- package/dist/types/Path.d.ts +3 -0
- package/dist/types/Path.js +2 -0
- package/dist/types/Path.js.map +1 -0
- package/dist/types/PathFiltered.d.ts +3 -0
- package/dist/types/PathFiltered.js +2 -0
- package/dist/types/PathFiltered.js.map +1 -0
- package/dist/types/QuerySettings.d.ts +2 -2
- package/dist/types/Value.d.ts +15 -0
- package/dist/types/Value.js +2 -0
- package/dist/types/Value.js.map +1 -0
- package/dist/types.d.ts +6 -1
- package/doc/README.md +396 -290
- package/doc/classes/RequestError.md +12 -8
- package/doc/interfaces/CustomFetch.md +5 -5
- package/lib/tools/filterChildren.ts +2 -2
- package/lib/tools/get.test.ts +23 -0
- package/lib/tools/get.ts +57 -0
- package/lib/tools/queryItemList.ts +4 -4
- package/lib/tools/{filterItem.test.ts → testFilter.test.ts} +44 -38
- package/lib/tools/testFilter.ts +320 -0
- package/lib/tools.ts +2 -1
- package/lib/types/Field.ts +3 -0
- package/lib/types/FieldFiltered.ts +6 -0
- package/lib/types/FieldFunctionFormatDate.ts +2 -2
- package/lib/types/FilterArray.ts +4 -4
- package/lib/types/FilterBoolean.ts +4 -4
- package/lib/types/FilterChildren.ts +1 -1
- package/lib/types/FilterField.ts +4 -2
- package/lib/types/FilterNumber.ts +4 -4
- package/lib/types/FilterString.ts +4 -4
- package/lib/types/FilterStringIntersect.ts +4 -4
- package/lib/types/FilterStringMatch.ts +5 -8
- package/lib/types/Get.ts +9 -5
- package/lib/types/{FilterKeys.ts → KeyFiltered.ts} +1 -1
- package/lib/types/Path.ts +7 -0
- package/lib/types/PathFiltered.ts +9 -0
- package/lib/types/QuerySettings.ts +2 -2
- package/lib/types/Value.ts +18 -0
- package/lib/types.ts +6 -1
- package/package.json +9 -7
- package/dist/tools/filterItem.js +0 -197
- package/dist/tools/filterItem.js.map +0 -1
- package/dist/types/FilterKeys.js +0 -2
- package/dist/types/FilterKeys.js.map +0 -1
- package/lib/tools/filterItem.ts +0 -299
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { FieldFiltered } from "./FieldFiltered";
|
|
1
2
|
import type { Filter } from "./Filter";
|
|
2
3
|
import type { FilterChildren } from "./FilterChildren";
|
|
3
|
-
import type { FilterKeys } from "./FilterKeys";
|
|
4
4
|
/**
|
|
5
5
|
* Settings to use when doing a query.
|
|
6
6
|
*/
|
|
@@ -12,7 +12,7 @@ export type QuerySettings<T extends object> = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Field key to that contains the path value of an item.
|
|
14
14
|
*/
|
|
15
|
-
pathFieldKey?:
|
|
15
|
+
pathFieldKey?: FieldFiltered<T, string>;
|
|
16
16
|
/**
|
|
17
17
|
* Returns a filter that captures the items expressed by the provided `FilterChildren`. The return filter cannot use filters of type `FilterChildren`.
|
|
18
18
|
*
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FieldFiltered } from "./FieldFiltered";
|
|
2
|
+
/**
|
|
3
|
+
* Actual `value` or `valueField` leading to the value.
|
|
4
|
+
*/
|
|
5
|
+
export type Value<T extends object, V> = {
|
|
6
|
+
/**
|
|
7
|
+
* Value to use.
|
|
8
|
+
*/
|
|
9
|
+
value: V;
|
|
10
|
+
} | {
|
|
11
|
+
/**
|
|
12
|
+
* Path leading to the value.
|
|
13
|
+
*/
|
|
14
|
+
valueField: FieldFiltered<T, V>;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Value.js","sourceRoot":"","sources":["../../lib/types/Value.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type { Context } from "./types/Context";
|
|
|
5
5
|
export type { CustomFetch } from "./types/CustomFetch";
|
|
6
6
|
export type { CustomFieldAggregateMap } from "./types/CustomFieldAggregateMap";
|
|
7
7
|
export type { CustomFieldMap } from "./types/CustomFieldMap";
|
|
8
|
+
export type { Field } from "./types/Field";
|
|
9
|
+
export type { FieldFiltered } from "./types/FieldFiltered";
|
|
8
10
|
export type { FieldFunction } from "./types/FieldFunction";
|
|
9
11
|
export type { FieldFunctionCustom } from "./types/FieldFunctionCustom";
|
|
10
12
|
export type { FieldFunctionFormatDate } from "./types/FieldFunctionFormatDate";
|
|
@@ -16,7 +18,6 @@ export type { FilterChildren } from "./types/FilterChildren";
|
|
|
16
18
|
export type { FilterCustom } from "./types/FilterCustom";
|
|
17
19
|
export type { FilterField } from "./types/FilterField";
|
|
18
20
|
export type { FilterGroup } from "./types/FilterGroup";
|
|
19
|
-
export type { FilterKeys } from "./types/FilterKeys";
|
|
20
21
|
export type { FilterNumber } from "./types/FilterNumber";
|
|
21
22
|
export type { FilterOperator } from "./types/FilterOperator";
|
|
22
23
|
export type { FilterString } from "./types/FilterString";
|
|
@@ -29,11 +30,14 @@ export type { Immutable } from "./types/Immutable";
|
|
|
29
30
|
export type { InjectCustomFields } from "./types/InjectCustomFields";
|
|
30
31
|
export type { Item } from "./types/Item";
|
|
31
32
|
export type { Key } from "./types/Key";
|
|
33
|
+
export type { KeyFiltered } from "./types/KeyFiltered";
|
|
32
34
|
export type { Locale } from "./types/Locale";
|
|
33
35
|
export type { Mutable } from "./types/Mutable";
|
|
34
36
|
export type { NextHandler } from "./types/NextHandler";
|
|
35
37
|
export type { Order } from "./types/Order";
|
|
36
38
|
export type { Parameters } from "./types/Parameters";
|
|
39
|
+
export type { Path } from "./types/Path";
|
|
40
|
+
export type { PathFiltered } from "./types/PathFiltered";
|
|
37
41
|
export type { Query } from "./types/Query";
|
|
38
42
|
export type { QueryAggregate } from "./types/QueryAggregate";
|
|
39
43
|
export type { QueryCreate } from "./types/QueryCreate";
|
|
@@ -48,3 +52,4 @@ export type { QueryUpdate } from "./types/QueryUpdate";
|
|
|
48
52
|
export type { QueryUpdateMultiple } from "./types/QueryUpdateMultiple";
|
|
49
53
|
export type { Result } from "./types/Result";
|
|
50
54
|
export type { Store } from "./types/Store";
|
|
55
|
+
export type { Value } from "./types/Value";
|