quetch 0.19.1 → 0.19.3
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/main.d.ts +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -1
- package/dist/types/CombineUnion.d.ts +2 -1
- package/dist/types/KeyFiltered.d.ts +1 -3
- package/dist/types/Path.d.ts +1 -1
- package/dist/types/PathFiltered.d.ts +1 -1
- package/dist/types/Primitive.d.ts +1 -1
- package/dist/types/PrimitiveObject.d.ts +1 -0
- package/dist/types/PrimitiveObject.js +1 -0
- package/dist/types/PrimitiveObject.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/doc/README.md +11 -3
- package/doc/classes/RequestError.md +21 -11
- package/doc/functions/aggregate.md +21 -9
- package/doc/functions/branch.md +11 -5
- package/doc/functions/cache.md +21 -9
- package/doc/functions/combine.md +5 -3
- package/doc/functions/cork.md +5 -3
- package/doc/functions/defineCheckQuery.md +9 -5
- package/doc/functions/defineCustomFetch.md +15 -7
- package/doc/functions/defineGenericFetch.md +9 -5
- package/doc/functions/escapeRegex.md +5 -3
- package/doc/functions/fetchExternal.md +5 -3
- package/doc/functions/fetchLocal.md +3 -3
- package/doc/functions/fieldListFromFilter.md +6 -4
- package/doc/functions/filterChildren.md +15 -7
- package/doc/functions/filterFromContext.md +6 -4
- package/doc/functions/get.md +9 -5
- package/doc/functions/identity.md +8 -4
- package/doc/functions/isFilterGroup.md +5 -5
- package/doc/functions/log.md +5 -3
- package/doc/functions/normalizeOrder.md +6 -4
- package/doc/functions/queryItemList.md +6 -4
- package/doc/functions/retry.md +12 -6
- package/doc/functions/reverseOrder.md +6 -4
- package/doc/functions/sortItemList.md +10 -8
- package/doc/functions/testFilter.md +10 -8
- package/doc/interfaces/CustomFetch.md +6 -4
- package/doc/type-aliases/AggregateFunction.md +4 -4
- package/doc/type-aliases/AggregateFunctionOperator.md +2 -2
- package/doc/type-aliases/CombineUnion.md +17 -0
- package/doc/type-aliases/Context.md +3 -3
- package/doc/type-aliases/CustomFieldAggregateMap.md +3 -3
- package/doc/type-aliases/CustomFieldMap.md +3 -3
- package/doc/type-aliases/Field.md +4 -4
- package/doc/type-aliases/FieldFiltered.md +4 -4
- package/doc/type-aliases/FieldFunction.md +3 -3
- package/doc/type-aliases/FieldFunctionCustom.md +6 -4
- package/doc/type-aliases/FieldFunctionFormatDate.md +3 -3
- package/doc/type-aliases/FieldFunctionReturn.md +2 -2
- package/doc/type-aliases/Filter.md +3 -3
- package/doc/type-aliases/FilterArray.md +9 -5
- package/doc/type-aliases/FilterBoolean.md +3 -3
- package/doc/type-aliases/FilterChildren.md +5 -5
- package/doc/type-aliases/FilterCustom.md +6 -4
- package/doc/type-aliases/FilterField.md +3 -3
- package/doc/type-aliases/FilterGroup.md +34 -4
- package/doc/type-aliases/FilterNumber.md +3 -3
- package/doc/type-aliases/FilterOperator.md +2 -2
- package/doc/type-aliases/FilterString.md +3 -3
- package/doc/type-aliases/FilterStringIntersect.md +4 -4
- package/doc/type-aliases/FilterStringMatch.md +7 -7
- package/doc/type-aliases/Get.md +3 -3
- package/doc/type-aliases/Group.md +4 -4
- package/doc/type-aliases/Handler.md +8 -4
- package/doc/type-aliases/Immutable.md +3 -3
- package/doc/type-aliases/Increment.md +2 -2
- package/doc/type-aliases/InjectCustomFields.md +3 -3
- package/doc/type-aliases/IntersectUnion.md +17 -0
- package/doc/type-aliases/Item.md +2 -2
- package/doc/type-aliases/Join.md +2 -2
- package/doc/type-aliases/Key.md +2 -2
- package/doc/type-aliases/KeyFiltered.md +5 -5
- package/doc/type-aliases/KeyFromUnion.md +17 -0
- package/doc/type-aliases/Locale.md +3 -3
- package/doc/type-aliases/NextHandler.md +5 -3
- package/doc/type-aliases/Order.md +4 -4
- package/doc/type-aliases/Parameters.md +3 -3
- package/doc/type-aliases/Path.md +4 -4
- package/doc/type-aliases/PathFiltered.md +4 -4
- package/doc/type-aliases/Primitive.md +13 -0
- package/doc/type-aliases/PrimitiveObject.md +13 -0
- package/doc/type-aliases/Query.md +3 -3
- package/doc/type-aliases/QueryAggregate.md +4 -4
- package/doc/type-aliases/QueryCreate.md +3 -3
- package/doc/type-aliases/QueryCreateMultiple.md +4 -4
- package/doc/type-aliases/QueryDelete.md +3 -3
- package/doc/type-aliases/QueryDeleteMultiple.md +3 -3
- package/doc/type-aliases/QueryMethod.md +2 -2
- package/doc/type-aliases/QueryRead.md +4 -4
- package/doc/type-aliases/QueryReadMultiple.md +5 -5
- package/doc/type-aliases/QuerySettings.md +6 -4
- package/doc/type-aliases/QueryUpdate.md +3 -3
- package/doc/type-aliases/QueryUpdateMultiple.md +4 -4
- package/doc/type-aliases/Result.md +4 -4
- package/doc/type-aliases/Store.md +17 -7
- package/doc/type-aliases/Value.md +22 -4
- package/doc/variables/CACHE.md +13 -0
- package/doc/variables/SELF.md +13 -0
- package/lib/main.ts +1 -0
- package/lib/types/CombineUnion.ts +7 -4
- package/lib/types/KeyFiltered.ts +7 -18
- package/lib/types/Path.ts +7 -7
- package/lib/types/PathFiltered.ts +13 -11
- package/lib/types/Primitive.ts +1 -1
- package/lib/types/PrimitiveObject.ts +1 -0
- package/lib/types.ts +1 -0
- package/package.json +1 -1
- package/doc/type-aliases/Any.md +0 -13
- package/doc/type-aliases/Mutable.md +0 -17
package/dist/main.d.ts
CHANGED
package/dist/main.js
CHANGED
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../lib/main.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { KeyFromUnion } from "./KeyFromUnion";
|
|
2
|
-
|
|
2
|
+
import type { Primitive } from "./Primitive";
|
|
3
|
+
export type CombineUnion<U> = [0] extends [1 & U] ? any : [U] extends [Function | readonly Function[]] ? undefined : [U] extends [Primitive] ? U : [U] extends readonly [Array<any>] ? U : {
|
|
3
4
|
[K in KeyFromUnion<U>]: Continue<Combine<U, K>>;
|
|
4
5
|
};
|
|
5
6
|
type Combine<U, K extends string | number | symbol> = Exclude<Extract<U, {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { SELF } from "../constants/SELF";
|
|
2
2
|
import type { Key } from "./Key";
|
|
3
|
-
import type { Primitive } from "./Primitive";
|
|
4
3
|
type SymbolSelf = typeof SELF;
|
|
5
4
|
/**
|
|
6
5
|
* Returns union of keys whose mapped value extend the provided `P` type.
|
|
7
6
|
*/
|
|
8
|
-
export type KeyFiltered<T, P> = [0] extends [1 & T] ? Key | SymbolSelf : T extends
|
|
7
|
+
export type KeyFiltered<T, P> = [0] extends [1 & T] ? Key | SymbolSelf : T extends string | number | boolean | bigint | symbol ? T extends P ? SymbolSelf : never : T extends object ? keyof {
|
|
9
8
|
[K in keyof T as Extract<T[K], P> extends never ? never : K]-?: T[K];
|
|
10
9
|
} : never;
|
|
11
|
-
type MapPrimitive<P> = P extends String ? string : P extends Number ? number : P extends Boolean ? boolean : P extends BigInt ? bigint : never;
|
|
12
10
|
export {};
|
package/dist/types/Path.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Increment } from "./Increment";
|
|
2
2
|
import type { Key } from "./Key";
|
|
3
3
|
import type { Primitive } from "./Primitive";
|
|
4
|
-
export type Path<T, D = 7> = [0] extends [1 & T] ? readonly (Key | never)[] : D extends -1 ? never : T extends Array<infer P> ? readonly [number] | readonly [number, ...Path<P, Increment<D>>] : T extends object ?
|
|
4
|
+
export type Path<T, D = 7> = [0] extends [1 & T] ? readonly (Key | never)[] : D extends -1 ? never : T extends Primitive ? readonly never[] : T extends Array<infer P> ? readonly [number] | readonly [number, ...Path<P, Increment<D>>] : T extends object ? {
|
|
5
5
|
[K in keyof T]: [K] | [K, ...Path<T[K], Increment<D>>];
|
|
6
6
|
}[keyof T] : never;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Increment } from "./Increment";
|
|
2
2
|
import type { Key } from "./Key";
|
|
3
|
-
export type PathFiltered<T, P, D = 7> = [0] extends [1 & T] ? readonly (Key | never)[] : D extends -1 ? never : T extends ReadonlyArray<infer I> ? Extract<I, P> extends never ? readonly [number, ...PathFiltered<I, P, Increment<D>>] : readonly [number] : T extends object ? {
|
|
3
|
+
export type PathFiltered<T, P, D = 7> = [0] extends [1 & T] ? readonly (Key | never)[] : D extends -1 ? never : T extends P ? readonly never[] : T extends ReadonlyArray<infer I> ? Extract<I, P> extends never ? readonly [number, ...PathFiltered<I, P, Increment<D>>] : readonly [number] : T extends object ? {
|
|
4
4
|
[K in keyof T]: Extract<T[K], P> extends never ? readonly [K, ...PathFiltered<T[K], P, Increment<D>>] : readonly [K];
|
|
5
5
|
}[keyof T] : never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Primitive =
|
|
1
|
+
export type Primitive = string | number | boolean | bigint | symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type PrimitiveObject = String | Number | Boolean | BigInt | Symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=PrimitiveObject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PrimitiveObject.js","sourceRoot":"","sources":["../../lib/types/PrimitiveObject.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export type { Parameters } from "./types/Parameters";
|
|
|
42
42
|
export type { Path } from "./types/Path";
|
|
43
43
|
export type { PathFiltered } from "./types/PathFiltered";
|
|
44
44
|
export type { Primitive } from "./types/Primitive";
|
|
45
|
+
export type { PrimitiveObject } from "./types/PrimitiveObject";
|
|
45
46
|
export type { Query } from "./types/Query";
|
|
46
47
|
export type { QueryAggregate } from "./types/QueryAggregate";
|
|
47
48
|
export type { QueryCreate } from "./types/QueryCreate";
|
package/doc/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
**quetch**
|
|
1
|
+
**quetch**
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
- [AggregateFunction](type-aliases/AggregateFunction.md)
|
|
18
18
|
- [AggregateFunctionOperator](type-aliases/AggregateFunctionOperator.md)
|
|
19
|
-
- [
|
|
19
|
+
- [CombineUnion](type-aliases/CombineUnion.md)
|
|
20
20
|
- [Context](type-aliases/Context.md)
|
|
21
21
|
- [CustomFieldAggregateMap](type-aliases/CustomFieldAggregateMap.md)
|
|
22
22
|
- [CustomFieldMap](type-aliases/CustomFieldMap.md)
|
|
@@ -44,17 +44,20 @@
|
|
|
44
44
|
- [Immutable](type-aliases/Immutable.md)
|
|
45
45
|
- [Increment](type-aliases/Increment.md)
|
|
46
46
|
- [InjectCustomFields](type-aliases/InjectCustomFields.md)
|
|
47
|
+
- [IntersectUnion](type-aliases/IntersectUnion.md)
|
|
47
48
|
- [Item](type-aliases/Item.md)
|
|
48
49
|
- [Join](type-aliases/Join.md)
|
|
49
50
|
- [Key](type-aliases/Key.md)
|
|
50
51
|
- [KeyFiltered](type-aliases/KeyFiltered.md)
|
|
52
|
+
- [KeyFromUnion](type-aliases/KeyFromUnion.md)
|
|
51
53
|
- [Locale](type-aliases/Locale.md)
|
|
52
|
-
- [Mutable](type-aliases/Mutable.md)
|
|
53
54
|
- [NextHandler](type-aliases/NextHandler.md)
|
|
54
55
|
- [Order](type-aliases/Order.md)
|
|
55
56
|
- [Parameters](type-aliases/Parameters.md)
|
|
56
57
|
- [Path](type-aliases/Path.md)
|
|
57
58
|
- [PathFiltered](type-aliases/PathFiltered.md)
|
|
59
|
+
- [Primitive](type-aliases/Primitive.md)
|
|
60
|
+
- [PrimitiveObject](type-aliases/PrimitiveObject.md)
|
|
58
61
|
- [Query](type-aliases/Query.md)
|
|
59
62
|
- [QueryAggregate](type-aliases/QueryAggregate.md)
|
|
60
63
|
- [QueryCreate](type-aliases/QueryCreate.md)
|
|
@@ -71,6 +74,11 @@
|
|
|
71
74
|
- [Store](type-aliases/Store.md)
|
|
72
75
|
- [Value](type-aliases/Value.md)
|
|
73
76
|
|
|
77
|
+
## Variables
|
|
78
|
+
|
|
79
|
+
- [CACHE](variables/CACHE.md)
|
|
80
|
+
- [SELF](variables/SELF.md)
|
|
81
|
+
|
|
74
82
|
## Functions
|
|
75
83
|
|
|
76
84
|
- [aggregate](functions/aggregate.md)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -20,15 +20,25 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
##### message
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
`string`
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
##### status
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
`number`
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
##### query?
|
|
32
|
+
|
|
33
|
+
[`Query`](../type-aliases/Query.md)\<`any`\>
|
|
34
|
+
|
|
35
|
+
##### request?
|
|
36
|
+
|
|
37
|
+
`Request`
|
|
38
|
+
|
|
39
|
+
##### response?
|
|
40
|
+
|
|
41
|
+
`Response`
|
|
32
42
|
|
|
33
43
|
#### Returns
|
|
34
44
|
|
|
@@ -40,7 +50,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
40
50
|
|
|
41
51
|
#### Defined in
|
|
42
52
|
|
|
43
|
-
[lib/errors/RequestError.ts:7](https://github.com/nevoland/quetch/blob/
|
|
53
|
+
[lib/errors/RequestError.ts:7](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/errors/RequestError.ts#L7)
|
|
44
54
|
|
|
45
55
|
## Properties
|
|
46
56
|
|
|
@@ -50,7 +60,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
50
60
|
|
|
51
61
|
#### Defined in
|
|
52
62
|
|
|
53
|
-
[lib/errors/RequestError.ts:10](https://github.com/nevoland/quetch/blob/
|
|
63
|
+
[lib/errors/RequestError.ts:10](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/errors/RequestError.ts#L10)
|
|
54
64
|
|
|
55
65
|
***
|
|
56
66
|
|
|
@@ -60,7 +70,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
60
70
|
|
|
61
71
|
#### Defined in
|
|
62
72
|
|
|
63
|
-
[lib/errors/RequestError.ts:11](https://github.com/nevoland/quetch/blob/
|
|
73
|
+
[lib/errors/RequestError.ts:11](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/errors/RequestError.ts#L11)
|
|
64
74
|
|
|
65
75
|
***
|
|
66
76
|
|
|
@@ -70,7 +80,7 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
70
80
|
|
|
71
81
|
#### Defined in
|
|
72
82
|
|
|
73
|
-
[lib/errors/RequestError.ts:12](https://github.com/nevoland/quetch/blob/
|
|
83
|
+
[lib/errors/RequestError.ts:12](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/errors/RequestError.ts#L12)
|
|
74
84
|
|
|
75
85
|
***
|
|
76
86
|
|
|
@@ -80,4 +90,4 @@ Error to be thrown in case there is an issue with the query call. Only instances
|
|
|
80
90
|
|
|
81
91
|
#### Defined in
|
|
82
92
|
|
|
83
|
-
[lib/errors/RequestError.ts:9](https://github.com/nevoland/quetch/blob/
|
|
93
|
+
[lib/errors/RequestError.ts:9](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/errors/RequestError.ts#L9)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -26,19 +26,31 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
26
26
|
|
|
27
27
|
## Parameters
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### options
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
#### options.delay
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
`number` = `200`
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
#### options.mergeQuery
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
(`query`, `currentQuery`) => `I` = `...`
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
#### options.queryForGroup
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
(`queryList`, `group`) => [`Query`](../type-aliases/Query.md)\<`any`\> & `object` = `...`
|
|
42
|
+
|
|
43
|
+
#### options.queryGroupId
|
|
44
|
+
|
|
45
|
+
(`query`) => `undefined` \| `string` = `...`
|
|
46
|
+
|
|
47
|
+
#### options.queryId
|
|
48
|
+
|
|
49
|
+
(`query`) => `undefined` \| `string` = `...`
|
|
50
|
+
|
|
51
|
+
#### options.resultForQuery
|
|
52
|
+
|
|
53
|
+
(`resultList`, `query`) => `O` = `...`
|
|
42
54
|
|
|
43
55
|
## Returns
|
|
44
56
|
|
|
@@ -46,4 +58,4 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
46
58
|
|
|
47
59
|
## Defined in
|
|
48
60
|
|
|
49
|
-
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/
|
|
61
|
+
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/middlewares/aggregate.ts#L16)
|
package/doc/functions/branch.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -22,11 +22,17 @@ Dispatches an incoming query to `left` if `condition(query)` returns a truthy va
|
|
|
22
22
|
|
|
23
23
|
## Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### condition
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
(`input`) => `boolean`
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### left
|
|
30
|
+
|
|
31
|
+
[`Handler`](../type-aliases/Handler.md)\<`I`, `O`, `In`, `On`\>
|
|
32
|
+
|
|
33
|
+
### right
|
|
34
|
+
|
|
35
|
+
[`Handler`](../type-aliases/Handler.md)\<`I`, `O`, `In`, `On`\> = `...`
|
|
30
36
|
|
|
31
37
|
## Returns
|
|
32
38
|
|
|
@@ -43,4 +49,4 @@ const customFetch = combine(
|
|
|
43
49
|
|
|
44
50
|
## Defined in
|
|
45
51
|
|
|
46
|
-
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/
|
|
52
|
+
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/middlewares/branch.ts#L21)
|
package/doc/functions/cache.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -20,33 +20,45 @@
|
|
|
20
20
|
|
|
21
21
|
## Parameters
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
### \_\_namedParameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
#### __namedParameters.extendCachedQuery
|
|
26
|
+
|
|
27
|
+
(`query`, `cachedQuery`) => `undefined` \| `I`
|
|
26
28
|
|
|
27
29
|
Returns a query that completes the cached value.
|
|
28
30
|
Returns `undefined` if the query should not be completed.
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
#### __namedParameters.invalidatesItem
|
|
33
|
+
|
|
34
|
+
(`query`, `cachedQuery`, `cachedValue`) => `boolean`
|
|
31
35
|
|
|
32
36
|
Returns `true` if the cached item must be invalidated.
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
#### __namedParameters.itemId
|
|
39
|
+
|
|
40
|
+
(`query`) => `undefined` \| `string` = `...`
|
|
35
41
|
|
|
36
42
|
Unique identifier for the item to cache.
|
|
37
43
|
Returns `undefined` if the item should not be cached.
|
|
38
44
|
|
|
39
|
-
|
|
45
|
+
#### __namedParameters.mergeItem
|
|
46
|
+
|
|
47
|
+
(`value`, `cachedValue`, `query`, `cachedQuery`) => `any`
|
|
40
48
|
|
|
41
49
|
Merges the value from the extended query with the cached value.
|
|
42
50
|
Only called when `extendCachedQuery` returns a query.
|
|
43
51
|
|
|
44
|
-
|
|
52
|
+
#### __namedParameters.mergeQuery
|
|
53
|
+
|
|
54
|
+
(`extendedQuery`, `cachedQuery`) => `I`
|
|
45
55
|
|
|
46
56
|
Merges the extended query with the cached query.
|
|
47
57
|
Only called when `extendCachedQuery` returns a query.
|
|
48
58
|
|
|
49
|
-
|
|
59
|
+
#### __namedParameters.store
|
|
60
|
+
|
|
61
|
+
[`Store`](../type-aliases/Store.md)\<`CachedItem`\<`I`\>\>
|
|
50
62
|
|
|
51
63
|
Cache store.
|
|
52
64
|
|
|
@@ -56,4 +68,4 @@ Cache store.
|
|
|
56
68
|
|
|
57
69
|
## Defined in
|
|
58
70
|
|
|
59
|
-
[lib/middlewares/cache.ts:8](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/middlewares/cache.ts:8](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/middlewares/cache.ts#L8)
|
package/doc/functions/combine.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -102,7 +102,9 @@ Combines the provided handler into a single handler.
|
|
|
102
102
|
|
|
103
103
|
## Parameters
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
### handlerList
|
|
106
|
+
|
|
107
|
+
...readonly [[`Handler`](../type-aliases/Handler.md)\<`I0`, `O0`, `I1`, `O1`\>, [`Handler`](../type-aliases/Handler.md)\<`I1`, `O1`, `I2`, `O2`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I2`, `O2`, `I3`, `O3`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I3`, `O3`, `I4`, `O4`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I4`, `O4`, `I5`, `O5`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I5`, `O5`, `I6`, `O6`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I6`, `O6`, `I7`, `O7`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I7`, `O7`, `I8`, `O8`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I8`, `O8`, `I9`, `O9`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I9`, `O9`, `I10`, `O10`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I10`, `O10`, `I11`, `O11`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I11`, `O11`, `I12`, `O12`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I12`, `O12`, `I13`, `O13`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I13`, `O13`, `I14`, `O14`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I14`, `O14`, `I15`, `O15`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I15`, `O15`, `I16`, `O16`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I16`, `O16`, `I17`, `O17`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I17`, `O17`, `I18`, `O18`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I18`, `O18`, `I19`, `O19`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I19`, `O19`, `I20`, `O20`\>, `undefined` \| [`Handler`](../type-aliases/Handler.md)\<`I20`, `O20`, `I21`, `O21`\>]
|
|
106
108
|
|
|
107
109
|
List of handlers to combine.
|
|
108
110
|
|
|
@@ -114,4 +116,4 @@ Handler that combines all provided handlers.
|
|
|
114
116
|
|
|
115
117
|
## Defined in
|
|
116
118
|
|
|
117
|
-
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/
|
|
119
|
+
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/middlewares/combine.ts#L801)
|
package/doc/functions/cork.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,7 +12,9 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
|
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### input
|
|
16
|
+
|
|
17
|
+
`never`
|
|
16
18
|
|
|
17
19
|
## Returns
|
|
18
20
|
|
|
@@ -20,4 +22,4 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
|
|
|
20
22
|
|
|
21
23
|
## Defined in
|
|
22
24
|
|
|
23
|
-
[lib/tools/cork.ts:6](https://github.com/nevoland/quetch/blob/
|
|
25
|
+
[lib/tools/cork.ts:6](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/tools/cork.ts#L6)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -22,13 +22,15 @@ Function that checks queries.
|
|
|
22
22
|
|
|
23
23
|
### Type Parameters
|
|
24
24
|
|
|
25
|
-
• **T**
|
|
25
|
+
• **T**
|
|
26
26
|
|
|
27
27
|
• **Q** *extends* [`Query`](../type-aliases/Query.md)\<`T`\>
|
|
28
28
|
|
|
29
29
|
### Parameters
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
#### query
|
|
32
|
+
|
|
33
|
+
`Q` & `object`
|
|
32
34
|
|
|
33
35
|
### Returns
|
|
34
36
|
|
|
@@ -44,7 +46,9 @@ Function that checks queries.
|
|
|
44
46
|
|
|
45
47
|
### Parameters
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
#### query
|
|
50
|
+
|
|
51
|
+
`Q` & `object`
|
|
48
52
|
|
|
49
53
|
### Returns
|
|
50
54
|
|
|
@@ -52,4 +56,4 @@ Function that checks queries.
|
|
|
52
56
|
|
|
53
57
|
## Defined in
|
|
54
58
|
|
|
55
|
-
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/
|
|
59
|
+
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/tools/defineCheckQuery.ts#L8)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -16,7 +16,9 @@ Returns a custom fetch function that handles a `query`
|
|
|
16
16
|
|
|
17
17
|
## Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
### handler
|
|
20
|
+
|
|
21
|
+
[`Handler`](../type-aliases/Handler.md)\<[`Query`](../type-aliases/Query.md)\<`any`\> & `object`, `any`, `never`, `never`\>
|
|
20
22
|
|
|
21
23
|
The query handler.
|
|
22
24
|
|
|
@@ -36,7 +38,9 @@ A custom fetch function.
|
|
|
36
38
|
|
|
37
39
|
### Parameters
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
#### query
|
|
42
|
+
|
|
43
|
+
`Q` & `object`
|
|
40
44
|
|
|
41
45
|
### Returns
|
|
42
46
|
|
|
@@ -44,15 +48,19 @@ A custom fetch function.
|
|
|
44
48
|
|
|
45
49
|
### Type Parameters
|
|
46
50
|
|
|
47
|
-
• **T**
|
|
51
|
+
• **T**
|
|
48
52
|
|
|
49
53
|
• **Q** *extends* [`Query`](../type-aliases/Query.md)\<`T`\>
|
|
50
54
|
|
|
51
55
|
### Parameters
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
#### type
|
|
58
|
+
|
|
59
|
+
`T`[]
|
|
60
|
+
|
|
61
|
+
#### query
|
|
54
62
|
|
|
55
|
-
|
|
63
|
+
`Q`
|
|
56
64
|
|
|
57
65
|
### Returns
|
|
58
66
|
|
|
@@ -60,4 +68,4 @@ A custom fetch function.
|
|
|
60
68
|
|
|
61
69
|
## Defined in
|
|
62
70
|
|
|
63
|
-
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/
|
|
71
|
+
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/tools/defineCustomFetch.ts#L11)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -19,7 +19,9 @@ genericFetch<T>()(query)
|
|
|
19
19
|
|
|
20
20
|
## Parameters
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
### handler
|
|
23
|
+
|
|
24
|
+
[`Handler`](../type-aliases/Handler.md)\<[`Query`](../type-aliases/Query.md)\<`any`\> & `object`, `any`, `never`, `never`\>
|
|
23
25
|
|
|
24
26
|
The query handler.
|
|
25
27
|
|
|
@@ -31,7 +33,7 @@ A curried generic fetch function.
|
|
|
31
33
|
|
|
32
34
|
### Type Parameters
|
|
33
35
|
|
|
34
|
-
• **T**
|
|
36
|
+
• **T**
|
|
35
37
|
|
|
36
38
|
### Returns
|
|
37
39
|
|
|
@@ -43,7 +45,9 @@ A curried generic fetch function.
|
|
|
43
45
|
|
|
44
46
|
#### Parameters
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
##### query
|
|
49
|
+
|
|
50
|
+
`Q` & `object`
|
|
47
51
|
|
|
48
52
|
#### Returns
|
|
49
53
|
|
|
@@ -51,4 +55,4 @@ A curried generic fetch function.
|
|
|
51
55
|
|
|
52
56
|
## Defined in
|
|
53
57
|
|
|
54
|
-
[lib/tools/defineGenericFetch.ts:14](https://github.com/nevoland/quetch/blob/
|
|
58
|
+
[lib/tools/defineGenericFetch.ts:14](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/tools/defineGenericFetch.ts#L14)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,7 +12,9 @@ Escapes special characters of a given regular expresion `pattern`.
|
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### pattern
|
|
16
|
+
|
|
17
|
+
`string`
|
|
16
18
|
|
|
17
19
|
Regular expression string to escape.
|
|
18
20
|
|
|
@@ -24,4 +26,4 @@ Escaped regular expression
|
|
|
24
26
|
|
|
25
27
|
## Defined in
|
|
26
28
|
|
|
27
|
-
[lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/
|
|
29
|
+
[lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/tools/escapeRegex.ts#L7)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,7 +12,9 @@ Calls the provided `fetch` function, which defaults to the DOM `fetch` function,
|
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### fetch
|
|
16
|
+
|
|
17
|
+
(`input`, `init`?) => `Promise`\<`Response`\>(`input`, `init`?) => `Promise`\<`Response`\>
|
|
16
18
|
|
|
17
19
|
A standard `fetch` function.
|
|
18
20
|
|
|
@@ -24,4 +26,4 @@ Handler that returns a promise that resolves to the response.
|
|
|
24
26
|
|
|
25
27
|
## Defined in
|
|
26
28
|
|
|
27
|
-
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/
|
|
29
|
+
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/middlewares/fetchExternal.ts#L12)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ Performs the fetch query on local data.
|
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
15
|
-
• **T**
|
|
15
|
+
• **T**
|
|
16
16
|
|
|
17
17
|
## Returns
|
|
18
18
|
|
|
@@ -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/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/middlewares/fetchLocal.ts#L9)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[**quetch**](../README.md)
|
|
1
|
+
[**quetch**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -12,11 +12,13 @@ Returns the list of fields used in the provided `filter`.
|
|
|
12
12
|
|
|
13
13
|
## Type Parameters
|
|
14
14
|
|
|
15
|
-
• **T**
|
|
15
|
+
• **T**
|
|
16
16
|
|
|
17
17
|
## Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
### filter?
|
|
20
|
+
|
|
21
|
+
[`Filter`](../type-aliases/Filter.md)\<`T`\>
|
|
20
22
|
|
|
21
23
|
The filter to extract the fields from.
|
|
22
24
|
|
|
@@ -28,4 +30,4 @@ A list of fields.
|
|
|
28
30
|
|
|
29
31
|
## Defined in
|
|
30
32
|
|
|
31
|
-
[lib/tools/fieldListFromFilter.ts:11](https://github.com/nevoland/quetch/blob/
|
|
33
|
+
[lib/tools/fieldListFromFilter.ts:11](https://github.com/nevoland/quetch/blob/db84578eb5eba15d3388a1c2cfad7cc80fe9fbe6/lib/tools/fieldListFromFilter.ts#L11)
|