quetch 0.19.0 → 0.19.2
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/constants/CACHE.d.ts +1 -0
- package/dist/constants/CACHE.js +2 -0
- package/dist/constants/CACHE.js.map +1 -0
- package/dist/constants/SELF.d.ts +1 -0
- package/dist/constants/SELF.js +2 -0
- package/dist/constants/SELF.js.map +1 -0
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/tools/get.js +2 -1
- package/dist/tools/get.js.map +1 -1
- package/dist/tools/testFilter.js +8 -8
- package/dist/tools/testFilter.js.map +1 -1
- package/dist/types/CombineUnion.d.ts +2 -1
- package/dist/types/FilterChildren.d.ts +2 -2
- package/dist/types/FilterStringMatch.d.ts +2 -2
- package/dist/types/KeyFiltered.d.ts +3 -5
- 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 +6 -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/lib/constants/CACHE.ts +1 -0
- package/lib/constants/SELF.ts +1 -0
- package/lib/constants.ts +2 -2
- package/lib/tools/get.ts +2 -1
- package/lib/tools/testFilter.test.ts +2 -2
- package/lib/tools/testFilter.ts +8 -8
- package/lib/types/CombineUnion.ts +7 -4
- package/lib/types/FilterChildren.ts +2 -2
- package/lib/types/FilterStringMatch.ts +2 -2
- package/lib/types/KeyFiltered.ts +10 -21
- package/lib/types/Path.ts +8 -8
- 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/dist/constants/SymbolCache.d.ts +0 -1
- package/dist/constants/SymbolCache.js +0 -2
- package/dist/constants/SymbolCache.js.map +0 -1
- package/dist/constants/SymbolSelf.d.ts +0 -1
- package/dist/constants/SymbolSelf.js +0 -2
- package/dist/constants/SymbolSelf.js.map +0 -1
- package/doc/type-aliases/Any.md +0 -13
- package/doc/type-aliases/Mutable.md +0 -17
- package/lib/constants/SymbolCache.ts +0 -1
- package/lib/constants/SymbolSelf.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CACHE: unique symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CACHE.js","sourceRoot":"","sources":["../../lib/constants/CACHE.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SELF: unique symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SELF.js","sourceRoot":"","sources":["../../lib/constants/SELF.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { CACHE } from "./constants/CACHE.js";
|
|
2
|
+
export { SELF } from "./constants/SELF.js";
|
package/dist/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// File automatically generated by `vite-plugin-module-list`
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { CACHE } from "./constants/CACHE.js";
|
|
3
|
+
export { SELF } from "./constants/SELF.js";
|
|
4
4
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../lib/constants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../lib/constants.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/tools/get.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SELF } from "../constants/SELF.js";
|
|
1
2
|
/**
|
|
2
3
|
* Gets the property value of the given `value` at the specified `path` (an array of object property names or array indexes).
|
|
3
4
|
* If the `path` is undefined, returns the `value` itself.
|
|
@@ -9,7 +10,7 @@
|
|
|
9
10
|
* @returns The property value found at the given path, or `undefined` if it cannot be found.
|
|
10
11
|
*/
|
|
11
12
|
export function get(value, path) {
|
|
12
|
-
if (path === undefined) {
|
|
13
|
+
if (path === undefined || path === SELF) {
|
|
13
14
|
return value;
|
|
14
15
|
}
|
|
15
16
|
switch (typeof path) {
|
package/dist/tools/get.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../lib/tools/get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../lib/tools/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAG5C;;;;;;;;;GASG;AACH,MAAM,UAAU,GAAG,CACjB,KAAQ,EACR,IAAQ;IAER,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACxC,OAAO,KAAY,CAAC;IACtB,CAAC;IACD,QAAQ,OAAO,IAAI,EAAE,CAAC;QACpB,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACX,OAAQ,KAAa,EAAE,CAAC,IAAI,CAAC,CAAC;QAChC,OAAO,CAAC,CAAC,CAAC;YACR,QAAQ,IAAI,CAAC,MAAgB,EAAE,CAAC;gBAC9B,KAAK,CAAC;oBACJ,OAAO,KAAY,CAAC;gBACtB,KAAK,CAAC;oBACJ,OAAQ,KAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC,CAAC;gBAC1C,KAAK,CAAC;oBACJ,OAAQ,KAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC,EAAE,CAAE,IAAY,CAAC,CAAC,CAAQ,CAAC,CAAC;gBACrE,KAAK,CAAC;oBACJ,OAAQ,KAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC,EAAE,CAAE,IAAY,CAAC,CAAC,CAAQ,CAAC,EAAE,CACjE,IAAY,CAAC,CAAC,CAAQ,CACxB,CAAC;gBACJ,KAAK,CAAC;oBACJ,OAAQ,KAAa,EAAE,CAAC,IAAI,CAAC,CAAC,CAAQ,CAAC,EAAE,CAAE,IAAY,CAAC,CAAC,CAAQ,CAAC,EAAE,CACjE,IAAY,CAAC,CAAC,CAAQ,CACxB,EAAE,CAAE,IAAY,CAAC,CAAC,CAAQ,CAAC,CAAC;gBAC/B;oBACE,OAAO,IAAI,CAAC,MAAM,CAChB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAE,KAAa,EAAE,CAAC,GAAG,CAAC,EACrC,KAAK,CACC,CAAC;YACb,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/tools/testFilter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CACHE } from "../constants/CACHE.js";
|
|
2
2
|
import { filterChildren } from "./filterChildren.js";
|
|
3
3
|
import { get } from "./get.js";
|
|
4
4
|
const { isArray } = Array;
|
|
@@ -78,18 +78,18 @@ export function testFilter(filter, value, settings) {
|
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
80
|
case "children": {
|
|
81
|
-
if (filter[
|
|
81
|
+
if (filter[CACHE] === undefined) {
|
|
82
82
|
switch (true) {
|
|
83
83
|
case settings?.transformFilterChildren !== undefined:
|
|
84
|
-
filter[
|
|
84
|
+
filter[CACHE] = settings.transformFilterChildren(filter);
|
|
85
85
|
break;
|
|
86
86
|
default: {
|
|
87
87
|
const { pathFieldKey = "id", pathFieldSeparator = "/", } = settings || {};
|
|
88
|
-
filter[
|
|
88
|
+
filter[CACHE] = filterChildren(filter.value, pathFieldKey, filter.deep, pathFieldSeparator);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
return testFilter(filter[
|
|
92
|
+
return testFilter(filter[CACHE], value);
|
|
93
93
|
}
|
|
94
94
|
case "custom": {
|
|
95
95
|
return filter.value(value);
|
|
@@ -187,10 +187,10 @@ export function testFilter(filter, value, settings) {
|
|
|
187
187
|
if (leftValue === undefined) {
|
|
188
188
|
return false;
|
|
189
189
|
}
|
|
190
|
-
if (filter[
|
|
191
|
-
filter[
|
|
190
|
+
if (filter[CACHE] === undefined) {
|
|
191
|
+
filter[CACHE] = new RegExp(rightValue, `${filter.options?.ignoreCase ? "i" : ""}${filter.options?.dotAll ? "s" : ""}`);
|
|
192
192
|
}
|
|
193
|
-
return filter[
|
|
193
|
+
return filter[CACHE].test(leftValue);
|
|
194
194
|
}
|
|
195
195
|
case "intersect": {
|
|
196
196
|
const rightValue = valueFromFilter(value, filter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFilter.js","sourceRoot":"","sources":["../../lib/tools/testFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"testFilter.js","sourceRoot":"","sources":["../../lib/tools/testFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,EAAE,OAAO,EAAE,GA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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,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CACHE } from "../constants/CACHE.js";
|
|
2
2
|
import type { Context } from "./Context";
|
|
3
3
|
import type { Filter } from "./Filter";
|
|
4
4
|
/**
|
|
@@ -9,5 +9,5 @@ export type FilterChildren<T> = {
|
|
|
9
9
|
operator: "children";
|
|
10
10
|
value?: Context<T> | string;
|
|
11
11
|
deep?: boolean;
|
|
12
|
-
[
|
|
12
|
+
[CACHE]?: Filter<T>;
|
|
13
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CACHE } from "../constants/CACHE.js";
|
|
2
2
|
import type { FieldFiltered } from "./FieldFiltered";
|
|
3
3
|
import type { Value } from "./Value";
|
|
4
4
|
/**
|
|
@@ -23,5 +23,5 @@ export type FilterStringMatch<T> = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Compiled regular expression generated by the `testFilter` function.
|
|
25
25
|
*/
|
|
26
|
-
[
|
|
26
|
+
[CACHE]?: RegExp;
|
|
27
27
|
} & Value<T, string>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SELF } from "../constants/SELF";
|
|
2
2
|
import type { Key } from "./Key";
|
|
3
|
-
|
|
4
|
-
type SymbolSelfType = typeof SymbolSelf;
|
|
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 |
|
|
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 =
|
|
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)
|
|
@@ -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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/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/daab7d5db71d61e74901886a2473b07ec4e9fc05/lib/tools/defineCheckQuery.ts#L8)
|