quetch 0.19.3 → 0.19.4
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/middlewares/aggregate.js +2 -1
- package/dist/middlewares/aggregate.js.map +1 -1
- package/dist/tools/filterFromContext.js +17 -2
- package/dist/tools/filterFromContext.js.map +1 -1
- package/dist/types/Context.d.ts +5 -1
- package/dist/types/Field.d.ts +3 -1
- 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/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/filterChildren.md +1 -1
- package/doc/functions/filterFromContext.md +1 -1
- package/doc/functions/get.md +1 -1
- package/doc/functions/identity.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/retry.md +1 -1
- package/doc/functions/reverseOrder.md +1 -1
- package/doc/functions/sortItemList.md +1 -1
- package/doc/functions/testFilter.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 +2 -2
- package/doc/type-aliases/CustomFieldAggregateMap.md +1 -1
- package/doc/type-aliases/CustomFieldMap.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/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/Increment.md +1 -1
- package/doc/type-aliases/InjectCustomFields.md +1 -1
- package/doc/type-aliases/IntersectUnion.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/Order.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/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 +1 -1
- package/doc/type-aliases/QueryReadMultiple.md +1 -1
- 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 +1 -1
- package/doc/type-aliases/Store.md +1 -1
- package/doc/type-aliases/Value.md +1 -1
- package/doc/variables/CACHE.md +1 -1
- package/doc/variables/SELF.md +1 -1
- package/lib/middlewares/aggregate.ts +2 -1
- package/lib/tools/filterFromContext.test.ts +12 -0
- package/lib/tools/filterFromContext.ts +21 -3
- package/lib/tools/get.test.ts +2 -0
- package/lib/tools/queryItemList.test.ts +37 -0
- package/lib/types/Context.ts +11 -3
- package/lib/types/Field.ts +4 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sleep } from "futurise";
|
|
2
|
+
import { EMPTY_OBJECT } from "unchangeable";
|
|
2
3
|
import { RequestError } from "../errors.js";
|
|
3
4
|
/**
|
|
4
5
|
* Aggregates multiple incoming query calls into one query.
|
|
@@ -18,7 +19,7 @@ export function aggregate({ queryGroupId = ({ type, method = "get" }) => {
|
|
|
18
19
|
return undefined;
|
|
19
20
|
}
|
|
20
21
|
return type;
|
|
21
|
-
}, queryId = ({ context =
|
|
22
|
+
}, queryId = ({ context = EMPTY_OBJECT }) => {
|
|
22
23
|
if (context.id === undefined) {
|
|
23
24
|
return undefined;
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../lib/middlewares/aggregate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../../lib/middlewares/aggregate.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EMPTY_ARRAY } from "unchangeable";
|
|
2
|
+
import { SELF } from "../constants/SELF.js";
|
|
2
3
|
const { entries } = Object;
|
|
3
4
|
export function filterFromContext(context) {
|
|
4
5
|
return {
|
|
@@ -7,13 +8,20 @@ export function filterFromContext(context) {
|
|
|
7
8
|
};
|
|
8
9
|
}
|
|
9
10
|
function criteria(context, path = EMPTY_ARRAY) {
|
|
10
|
-
return
|
|
11
|
+
return entriesAndSelf(context).flatMap(([field, value]) => {
|
|
11
12
|
switch (typeof value) {
|
|
13
|
+
case "symbol":
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
field: SELF,
|
|
17
|
+
operator: "equal",
|
|
18
|
+
value,
|
|
19
|
+
},
|
|
20
|
+
];
|
|
12
21
|
case "bigint":
|
|
13
22
|
case "string":
|
|
14
23
|
case "number":
|
|
15
24
|
case "boolean":
|
|
16
|
-
case "symbol":
|
|
17
25
|
case "undefined":
|
|
18
26
|
return [
|
|
19
27
|
{
|
|
@@ -40,4 +48,11 @@ function criteria(context, path = EMPTY_ARRAY) {
|
|
|
40
48
|
}
|
|
41
49
|
});
|
|
42
50
|
}
|
|
51
|
+
function entriesAndSelf(context) {
|
|
52
|
+
const result = entries(context);
|
|
53
|
+
if (SELF in context) {
|
|
54
|
+
result.push([SELF, context[SELF]]);
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
43
58
|
//# sourceMappingURL=filterFromContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterFromContext.js","sourceRoot":"","sources":["../../lib/tools/filterFromContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"filterFromContext.js","sourceRoot":"","sources":["../../lib/tools/filterFromContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;AAE3B,MAAM,UAAU,iBAAiB,CAAI,OAAmB;IACtD,OAAO;QACL,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC;KACzB,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CACf,OAAe,EACf,OAA0B,WAAW;IAErC,OAAO,cAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,EAAE;QACxD,QAAQ,OAAO,KAAK,EAAE,CAAC;YACrB,KAAK,QAAQ;gBACX,OAAO;oBACL;wBACE,KAAK,EAAE,IAAI;wBACX,QAAQ,EAAE,OAAO;wBACjB,KAAK;qBACC;iBACT,CAAC;YACJ,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,WAAW;gBACd,OAAO;oBACL;wBACE,KAAK,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC;wBACnD,QAAQ,EAAE,OAAO;wBACjB,KAAK;qBACO;iBACf,CAAC;YACJ,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;oBAClB,OAAO;wBACL;4BACE,KAAK,EAAE,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC;4BACnD,QAAQ,EAAE,OAAO;4BACjB,KAAK;yBACO;qBACf,CAAC;gBACJ,CAAC;gBACD,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,KAAe,CAAC,CAAC,CAAC;YACrD,CAAC;YACD;gBACE,OAAO,WAAW,CAAC;YACrB,SAAS;QACX,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CACrB,OAAe;IAEf,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAkC,CAAC;IACjE,IAAI,IAAI,IAAI,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/types/Context.d.ts
CHANGED
package/dist/types/Field.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { SELF } from "../constants/SELF.js";
|
|
1
2
|
import type { CombineUnion } from "./CombineUnion";
|
|
2
3
|
import type { Path } from "./Path";
|
|
4
|
+
import type { Primitive } from "./Primitive";
|
|
3
5
|
export type Field<T> = KeyOrPath<CombineUnion<T>>;
|
|
4
|
-
type KeyOrPath<T> = keyof T | Path<T>;
|
|
6
|
+
type KeyOrPath<T> = (T extends Primitive ? typeof SELF : keyof T) | Path<T>;
|
|
5
7
|
export {};
|
|
@@ -50,7 +50,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
50
50
|
|
|
51
51
|
#### Defined in
|
|
52
52
|
|
|
53
|
-
[lib/errors/RequestError.ts:7](https://github.com/nevoland/quetch/blob/
|
|
53
|
+
[lib/errors/RequestError.ts:7](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/errors/RequestError.ts#L7)
|
|
54
54
|
|
|
55
55
|
## Properties
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
60
60
|
|
|
61
61
|
#### Defined in
|
|
62
62
|
|
|
63
|
-
[lib/errors/RequestError.ts:10](https://github.com/nevoland/quetch/blob/
|
|
63
|
+
[lib/errors/RequestError.ts:10](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/errors/RequestError.ts#L10)
|
|
64
64
|
|
|
65
65
|
***
|
|
66
66
|
|
|
@@ -70,7 +70,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
70
70
|
|
|
71
71
|
#### Defined in
|
|
72
72
|
|
|
73
|
-
[lib/errors/RequestError.ts:11](https://github.com/nevoland/quetch/blob/
|
|
73
|
+
[lib/errors/RequestError.ts:11](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/errors/RequestError.ts#L11)
|
|
74
74
|
|
|
75
75
|
***
|
|
76
76
|
|
|
@@ -80,7 +80,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
80
80
|
|
|
81
81
|
#### Defined in
|
|
82
82
|
|
|
83
|
-
[lib/errors/RequestError.ts:12](https://github.com/nevoland/quetch/blob/
|
|
83
|
+
[lib/errors/RequestError.ts:12](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/errors/RequestError.ts#L12)
|
|
84
84
|
|
|
85
85
|
***
|
|
86
86
|
|
|
@@ -90,4 +90,4 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
90
90
|
|
|
91
91
|
#### Defined in
|
|
92
92
|
|
|
93
|
-
[lib/errors/RequestError.ts:9](https://github.com/nevoland/quetch/blob/
|
|
93
|
+
[lib/errors/RequestError.ts:9](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/errors/RequestError.ts#L9)
|
|
@@ -58,4 +58,4 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
58
58
|
|
|
59
59
|
## Defined in
|
|
60
60
|
|
|
61
|
-
[lib/middlewares/aggregate.ts:
|
|
61
|
+
[lib/middlewares/aggregate.ts:17](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/aggregate.ts#L17)
|
package/doc/functions/branch.md
CHANGED
|
@@ -49,4 +49,4 @@ const customFetch = combine(
|
|
|
49
49
|
|
|
50
50
|
## Defined in
|
|
51
51
|
|
|
52
|
-
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/
|
|
52
|
+
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/branch.ts#L21)
|
package/doc/functions/cache.md
CHANGED
|
@@ -68,4 +68,4 @@ Cache store.
|
|
|
68
68
|
|
|
69
69
|
## Defined in
|
|
70
70
|
|
|
71
|
-
[lib/middlewares/cache.ts:8](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/middlewares/cache.ts:8](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/cache.ts#L8)
|
package/doc/functions/combine.md
CHANGED
|
@@ -116,4 +116,4 @@ Handler that combines all provided handlers.
|
|
|
116
116
|
|
|
117
117
|
## Defined in
|
|
118
118
|
|
|
119
|
-
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/
|
|
119
|
+
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/combine.ts#L801)
|
package/doc/functions/cork.md
CHANGED
|
@@ -22,4 +22,4 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
|
|
|
22
22
|
|
|
23
23
|
## Defined in
|
|
24
24
|
|
|
25
|
-
[lib/tools/cork.ts:6](https://github.com/nevoland/quetch/blob/
|
|
25
|
+
[lib/tools/cork.ts:6](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/cork.ts#L6)
|
|
@@ -56,4 +56,4 @@ Function that checks queries.
|
|
|
56
56
|
|
|
57
57
|
## Defined in
|
|
58
58
|
|
|
59
|
-
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/
|
|
59
|
+
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/defineCheckQuery.ts#L8)
|
|
@@ -68,4 +68,4 @@ A custom fetch function.
|
|
|
68
68
|
|
|
69
69
|
## Defined in
|
|
70
70
|
|
|
71
|
-
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/defineCustomFetch.ts#L11)
|
|
@@ -55,4 +55,4 @@ A curried generic fetch function.
|
|
|
55
55
|
|
|
56
56
|
## Defined in
|
|
57
57
|
|
|
58
|
-
[lib/tools/defineGenericFetch.ts:14](https://github.com/nevoland/quetch/blob/
|
|
58
|
+
[lib/tools/defineGenericFetch.ts:14](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/defineGenericFetch.ts#L14)
|
|
@@ -26,4 +26,4 @@ Escaped regular expression
|
|
|
26
26
|
|
|
27
27
|
## Defined in
|
|
28
28
|
|
|
29
|
-
[lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/
|
|
29
|
+
[lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/escapeRegex.ts#L7)
|
|
@@ -26,4 +26,4 @@ Handler that returns a promise that resolves to the response.
|
|
|
26
26
|
|
|
27
27
|
## Defined in
|
|
28
28
|
|
|
29
|
-
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/
|
|
29
|
+
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/fetchExternal.ts#L12)
|
|
@@ -22,4 +22,4 @@ Promise that resolves to the response.
|
|
|
22
22
|
|
|
23
23
|
## Defined in
|
|
24
24
|
|
|
25
|
-
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/
|
|
25
|
+
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/fetchLocal.ts#L9)
|
|
@@ -30,4 +30,4 @@ A list of fields.
|
|
|
30
30
|
|
|
31
31
|
## Defined in
|
|
32
32
|
|
|
33
|
-
[lib/tools/fieldListFromFilter.ts:11](https://github.com/nevoland/quetch/blob/
|
|
33
|
+
[lib/tools/fieldListFromFilter.ts:11](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/fieldListFromFilter.ts#L11)
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
|
|
37
37
|
## Defined in
|
|
38
38
|
|
|
39
|
-
[lib/tools/filterChildren.ts:5](https://github.com/nevoland/quetch/blob/
|
|
39
|
+
[lib/tools/filterChildren.ts:5](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/filterChildren.ts#L5)
|
|
@@ -24,4 +24,4 @@
|
|
|
24
24
|
|
|
25
25
|
## Defined in
|
|
26
26
|
|
|
27
|
-
[lib/tools/filterFromContext.ts:
|
|
27
|
+
[lib/tools/filterFromContext.ts:8](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/filterFromContext.ts#L8)
|
package/doc/functions/get.md
CHANGED
|
@@ -41,4 +41,4 @@ The property value found at the given path, or `undefined` if it cannot be found
|
|
|
41
41
|
|
|
42
42
|
## Defined in
|
|
43
43
|
|
|
44
|
-
[lib/tools/get.ts:14](https://github.com/nevoland/quetch/blob/
|
|
44
|
+
[lib/tools/get.ts:14](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/get.ts#L14)
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/
|
|
37
|
+
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/identity.ts#L3)
|
|
@@ -28,4 +28,4 @@ Whether the provided filter is a group filter or not.
|
|
|
28
28
|
|
|
29
29
|
## Defined in
|
|
30
30
|
|
|
31
|
-
[lib/tools/isFilterGroup.ts:9](https://github.com/nevoland/quetch/blob/
|
|
31
|
+
[lib/tools/isFilterGroup.ts:9](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/isFilterGroup.ts#L9)
|
package/doc/functions/log.md
CHANGED
|
@@ -34,4 +34,4 @@ Query handler
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[lib/middlewares/log.ts:13](https://github.com/nevoland/quetch/blob/
|
|
37
|
+
[lib/middlewares/log.ts:13](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/log.ts#L13)
|
|
@@ -38,4 +38,4 @@ The normalized order object.
|
|
|
38
38
|
|
|
39
39
|
## Defined in
|
|
40
40
|
|
|
41
|
-
[lib/tools/normalizeOrder.ts:11](https://github.com/nevoland/quetch/blob/
|
|
41
|
+
[lib/tools/normalizeOrder.ts:11](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/normalizeOrder.ts#L11)
|
|
@@ -32,4 +32,4 @@ The result of the query.
|
|
|
32
32
|
|
|
33
33
|
## Defined in
|
|
34
34
|
|
|
35
|
-
[lib/tools/queryItemList.ts:48](https://github.com/nevoland/quetch/blob/
|
|
35
|
+
[lib/tools/queryItemList.ts:48](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/queryItemList.ts#L48)
|
package/doc/functions/retry.md
CHANGED
|
@@ -36,4 +36,4 @@ Handler
|
|
|
36
36
|
|
|
37
37
|
## Defined in
|
|
38
38
|
|
|
39
|
-
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/
|
|
39
|
+
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/middlewares/retry.ts#L15)
|
|
@@ -38,4 +38,4 @@ The reversed order.
|
|
|
38
38
|
|
|
39
39
|
## Defined in
|
|
40
40
|
|
|
41
|
-
[lib/tools/reverseOrder.ts:11](https://github.com/nevoland/quetch/blob/
|
|
41
|
+
[lib/tools/reverseOrder.ts:11](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/reverseOrder.ts#L11)
|
|
@@ -34,4 +34,4 @@ A new sorted array.
|
|
|
34
34
|
|
|
35
35
|
## Defined in
|
|
36
36
|
|
|
37
|
-
[lib/tools/sortItemList.ts:13](https://github.com/nevoland/quetch/blob/
|
|
37
|
+
[lib/tools/sortItemList.ts:13](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/sortItemList.ts#L13)
|
|
@@ -38,4 +38,4 @@ Optional query settings.
|
|
|
38
38
|
|
|
39
39
|
## Defined in
|
|
40
40
|
|
|
41
|
-
[lib/tools/testFilter.ts:26](https://github.com/nevoland/quetch/blob/
|
|
41
|
+
[lib/tools/testFilter.ts:26](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/tools/testFilter.ts#L26)
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
|
|
29
29
|
## Defined in
|
|
30
30
|
|
|
31
|
-
[lib/types/CustomFetch.ts:5](https://github.com/nevoland/quetch/blob/
|
|
31
|
+
[lib/types/CustomFetch.ts:5](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/CustomFetch.ts#L5)
|
|
@@ -16,4 +16,4 @@ Aggregation function.
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/AggregateFunction.ts:7](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/AggregateFunction.ts:7](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/AggregateFunction.ts#L7)
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
|
|
11
11
|
## Defined in
|
|
12
12
|
|
|
13
|
-
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
13
|
+
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/AggregateFunctionOperator.ts#L3)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/CombineUnion.ts:4](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/CombineUnion.ts:4](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/CombineUnion.ts#L4)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Type Alias: Context\<T\>
|
|
8
8
|
|
|
9
|
-
> **Context**\<`T`\>: `{ [K in keyof T]?: T[K] }`
|
|
9
|
+
> **Context**\<`T`\>: [`0`] *extends* [`1` & `T`] ? `any` : `T` *extends* [`Primitive`](Primitive.md) ? `object` : `{ [K in keyof T]?: T[K] }`
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/Context.ts:
|
|
17
|
+
[lib/types/Context.ts:5](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Context.ts#L5)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/CustomFieldAggregateMap.ts#L3)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/CustomFieldMap.ts#L3)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/Field.ts:
|
|
17
|
+
[lib/types/Field.ts:7](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Field.ts#L7)
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/FieldFiltered.ts:5](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/FieldFiltered.ts:5](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FieldFiltered.ts#L5)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FieldFunction.ts#L4)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FieldFunctionReturn.ts#L4)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FilterBoolean.ts#L7)
|
|
@@ -35,4 +35,4 @@ If `deep` is `true`, also captures all the descendants.
|
|
|
35
35
|
|
|
36
36
|
## Defined in
|
|
37
37
|
|
|
38
|
-
[lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/
|
|
38
|
+
[lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FilterChildren.ts#L10)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FilterField.ts#L6)
|
|
@@ -46,4 +46,4 @@ Filters to join.
|
|
|
46
46
|
|
|
47
47
|
## Defined in
|
|
48
48
|
|
|
49
|
-
[lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/
|
|
49
|
+
[lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/FilterStringMatch.ts#L9)
|
package/doc/type-aliases/Get.md
CHANGED
|
@@ -18,4 +18,4 @@ Returns the type of the property at the specified `P` path.
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/Get.ts:6](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/Get.ts:6](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Get.ts#L6)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Immutable.ts#L1)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/Increment.ts:5](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/Increment.ts:5](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Increment.ts#L5)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/InjectCustomFields.ts#L8)
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
|
|
15
15
|
## Defined in
|
|
16
16
|
|
|
17
|
-
[lib/types/IntersectUnion.ts:1](https://github.com/nevoland/quetch/blob/
|
|
17
|
+
[lib/types/IntersectUnion.ts:1](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/IntersectUnion.ts#L1)
|
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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/NextHandler.ts#L4)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Order.ts#L6)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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:5](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Path.ts:5](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Path.ts#L5)
|
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|
|
19
19
|
## Defined in
|
|
20
20
|
|
|
21
|
-
[lib/types/PathFiltered.ts:4](https://github.com/nevoland/quetch/blob/
|
|
21
|
+
[lib/types/PathFiltered.ts:4](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/PathFiltered.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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryCreateMultiple.ts#L8)
|
|
@@ -48,4 +48,4 @@ Query settings.
|
|
|
48
48
|
|
|
49
49
|
## Defined in
|
|
50
50
|
|
|
51
|
-
[lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/
|
|
51
|
+
[lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryDelete.ts#L9)
|
|
@@ -48,4 +48,4 @@ Query settings.
|
|
|
48
48
|
|
|
49
49
|
## Defined in
|
|
50
50
|
|
|
51
|
-
[lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/
|
|
51
|
+
[lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryMethod.ts#L6)
|
|
@@ -76,4 +76,4 @@ Query settings.
|
|
|
76
76
|
|
|
77
77
|
## Defined in
|
|
78
78
|
|
|
79
|
-
[lib/types/QueryRead.ts:10](https://github.com/nevoland/quetch/blob/
|
|
79
|
+
[lib/types/QueryRead.ts:10](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryRead.ts#L10)
|
|
@@ -80,4 +80,4 @@ Query settings.
|
|
|
80
80
|
|
|
81
81
|
## Defined in
|
|
82
82
|
|
|
83
|
-
[lib/types/QueryReadMultiple.ts:11](https://github.com/nevoland/quetch/blob/
|
|
83
|
+
[lib/types/QueryReadMultiple.ts:11](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryReadMultiple.ts#L11)
|
|
@@ -62,4 +62,4 @@ A filter that captures the items expressed by the provided `FilterChildren`.
|
|
|
62
62
|
|
|
63
63
|
## Defined in
|
|
64
64
|
|
|
65
|
-
[lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/
|
|
65
|
+
[lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryUpdate.ts#L9)
|
|
@@ -72,4 +72,4 @@ Partial property values to update.
|
|
|
72
72
|
|
|
73
73
|
## Defined in
|
|
74
74
|
|
|
75
|
-
[lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/
|
|
75
|
+
[lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/QueryUpdateMultiple.ts#L10)
|
|
@@ -16,4 +16,4 @@
|
|
|
16
16
|
|
|
17
17
|
## Defined in
|
|
18
18
|
|
|
19
|
-
[lib/types/Result.ts:20](https://github.com/nevoland/quetch/blob/
|
|
19
|
+
[lib/types/Result.ts:20](https://github.com/nevoland/quetch/blob/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Result.ts#L20)
|
|
@@ -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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/types/Value.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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/constants/CACHE.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/6249acbaaaaaeed54f7d39c2e784b6176249eef9/lib/constants/SELF.ts#L1)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sleep } from "futurise";
|
|
2
|
+
import { EMPTY_OBJECT } from "unchangeable";
|
|
2
3
|
|
|
3
4
|
import { RequestError } from "../errors.js";
|
|
4
5
|
import type { Handler, Query } from "../types";
|
|
@@ -28,7 +29,7 @@ export function aggregate<
|
|
|
28
29
|
}
|
|
29
30
|
return type;
|
|
30
31
|
},
|
|
31
|
-
queryId = ({ context =
|
|
32
|
+
queryId = ({ context = EMPTY_OBJECT }) => {
|
|
32
33
|
if (context.id === undefined) {
|
|
33
34
|
return undefined;
|
|
34
35
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { expect, test } from "vitest";
|
|
2
2
|
|
|
3
|
+
import { SELF } from "../constants.js";
|
|
4
|
+
|
|
3
5
|
import { filterFromContext } from "./filterFromContext.js";
|
|
4
6
|
|
|
5
7
|
test("returns filter from context", () => {
|
|
@@ -43,6 +45,16 @@ test("returns filter from context", () => {
|
|
|
43
45
|
},
|
|
44
46
|
],
|
|
45
47
|
});
|
|
48
|
+
expect(filterFromContext({ [SELF]: 3 })).toEqual({
|
|
49
|
+
operator: "all",
|
|
50
|
+
value: [
|
|
51
|
+
{
|
|
52
|
+
field: SELF,
|
|
53
|
+
operator: "equal",
|
|
54
|
+
value: 3,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
});
|
|
46
58
|
expect(filterFromContext({ a: null })).toEqual({
|
|
47
59
|
operator: "all",
|
|
48
60
|
value: [
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EMPTY_ARRAY } from "unchangeable";
|
|
2
2
|
|
|
3
|
+
import { SELF } from "../constants/SELF.js";
|
|
3
4
|
import type { Context, Filter } from "../types";
|
|
4
5
|
|
|
5
6
|
const { entries } = Object;
|
|
@@ -15,13 +16,20 @@ function criteria<T>(
|
|
|
15
16
|
context: object,
|
|
16
17
|
path: readonly string[] = EMPTY_ARRAY,
|
|
17
18
|
): readonly Filter<T>[] {
|
|
18
|
-
return
|
|
19
|
+
return entriesAndSelf(context).flatMap(([field, value]) => {
|
|
19
20
|
switch (typeof value) {
|
|
21
|
+
case "symbol":
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
field: SELF,
|
|
25
|
+
operator: "equal",
|
|
26
|
+
value,
|
|
27
|
+
} as any,
|
|
28
|
+
];
|
|
20
29
|
case "bigint":
|
|
21
30
|
case "string":
|
|
22
31
|
case "number":
|
|
23
32
|
case "boolean":
|
|
24
|
-
case "symbol":
|
|
25
33
|
case "undefined":
|
|
26
34
|
return [
|
|
27
35
|
{
|
|
@@ -40,7 +48,7 @@ function criteria<T>(
|
|
|
40
48
|
} as Filter<T>,
|
|
41
49
|
];
|
|
42
50
|
}
|
|
43
|
-
return criteria(value, [...path, field]);
|
|
51
|
+
return criteria(value, [...path, field as string]);
|
|
44
52
|
}
|
|
45
53
|
default:
|
|
46
54
|
return EMPTY_ARRAY;
|
|
@@ -48,3 +56,13 @@ function criteria<T>(
|
|
|
48
56
|
}
|
|
49
57
|
});
|
|
50
58
|
}
|
|
59
|
+
|
|
60
|
+
function entriesAndSelf(
|
|
61
|
+
context: object,
|
|
62
|
+
): readonly [string | typeof SELF, any][] {
|
|
63
|
+
const result = entries(context) as [string | typeof SELF, any][];
|
|
64
|
+
if (SELF in context) {
|
|
65
|
+
result.push([SELF, context[SELF]]);
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
package/lib/tools/get.test.ts
CHANGED
|
@@ -10,6 +10,8 @@ test("gets properties", () => {
|
|
|
10
10
|
const result1 = get(value, ["a", "c"]);
|
|
11
11
|
expect(result1).toBe(value.a.c);
|
|
12
12
|
|
|
13
|
+
// Error on the last two path items is expected, as it does not iterate beyond 3 levels deep
|
|
14
|
+
// @ts-ignore
|
|
13
15
|
const result2 = get(value, ["a", "d", "e", 2, "f"]);
|
|
14
16
|
expect(result2).toBe(value.a.d.e[2].f);
|
|
15
17
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { expect, test } from "vitest";
|
|
2
2
|
|
|
3
|
+
import { SELF } from "../constants.js";
|
|
4
|
+
|
|
3
5
|
import { queryItemList } from "./queryItemList.js";
|
|
4
6
|
|
|
5
7
|
test("queries a single item", () => {
|
|
@@ -38,6 +40,41 @@ test("queries a single item", () => {
|
|
|
38
40
|
).toThrow("Not found");
|
|
39
41
|
});
|
|
40
42
|
|
|
43
|
+
test("queries primitive objects", () => {
|
|
44
|
+
expect(
|
|
45
|
+
queryItemList({
|
|
46
|
+
type: [3, 2, 4, 9, 1, 2],
|
|
47
|
+
}),
|
|
48
|
+
).toEqual(3);
|
|
49
|
+
expect(
|
|
50
|
+
queryItemList({
|
|
51
|
+
type: [3, 2, 4, 9, 1, 2],
|
|
52
|
+
context: {
|
|
53
|
+
[SELF]: 9,
|
|
54
|
+
},
|
|
55
|
+
}),
|
|
56
|
+
).toEqual(9);
|
|
57
|
+
expect(
|
|
58
|
+
queryItemList({
|
|
59
|
+
type: [3, 2, 4, 9, 1, 2],
|
|
60
|
+
multiple: true,
|
|
61
|
+
order: [SELF],
|
|
62
|
+
}),
|
|
63
|
+
).toEqual([1, 2, 2, 3, 4, 9]);
|
|
64
|
+
expect(
|
|
65
|
+
queryItemList({
|
|
66
|
+
type: [3, 2, 4, 9, 1, 2],
|
|
67
|
+
multiple: true,
|
|
68
|
+
order: [SELF],
|
|
69
|
+
filter: {
|
|
70
|
+
field: SELF,
|
|
71
|
+
operator: "greaterThan",
|
|
72
|
+
value: 3,
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
).toEqual([4, 9]);
|
|
76
|
+
});
|
|
77
|
+
|
|
41
78
|
test("queries lists of items", () => {
|
|
42
79
|
expect(
|
|
43
80
|
queryItemList({
|
package/lib/types/Context.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
1
|
+
import type { SELF } from "../constants/SELF.js";
|
|
2
|
+
|
|
3
|
+
import type { Primitive } from "./Primitive.js";
|
|
4
|
+
|
|
5
|
+
export type Context<T> = [0] extends [1 & T]
|
|
6
|
+
? any
|
|
7
|
+
: T extends Primitive
|
|
8
|
+
? { [SELF]: T }
|
|
9
|
+
: {
|
|
10
|
+
[K in keyof T]?: T[K];
|
|
11
|
+
};
|
package/lib/types/Field.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import type { SELF } from "../constants/SELF.js";
|
|
2
|
+
|
|
1
3
|
import type { CombineUnion } from "./CombineUnion";
|
|
2
4
|
import type { Path } from "./Path";
|
|
5
|
+
import type { Primitive } from "./Primitive";
|
|
3
6
|
|
|
4
7
|
export type Field<T> = KeyOrPath<CombineUnion<T>>;
|
|
5
8
|
|
|
6
|
-
type KeyOrPath<T> = keyof T | Path<T>;
|
|
9
|
+
type KeyOrPath<T> = (T extends Primitive ? typeof SELF : keyof T) | Path<T>;
|