quetch 0.31.1 → 0.32.1
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/fieldListUnion.d.ts +9 -0
- package/dist/tools/fieldListUnion.js +21 -0
- package/dist/tools/fieldListUnion.js.map +1 -0
- package/dist/tools.d.ts +1 -0
- package/dist/tools.js +1 -0
- package/dist/tools.js.map +1 -1
- package/dist/types/IntersectUnion.d.ts +3 -0
- package/dist/types/Prettify.d.ts +6 -0
- package/dist/types/Prettify.js +1 -0
- package/dist/types/Prettify.js.map +1 -0
- package/dist/types/QueryRead.d.ts +2 -1
- package/dist/types/QueryReadMultiple.d.ts +2 -1
- package/dist/types/Result.d.ts +28 -20
- package/dist/types.d.ts +1 -0
- package/doc/README.md +2 -0
- package/doc/classes/RequestError.md +5 -5
- package/doc/functions/aggregate.md +1 -1
- package/doc/functions/branch.md +1 -1
- package/doc/functions/cache.md +1 -1
- package/doc/functions/combine.md +1 -1
- package/doc/functions/comparatorFieldValues.md +1 -1
- package/doc/functions/cork.md +1 -1
- package/doc/functions/defineCheckQuery.md +1 -1
- package/doc/functions/defineCustomFetch.md +1 -1
- package/doc/functions/defineGenericFetch.md +1 -1
- package/doc/functions/escapeRegex.md +1 -1
- package/doc/functions/fetchExternal.md +1 -1
- package/doc/functions/fetchLocal.md +1 -1
- package/doc/functions/fieldListFromFilter.md +1 -1
- package/doc/functions/fieldListUnion.md +35 -0
- package/doc/functions/filterChildren.md +1 -1
- package/doc/functions/filterFromValue.md +1 -1
- package/doc/functions/get.md +1 -1
- package/doc/functions/groupFilters.md +1 -1
- package/doc/functions/identity.md +1 -1
- package/doc/functions/intrinsicFilter.md +1 -1
- package/doc/functions/isFilterGroup.md +1 -1
- package/doc/functions/log.md +1 -1
- package/doc/functions/normalizeOrder.md +1 -1
- package/doc/functions/queryItemList.md +1 -1
- package/doc/functions/querySettings.md +1 -1
- package/doc/functions/retry.md +1 -1
- package/doc/functions/reverseOrder.md +1 -1
- package/doc/functions/sameField.md +1 -1
- package/doc/functions/sortItemList.md +1 -1
- package/doc/functions/splitPath.md +2 -2
- package/doc/functions/testFilter.md +1 -1
- package/doc/functions/transformerFilterChildren.md +1 -1
- package/doc/interfaces/CustomFetch.md +1 -1
- package/doc/type-aliases/AggregateFunction.md +1 -1
- package/doc/type-aliases/AggregateFunctionOperator.md +1 -1
- package/doc/type-aliases/CombineUnion.md +1 -1
- package/doc/type-aliases/Context.md +1 -1
- package/doc/type-aliases/CustomFieldAggregateMap.md +1 -1
- package/doc/type-aliases/CustomFieldMap.md +1 -1
- package/doc/type-aliases/Decrement.md +1 -1
- package/doc/type-aliases/DepthLimit.md +1 -1
- package/doc/type-aliases/Field.md +1 -1
- package/doc/type-aliases/FieldFiltered.md +1 -1
- package/doc/type-aliases/FieldFunction.md +1 -1
- package/doc/type-aliases/FieldFunctionCustom.md +1 -1
- package/doc/type-aliases/FieldFunctionFormatDate.md +1 -1
- package/doc/type-aliases/FieldFunctionReturn.md +1 -1
- package/doc/type-aliases/FieldKey.md +1 -1
- package/doc/type-aliases/FieldMap.md +1 -1
- package/doc/type-aliases/Filter.md +1 -1
- package/doc/type-aliases/FilterArray.md +1 -1
- package/doc/type-aliases/FilterBoolean.md +1 -1
- package/doc/type-aliases/FilterChildren.md +1 -1
- package/doc/type-aliases/FilterCustom.md +1 -1
- package/doc/type-aliases/FilterField.md +1 -1
- package/doc/type-aliases/FilterGroup.md +1 -1
- package/doc/type-aliases/FilterNumber.md +1 -1
- package/doc/type-aliases/FilterOperator.md +1 -1
- package/doc/type-aliases/FilterString.md +1 -1
- package/doc/type-aliases/FilterStringIntersect.md +1 -1
- package/doc/type-aliases/FilterStringMatch.md +1 -1
- package/doc/type-aliases/Get.md +1 -1
- package/doc/type-aliases/Group.md +1 -1
- package/doc/type-aliases/Handler.md +1 -1
- package/doc/type-aliases/Immutable.md +1 -1
- package/doc/type-aliases/InjectCustomFields.md +1 -1
- package/doc/type-aliases/IntersectUnion.md +3 -1
- package/doc/type-aliases/IntrinsicFilter.md +1 -1
- package/doc/type-aliases/Item.md +1 -1
- package/doc/type-aliases/Join.md +1 -1
- package/doc/type-aliases/Key.md +1 -1
- package/doc/type-aliases/KeyFiltered.md +1 -1
- package/doc/type-aliases/KeyFromUnion.md +1 -1
- package/doc/type-aliases/Locale.md +1 -1
- package/doc/type-aliases/NextHandler.md +1 -1
- package/doc/type-aliases/NormalizedPathFieldSettings.md +1 -1
- package/doc/type-aliases/Order.md +1 -1
- package/doc/type-aliases/OrderNormalized.md +1 -1
- package/doc/type-aliases/Parameters.md +1 -1
- package/doc/type-aliases/Path.md +1 -1
- package/doc/type-aliases/PathFiltered.md +1 -1
- package/doc/type-aliases/Prettify.md +19 -0
- package/doc/type-aliases/Primitive.md +1 -1
- package/doc/type-aliases/PrimitiveObject.md +1 -1
- package/doc/type-aliases/Query.md +1 -1
- package/doc/type-aliases/QueryAggregate.md +1 -1
- package/doc/type-aliases/QueryCreate.md +1 -1
- package/doc/type-aliases/QueryCreateMultiple.md +1 -1
- package/doc/type-aliases/QueryDelete.md +1 -1
- package/doc/type-aliases/QueryDeleteMultiple.md +1 -1
- package/doc/type-aliases/QueryMethod.md +1 -1
- package/doc/type-aliases/QueryRead.md +2 -2
- package/doc/type-aliases/QueryReadMultiple.md +2 -2
- package/doc/type-aliases/QuerySettings.md +1 -1
- package/doc/type-aliases/QueryUpdate.md +1 -1
- package/doc/type-aliases/QueryUpdateMultiple.md +1 -1
- package/doc/type-aliases/Result.md +4 -2
- package/doc/type-aliases/Store.md +1 -1
- package/doc/type-aliases/Value.md +1 -1
- package/doc/type-aliases/ValueMap.md +1 -1
- package/doc/variables/CACHE.md +1 -1
- package/doc/variables/FILTER_ANY.md +1 -1
- package/doc/variables/FILTER_NONE.md +1 -1
- package/doc/variables/SELF.md +1 -1
- package/lib/tools/fieldListUnion.ts +26 -0
- package/lib/tools.ts +1 -0
- package/lib/types/IntersectUnion.ts +3 -0
- package/lib/types/Prettify.ts +8 -0
- package/lib/types/QueryRead.ts +2 -1
- package/lib/types/QueryReadMultiple.ts +2 -1
- package/lib/types/Result.ts +63 -21
- package/lib/types.ts +1 -0
- package/package.json +4 -2
|
@@ -36,4 +36,4 @@ Applies a custom field transform function.
|
|
|
36
36
|
|
|
37
37
|
## Defined in
|
|
38
38
|
|
|
39
|
-
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/
|
|
39
|
+
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FieldFunctionCustom.ts#L4)
|
|
@@ -30,4 +30,4 @@ Formats the date found in a given field, which can be an ISO string date or a ti
|
|
|
30
30
|
|
|
31
31
|
## Defined in
|
|
32
32
|
|
|
33
|
-
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/
|
|
33
|
+
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FieldFunctionFormatDate.ts#L6)
|
|
@@ -18,4 +18,4 @@ Return types of custom field functions.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FieldFunctionReturn.ts#L4)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/FieldKey.ts:6](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/FieldKey.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FieldKey.ts#L6)
|
|
@@ -18,4 +18,4 @@ Maps the fields of the provided value `T` to a specific value `V`.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/FieldMap.ts:6](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/FieldMap.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FieldMap.ts#L6)
|
|
@@ -16,4 +16,4 @@ Describes a predicate for filtering items.
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Filter.ts#L15)
|
|
@@ -32,4 +32,4 @@ Checks if a given array field matches a given array value according to a given o
|
|
|
32
32
|
|
|
33
33
|
## Defined in
|
|
34
34
|
|
|
35
|
-
[lib/types/FilterArray.ts:11](https://github.com/nevoland/quetch/blob/
|
|
35
|
+
[lib/types/FilterArray.ts:11](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterArray.ts#L11)
|
|
@@ -26,4 +26,4 @@ Checks if a given boolean field is `true` or `false`.
|
|
|
26
26
|
|
|
27
27
|
## Defined in
|
|
28
28
|
|
|
29
|
-
[lib/types/FilterBoolean.ts:7](https://github.com/nevoland/quetch/blob/
|
|
29
|
+
[lib/types/FilterBoolean.ts:7](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterBoolean.ts#L7)
|
|
@@ -54,4 +54,4 @@ Minimum depth of the children to match. If `0`, matches the parent. If `1`, matc
|
|
|
54
54
|
|
|
55
55
|
## Defined in
|
|
56
56
|
|
|
57
|
-
[lib/types/FilterChildren.ts:8](https://github.com/nevoland/quetch/blob/
|
|
57
|
+
[lib/types/FilterChildren.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterChildren.ts#L8)
|
|
@@ -36,4 +36,4 @@ Custom filter where `value(item)` returns `true` for matching items.
|
|
|
36
36
|
|
|
37
37
|
## Defined in
|
|
38
38
|
|
|
39
|
-
[lib/types/FilterCustom.ts:4](https://github.com/nevoland/quetch/blob/
|
|
39
|
+
[lib/types/FilterCustom.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterCustom.ts#L4)
|
|
@@ -28,4 +28,4 @@ The field name or path for which to check its existence.
|
|
|
28
28
|
|
|
29
29
|
## Defined in
|
|
30
30
|
|
|
31
|
-
[lib/types/FilterField.ts:6](https://github.com/nevoland/quetch/blob/
|
|
31
|
+
[lib/types/FilterField.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterField.ts#L6)
|
|
@@ -84,4 +84,4 @@ Filters to join.
|
|
|
84
84
|
|
|
85
85
|
## Defined in
|
|
86
86
|
|
|
87
|
-
[lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/
|
|
87
|
+
[lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterGroup.ts#L6)
|
|
@@ -26,4 +26,4 @@ Checks if a given number field matches a given number value according to a given
|
|
|
26
26
|
|
|
27
27
|
## Defined in
|
|
28
28
|
|
|
29
|
-
[lib/types/FilterNumber.ts:7](https://github.com/nevoland/quetch/blob/
|
|
29
|
+
[lib/types/FilterNumber.ts:7](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterNumber.ts#L7)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterOperator.ts#L3)
|
|
@@ -34,4 +34,4 @@ Checks if a given string field matches a given string value according to a given
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[lib/types/FilterString.ts:8](https://github.com/nevoland/quetch/blob/
|
|
37
|
+
[lib/types/FilterString.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterString.ts#L8)
|
|
@@ -34,4 +34,4 @@ Checks if a given string field has any of the provided values.
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[lib/types/FilterStringIntersect.ts:8](https://github.com/nevoland/quetch/blob/
|
|
37
|
+
[lib/types/FilterStringIntersect.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterStringIntersect.ts#L8)
|
|
@@ -50,4 +50,4 @@ Ignore casing differences if `true`.
|
|
|
50
50
|
|
|
51
51
|
## Defined in
|
|
52
52
|
|
|
53
|
-
[lib/types/FilterStringMatch.ts:9](https://github.com/nevoland/quetch/blob/
|
|
53
|
+
[lib/types/FilterStringMatch.ts:9](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/FilterStringMatch.ts#L9)
|
package/doc/type-aliases/Get.md
CHANGED
|
@@ -20,4 +20,4 @@ Returns the type of the property at the specified `P` path.
|
|
|
20
20
|
|
|
21
21
|
## Defined in
|
|
22
22
|
|
|
23
|
-
[lib/types/Get.ts:8](https://github.com/nevoland/quetch/blob/
|
|
23
|
+
[lib/types/Get.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Get.ts#L8)
|
|
@@ -16,4 +16,4 @@ Specifies how items should be grouped.
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Group.ts:4](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Group.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Group.ts#L4)
|
|
@@ -36,4 +36,4 @@ Handles an `input` query and returns an `output` promise, eventually using the `
|
|
|
36
36
|
|
|
37
37
|
## Defined in
|
|
38
38
|
|
|
39
|
-
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/
|
|
39
|
+
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Handler.ts#L6)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Immutable.ts#L1)
|
|
@@ -18,4 +18,4 @@ Injects the custom fields into the entity type.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/InjectCustomFields.ts#L8)
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
> **IntersectUnion**\<`T`\>: `T` *extends* `any` ? (`_`) => `void` : `never` *extends* (`_`) => `void` ? `U` : `never`
|
|
10
10
|
|
|
11
|
+
Converts a union type to an intersection type.
|
|
12
|
+
|
|
11
13
|
## Type Parameters
|
|
12
14
|
|
|
13
15
|
• **T**
|
|
14
16
|
|
|
15
17
|
## Defined in
|
|
16
18
|
|
|
17
|
-
[lib/types/IntersectUnion.ts:
|
|
19
|
+
[lib/types/IntersectUnion.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/IntersectUnion.ts#L4)
|
|
@@ -16,4 +16,4 @@ Filter that does not rely on query settings, and thus can be evaluated directly
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/IntrinsicFilter.ts:6](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/IntrinsicFilter.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/IntrinsicFilter.ts#L6)
|
package/doc/type-aliases/Item.md
CHANGED
|
@@ -18,4 +18,4 @@ Returns the inferred item type of an array, or an alternative type if it is some
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Item.ts#L4)
|
package/doc/type-aliases/Join.md
CHANGED
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Join.ts:1](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Join.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Join.ts#L1)
|
package/doc/type-aliases/Key.md
CHANGED
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Key.ts#L1)
|
|
@@ -18,4 +18,4 @@ Returns union of keys whose mapped value extend the provided `P` type.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/KeyFiltered.ts:10](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/KeyFiltered.ts:10](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/KeyFiltered.ts#L10)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/KeyFromUnion.ts:1](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/KeyFromUnion.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/KeyFromUnion.ts#L1)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/Locale.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/Locale.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Locale.ts#L1)
|
|
@@ -28,4 +28,4 @@ Handles an `input` query and returns an `output` promise.
|
|
|
28
28
|
|
|
29
29
|
## Defined in
|
|
30
30
|
|
|
31
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
31
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/NextHandler.ts#L4)
|
|
@@ -54,4 +54,4 @@ String used to escape the separator.
|
|
|
54
54
|
|
|
55
55
|
## Defined in
|
|
56
56
|
|
|
57
|
-
[lib/types/NormalizedPathFieldSettings.ts:6](https://github.com/nevoland/quetch/blob/
|
|
57
|
+
[lib/types/NormalizedPathFieldSettings.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/NormalizedPathFieldSettings.ts#L6)
|
|
@@ -16,4 +16,4 @@ Order item.
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Order.ts:6](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Order.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Order.ts#L6)
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
|
|
25
25
|
## Defined in
|
|
26
26
|
|
|
27
|
-
[lib/types/OrderNormalized.ts:3](https://github.com/nevoland/quetch/blob/
|
|
27
|
+
[lib/types/OrderNormalized.ts:3](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/OrderNormalized.ts#L3)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Parameters.ts#L1)
|
package/doc/type-aliases/Path.md
CHANGED
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Path.ts:6](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Path.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Path.ts#L6)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/PathFiltered.ts:5](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/PathFiltered.ts:5](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/PathFiltered.ts#L5)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[quetch](../README.md) / Prettify
|
|
6
|
+
|
|
7
|
+
# Type Alias: Prettify\<T\>
|
|
8
|
+
|
|
9
|
+
> **Prettify**\<`T`\>: `T` *extends* (...`args`) => `any` ? `T` : `T` *extends* readonly `any`[] ? `T` : `{ [K in keyof T]: Prettify<T[K]> }`
|
|
10
|
+
|
|
11
|
+
Prettifies a type by recursively removing any intersections or unions.
|
|
12
|
+
|
|
13
|
+
## Type Parameters
|
|
14
|
+
|
|
15
|
+
• **T**
|
|
16
|
+
|
|
17
|
+
## Defined in
|
|
18
|
+
|
|
19
|
+
[lib/types/Prettify.ts:4](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Prettify.ts#L4)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/Primitive.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/Primitive.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Primitive.ts#L1)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/PrimitiveObject.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/PrimitiveObject.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/PrimitiveObject.ts#L1)
|
|
@@ -16,4 +16,4 @@ Query that fetches or mutates an entity.
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Query.ts:14](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Query.ts:14](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Query.ts#L14)
|
|
@@ -68,4 +68,4 @@ Query settings.
|
|
|
68
68
|
|
|
69
69
|
## Defined in
|
|
70
70
|
|
|
71
|
-
[lib/types/QueryAggregate.ts:11](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/types/QueryAggregate.ts:11](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryAggregate.ts#L11)
|
|
@@ -50,4 +50,4 @@ Value properties of the item to create.
|
|
|
50
50
|
|
|
51
51
|
## Defined in
|
|
52
52
|
|
|
53
|
-
[lib/types/QueryCreate.ts:8](https://github.com/nevoland/quetch/blob/
|
|
53
|
+
[lib/types/QueryCreate.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryCreate.ts#L8)
|
|
@@ -48,4 +48,4 @@ Query settings.
|
|
|
48
48
|
|
|
49
49
|
## Defined in
|
|
50
50
|
|
|
51
|
-
[lib/types/QueryCreateMultiple.ts:8](https://github.com/nevoland/quetch/blob/
|
|
51
|
+
[lib/types/QueryCreateMultiple.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryCreateMultiple.ts#L8)
|
|
@@ -60,4 +60,4 @@ Query settings.
|
|
|
60
60
|
|
|
61
61
|
## Defined in
|
|
62
62
|
|
|
63
|
-
[lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/
|
|
63
|
+
[lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryDelete.ts#L9)
|
|
@@ -62,4 +62,4 @@ Query settings.
|
|
|
62
62
|
|
|
63
63
|
## Defined in
|
|
64
64
|
|
|
65
|
-
[lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/
|
|
65
|
+
[lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryDeleteMultiple.ts#L9)
|
|
@@ -12,4 +12,4 @@ Available query methods.
|
|
|
12
12
|
|
|
13
13
|
## Defined in
|
|
14
14
|
|
|
15
|
-
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/
|
|
15
|
+
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryMethod.ts#L6)
|
|
@@ -24,7 +24,7 @@ Common item properties to use for identifying the context in which to get the it
|
|
|
24
24
|
|
|
25
25
|
### fields?
|
|
26
26
|
|
|
27
|
-
> `optional` **fields**: readonly
|
|
27
|
+
> `optional` **fields**: readonly [`Field`](Field.md)\<`T`\>[]
|
|
28
28
|
|
|
29
29
|
Item fields to pick. If omitted, all fields are picked.
|
|
30
30
|
|
|
@@ -76,4 +76,4 @@ Query settings.
|
|
|
76
76
|
|
|
77
77
|
## Defined in
|
|
78
78
|
|
|
79
|
-
[lib/types/QueryRead.ts:
|
|
79
|
+
[lib/types/QueryRead.ts:11](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryRead.ts#L11)
|
|
@@ -24,7 +24,7 @@ Common item properties to use for identifying the item.
|
|
|
24
24
|
|
|
25
25
|
### fields?
|
|
26
26
|
|
|
27
|
-
> `optional` **fields**: readonly
|
|
27
|
+
> `optional` **fields**: readonly [`Field`](Field.md)\<`T`\>[]
|
|
28
28
|
|
|
29
29
|
Item fields to pick. If omitted, all fields are picked.
|
|
30
30
|
|
|
@@ -80,4 +80,4 @@ Query settings.
|
|
|
80
80
|
|
|
81
81
|
## Defined in
|
|
82
82
|
|
|
83
|
-
[lib/types/QueryReadMultiple.ts:
|
|
83
|
+
[lib/types/QueryReadMultiple.ts:12](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryReadMultiple.ts#L12)
|
|
@@ -86,4 +86,4 @@ The second value to compare.
|
|
|
86
86
|
|
|
87
87
|
## Defined in
|
|
88
88
|
|
|
89
|
-
[lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/
|
|
89
|
+
[lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QuerySettings.ts#L8)
|
|
@@ -68,4 +68,4 @@ Partial property values to update.
|
|
|
68
68
|
|
|
69
69
|
## Defined in
|
|
70
70
|
|
|
71
|
-
[lib/types/QueryUpdate.ts:9](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/types/QueryUpdate.ts:9](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryUpdate.ts#L9)
|
|
@@ -74,4 +74,4 @@ Partial property values to update.
|
|
|
74
74
|
|
|
75
75
|
## Defined in
|
|
76
76
|
|
|
77
|
-
[lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/
|
|
77
|
+
[lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/QueryUpdateMultiple.ts#L10)
|
|
@@ -6,7 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Type Alias: Result\<T, Q\>
|
|
8
8
|
|
|
9
|
-
> **Result**\<`T`, `Q`\>: [`Q`] *extends* [
|
|
9
|
+
> **Result**\<`T`, `Q`\>: [`Q`] *extends* [[`QueryReadMultiple`](QueryReadMultiple.md)\<`T`\>] ? readonly `ResultRead`\<`T`, `Q`\>[] : [`Q`] *extends* [[`QueryRead`](QueryRead.md)\<`T`\>] ? `ResultRead`\<`T`, `Q`\> : [`Q`] *extends* [`object`] ? `number` : `never`
|
|
10
|
+
|
|
11
|
+
Result of a read and aggregate query.
|
|
10
12
|
|
|
11
13
|
## Type Parameters
|
|
12
14
|
|
|
@@ -16,4 +18,4 @@
|
|
|
16
18
|
|
|
17
19
|
## Defined in
|
|
18
20
|
|
|
19
|
-
[lib/types/Result.ts:
|
|
21
|
+
[lib/types/Result.ts:64](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Result.ts#L64)
|
|
@@ -68,4 +68,4 @@
|
|
|
68
68
|
|
|
69
69
|
## Defined in
|
|
70
70
|
|
|
71
|
-
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Store.ts#L2)
|
|
@@ -36,4 +36,4 @@ Path leading to the value.
|
|
|
36
36
|
|
|
37
37
|
## Defined in
|
|
38
38
|
|
|
39
|
-
[lib/types/Value.ts:6](https://github.com/nevoland/quetch/blob/
|
|
39
|
+
[lib/types/Value.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/Value.ts#L6)
|
|
@@ -18,4 +18,4 @@ Maps the properties of the provided value `T` to a specific value `V`.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/ValueMap.ts:6](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/ValueMap.ts:6](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/types/ValueMap.ts#L6)
|
package/doc/variables/CACHE.md
CHANGED
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/constants/CACHE.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/constants/CACHE.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/constants/CACHE.ts#L1)
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/constants/FILTER\_ANY.ts:1](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/constants/FILTER\_ANY.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/constants/FILTER_ANY.ts#L1)
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/constants/FILTER\_NONE.ts:1](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/constants/FILTER\_NONE.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/constants/FILTER_NONE.ts#L1)
|
package/doc/variables/SELF.md
CHANGED
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/constants/SELF.ts:1](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/constants/SELF.ts:1](https://github.com/nevoland/quetch/blob/556422ecfdc4dbcfabe378d17bda6757f5dee8c3/lib/constants/SELF.ts#L1)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Field } from "../types";
|
|
2
|
+
|
|
3
|
+
import { sameField } from "./sameField.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the union of two lists of fields, removing any duplicates.
|
|
7
|
+
*
|
|
8
|
+
* @param a - The first list of fields.
|
|
9
|
+
* @param b - The second list of fields.
|
|
10
|
+
* @returns The union of the two lists of fields, with duplicates removed.
|
|
11
|
+
*/
|
|
12
|
+
export function fieldListUnion<T>(
|
|
13
|
+
a: readonly Field<T>[] | undefined,
|
|
14
|
+
b: readonly Field<T>[] | undefined,
|
|
15
|
+
) {
|
|
16
|
+
if (a === undefined) {
|
|
17
|
+
return b;
|
|
18
|
+
}
|
|
19
|
+
if (b === undefined) {
|
|
20
|
+
return a;
|
|
21
|
+
}
|
|
22
|
+
return [
|
|
23
|
+
...a.filter((fieldA) => !b.some((fieldB) => sameField(fieldA, fieldB))),
|
|
24
|
+
...b,
|
|
25
|
+
];
|
|
26
|
+
}
|
package/lib/tools.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { defineCustomFetch } from "./tools/defineCustomFetch.js";
|
|
|
6
6
|
export { defineGenericFetch } from "./tools/defineGenericFetch.js";
|
|
7
7
|
export { escapeRegex } from "./tools/escapeRegex.js";
|
|
8
8
|
export { fieldListFromFilter } from "./tools/fieldListFromFilter.js";
|
|
9
|
+
export { fieldListUnion } from "./tools/fieldListUnion.js";
|
|
9
10
|
export { filterChildren } from "./tools/filterChildren.js";
|
|
10
11
|
export { filterFromValue } from "./tools/filterFromValue.js";
|
|
11
12
|
export { get } from "./tools/get.js";
|
package/lib/types/QueryRead.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Context } from "./Context";
|
|
2
|
+
import type { Field } from "./Field";
|
|
2
3
|
import type { Filter } from "./Filter";
|
|
3
4
|
import type { Order } from "./Order";
|
|
4
5
|
import type { Parameters } from "./Parameters";
|
|
@@ -23,7 +24,7 @@ export type QueryRead<T> = {
|
|
|
23
24
|
/**
|
|
24
25
|
* Item fields to pick. If omitted, all fields are picked.
|
|
25
26
|
*/
|
|
26
|
-
fields?: readonly
|
|
27
|
+
fields?: readonly Field<T>[];
|
|
27
28
|
/**
|
|
28
29
|
* Filter for finding the item, if it cannot be found based on the `context`.
|
|
29
30
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Context } from "./Context";
|
|
2
|
+
import type { Field } from "./Field";
|
|
2
3
|
import type { Filter } from "./Filter";
|
|
3
4
|
import type { Group } from "./Group";
|
|
4
5
|
import type { Order } from "./Order";
|
|
@@ -26,7 +27,7 @@ export type QueryReadMultiple<T> = {
|
|
|
26
27
|
/**
|
|
27
28
|
* Item fields to pick. If omitted, all fields are picked.
|
|
28
29
|
*/
|
|
29
|
-
fields?: readonly
|
|
30
|
+
fields?: readonly Field<T>[];
|
|
30
31
|
/**
|
|
31
32
|
* Filter for finding the items.
|
|
32
33
|
*/
|