quetch 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/errors/RequestError.d.ts +3 -3
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/middlewares/aggregate.d.ts +3 -3
- package/dist/middlewares/aggregate.js +1 -1
- package/dist/middlewares/aggregate.js.map +1 -1
- package/dist/middlewares/cache.d.ts +4 -4
- package/dist/middlewares/cache.js +3 -3
- package/dist/middlewares/cache.js.map +1 -1
- package/dist/middlewares.d.ts +9 -9
- package/dist/middlewares.js +9 -9
- package/dist/middlewares.js.map +1 -1
- package/dist/tools/cork.d.ts +5 -0
- package/dist/tools/cork.js +5 -0
- package/dist/tools/cork.js.map +1 -0
- package/dist/tools/defineCheckQuery.d.ts +12 -7
- package/dist/tools/defineCheckQuery.js +5 -0
- package/dist/tools/defineCheckQuery.js.map +1 -1
- package/dist/tools/defineCustomFetch.d.ts +26 -18
- package/dist/tools/defineCustomFetch.js +9 -3
- package/dist/tools/defineCustomFetch.js.map +1 -1
- package/dist/tools/defineGenericFetch.d.ts +14 -0
- package/dist/tools/defineGenericFetch.js +12 -0
- package/dist/tools/defineGenericFetch.js.map +1 -0
- package/dist/tools/queryItemList.js +3 -3
- package/dist/tools/queryItemList.js.map +1 -1
- package/dist/tools/sortItemList.js +3 -3
- package/dist/tools/sortItemList.js.map +1 -1
- package/dist/tools.d.ts +9 -8
- package/dist/tools.js +9 -8
- package/dist/tools.js.map +1 -1
- package/dist/types/AggregateFunction.d.ts +9 -0
- package/dist/types/AggregateFunction.js +2 -0
- package/dist/types/AggregateFunction.js.map +1 -0
- package/dist/types/AggregateFunctionOperator.d.ts +2 -0
- package/dist/types/AggregateFunctionOperator.js +2 -0
- package/dist/types/AggregateFunctionOperator.js.map +1 -0
- package/dist/types/Any.d.ts +1 -0
- package/dist/types/Any.js +2 -0
- package/dist/types/Any.js.map +1 -0
- package/dist/types/Context.d.ts +3 -0
- package/dist/types/Context.js +2 -0
- package/dist/types/Context.js.map +1 -0
- package/dist/types/CustomFieldAggregateMap.d.ts +2 -0
- package/dist/types/CustomFieldAggregateMap.js +2 -0
- package/dist/types/CustomFieldAggregateMap.js.map +1 -0
- package/dist/types/CustomFieldMap.d.ts +2 -0
- package/dist/types/CustomFieldMap.js +2 -0
- package/dist/types/CustomFieldMap.js.map +1 -0
- package/dist/types/CustomRequest.d.ts +16 -0
- package/dist/types/CustomRequest.js +2 -0
- package/dist/types/CustomRequest.js.map +1 -0
- package/dist/types/FieldFunction.d.ts +3 -0
- package/dist/types/FieldFunction.js +2 -0
- package/dist/types/FieldFunction.js.map +1 -0
- package/dist/types/FieldFunctionCustom.d.ts +7 -0
- package/dist/types/FieldFunctionCustom.js +2 -0
- package/dist/types/FieldFunctionCustom.js.map +1 -0
- package/dist/types/FieldFunctionFormatDate.d.ts +9 -0
- package/dist/types/FieldFunctionFormatDate.js +2 -0
- package/dist/types/FieldFunctionFormatDate.js.map +1 -0
- package/dist/types/FieldFunctionReturn.d.ts +6 -0
- package/dist/types/FieldFunctionReturn.js +2 -0
- package/dist/types/FieldFunctionReturn.js.map +1 -0
- package/dist/types/Filter.d.ts +12 -0
- package/dist/types/Filter.js +2 -0
- package/dist/types/Filter.js.map +1 -0
- package/dist/types/FilterArray.d.ts +10 -0
- package/dist/types/FilterArray.js +2 -0
- package/dist/types/FilterArray.js.map +1 -0
- package/dist/types/FilterBoolean.d.ts +9 -0
- package/dist/types/FilterBoolean.js +2 -0
- package/dist/types/FilterBoolean.js.map +1 -0
- package/dist/types/FilterField.d.ts +7 -0
- package/dist/types/FilterField.js +2 -0
- package/dist/types/FilterField.js.map +1 -0
- package/dist/types/FilterKeys.d.ts +6 -0
- package/dist/types/FilterKeys.js +2 -0
- package/dist/types/FilterKeys.js.map +1 -0
- package/dist/types/FilterNumber.d.ts +9 -0
- package/dist/types/FilterNumber.js +2 -0
- package/dist/types/FilterNumber.js.map +1 -0
- package/dist/types/FilterOperator.d.ts +2 -0
- package/dist/types/FilterOperator.js +2 -0
- package/dist/types/FilterOperator.js.map +1 -0
- package/dist/types/FilterSequence.d.ts +23 -0
- package/dist/types/FilterSequence.js +2 -0
- package/dist/types/FilterSequence.js.map +1 -0
- package/dist/types/FilterString.d.ts +9 -0
- package/dist/types/FilterString.js +2 -0
- package/dist/types/FilterString.js.map +1 -0
- package/dist/types/FilterStringIntersect.d.ts +9 -0
- package/dist/types/FilterStringIntersect.js +2 -0
- package/dist/types/FilterStringIntersect.js.map +1 -0
- package/dist/types/FilterStringMatch.d.ts +29 -0
- package/dist/types/FilterStringMatch.js +2 -0
- package/dist/types/FilterStringMatch.js.map +1 -0
- package/dist/types/Get.d.ts +6 -0
- package/dist/types/Get.js +2 -0
- package/dist/types/Get.js.map +1 -0
- package/dist/types/Group.d.ts +8 -0
- package/dist/types/Group.js +2 -0
- package/dist/types/Group.js.map +1 -0
- package/dist/types/Handler.d.ts +5 -0
- package/dist/types/Handler.js +2 -0
- package/dist/types/Handler.js.map +1 -0
- package/dist/types/Immutable.d.ts +3 -0
- package/dist/types/Immutable.js +2 -0
- package/dist/types/Immutable.js.map +1 -0
- package/dist/types/InjectCustomFields.d.ts +9 -0
- package/dist/types/InjectCustomFields.js +2 -0
- package/dist/types/InjectCustomFields.js.map +1 -0
- package/dist/types/Item.d.ts +4 -0
- package/dist/types/Item.js +2 -0
- package/dist/types/Item.js.map +1 -0
- package/dist/types/Key.d.ts +1 -0
- package/dist/types/Key.js +2 -0
- package/dist/types/Key.js.map +1 -0
- package/dist/types/Mutable.d.ts +3 -0
- package/dist/types/Mutable.js +2 -0
- package/dist/types/Mutable.js.map +1 -0
- package/dist/types/NextHandler.d.ts +4 -0
- package/dist/types/NextHandler.js +2 -0
- package/dist/types/NextHandler.js.map +1 -0
- package/dist/types/Order.d.ts +7 -0
- package/dist/types/Order.js +2 -0
- package/dist/types/Order.js.map +1 -0
- package/dist/types/Query.d.ts +23 -0
- package/dist/types/Query.js +2 -0
- package/dist/types/Query.js.map +1 -0
- package/dist/types/QueryAggregate.d.ts +10 -0
- package/dist/types/QueryAggregate.js +2 -0
- package/dist/types/QueryAggregate.js.map +1 -0
- package/dist/types/QueryAny.d.ts +7 -0
- package/dist/types/QueryAny.js +2 -0
- package/dist/types/QueryAny.js.map +1 -0
- package/dist/types/QueryCreate.d.ts +7 -0
- package/dist/types/QueryCreate.js +2 -0
- package/dist/types/QueryCreate.js.map +1 -0
- package/dist/types/QueryCreateMultiple.d.ts +8 -0
- package/dist/types/QueryCreateMultiple.js +2 -0
- package/dist/types/QueryCreateMultiple.js.map +1 -0
- package/dist/types/QueryDelete.d.ts +10 -0
- package/dist/types/QueryDelete.js +2 -0
- package/dist/types/QueryDelete.js.map +1 -0
- package/dist/types/QueryDeleteMultiple.d.ts +11 -0
- package/dist/types/QueryDeleteMultiple.js +2 -0
- package/dist/types/QueryDeleteMultiple.js.map +1 -0
- package/dist/types/QueryMethod.d.ts +5 -0
- package/dist/types/QueryMethod.js +2 -0
- package/dist/types/QueryMethod.js.map +1 -0
- package/dist/types/QueryRead.d.ts +23 -0
- package/dist/types/QueryRead.js +2 -0
- package/dist/types/QueryRead.js.map +1 -0
- package/dist/types/QueryReadMultiple.d.ts +34 -0
- package/dist/types/QueryReadMultiple.js +2 -0
- package/dist/types/QueryReadMultiple.js.map +1 -0
- package/dist/types/QueryUpdate.d.ts +18 -0
- package/dist/types/QueryUpdate.js +2 -0
- package/dist/types/QueryUpdate.js.map +1 -0
- package/dist/types/QueryUpdateMultiple.d.ts +26 -0
- package/dist/types/QueryUpdateMultiple.js +2 -0
- package/dist/types/QueryUpdateMultiple.js.map +1 -0
- package/dist/types/Result.d.ts +25 -0
- package/dist/types/Result.js +2 -0
- package/dist/types/Result.js.map +1 -0
- package/dist/types/Store.d.ts +6 -0
- package/dist/types/Store.js +2 -0
- package/dist/types/Store.js.map +1 -0
- package/dist/types.d.ts +46 -396
- package/doc/README.md +533 -219
- package/lib/errors/RequestError.ts +2 -2
- package/lib/errors.ts +1 -1
- package/lib/middlewares/aggregate.ts +5 -5
- package/lib/middlewares/cache.ts +7 -12
- package/lib/middlewares.ts +9 -9
- package/lib/tools/cork.ts +6 -0
- package/lib/tools/defineCheckQuery.ts +20 -15
- package/lib/tools/defineCustomFetch.ts +40 -62
- package/lib/tools/defineGenericFetch.ts +33 -0
- package/lib/tools/queryItemList.test.ts +6 -6
- package/lib/tools/queryItemList.ts +3 -3
- package/lib/tools/sortItemList.ts +3 -3
- package/lib/tools.ts +9 -8
- package/lib/types/AggregateFunction.ts +17 -0
- package/lib/types/AggregateFunctionOperator.ts +6 -0
- package/lib/types/Any.ts +10 -0
- package/lib/types/Context.ts +3 -0
- package/lib/types/CustomFieldAggregateMap.ts +6 -0
- package/lib/types/CustomFieldMap.ts +3 -0
- package/lib/types/CustomRequest.ts +21 -0
- package/lib/types/FieldFunction.ts +6 -0
- package/lib/types/FieldFunctionCustom.ts +7 -0
- package/lib/types/FieldFunctionFormatDate.ts +10 -0
- package/lib/types/FieldFunctionReturn.ts +6 -0
- package/lib/types/Filter.ts +20 -0
- package/lib/types/FilterArray.ts +11 -0
- package/lib/types/FilterBoolean.ts +10 -0
- package/lib/types/FilterField.ts +7 -0
- package/lib/types/FilterKeys.ts +6 -0
- package/lib/types/FilterNumber.ts +16 -0
- package/lib/types/FilterOperator.ts +3 -0
- package/lib/types/FilterSequence.ts +26 -0
- package/lib/types/FilterString.ts +19 -0
- package/lib/types/FilterStringIntersect.ts +10 -0
- package/lib/types/FilterStringMatch.ts +30 -0
- package/lib/types/Get.ts +8 -0
- package/lib/types/Group.ts +11 -0
- package/lib/types/Handler.ts +9 -0
- package/lib/types/Immutable.ts +3 -0
- package/lib/types/InjectCustomFields.ts +23 -0
- package/lib/types/Item.ts +8 -0
- package/lib/types/Key.ts +1 -0
- package/lib/types/Mutable.ts +3 -0
- package/lib/types/NextHandler.ts +4 -0
- package/lib/types/Order.ts +9 -0
- package/lib/types/Query.ts +36 -0
- package/lib/types/QueryAggregate.ts +11 -0
- package/lib/types/QueryAny.ts +8 -0
- package/lib/types/QueryCreate.ts +7 -0
- package/lib/types/QueryCreateMultiple.ts +8 -0
- package/lib/types/QueryDelete.ts +11 -0
- package/lib/types/QueryDeleteMultiple.ts +12 -0
- package/lib/types/QueryMethod.ts +6 -0
- package/lib/types/QueryRead.ts +24 -0
- package/lib/types/QueryReadMultiple.ts +36 -0
- package/lib/types/QueryUpdate.ts +19 -0
- package/lib/types/QueryUpdateMultiple.ts +27 -0
- package/lib/types/Result.ts +38 -0
- package/lib/types/Store.ts +7 -0
- package/lib/types.ts +47 -562
- package/package.json +3 -3
- package/dist/errors/QueryError.d.ts +0 -5
- package/dist/errors/QueryError.js +0 -23
- package/dist/errors/QueryError.js.map +0 -1
- package/dist/middlewares/concurrent.d.ts +0 -2
- package/dist/middlewares/concurrent.js +0 -20
- package/dist/middlewares/concurrent.js.map +0 -1
- package/dist/middlewares/fetch.d.ts +0 -2
- package/dist/middlewares/fetch.js +0 -20
- package/dist/middlewares/fetch.js.map +0 -1
- package/dist/middlewares/logQuery.d.ts +0 -2
- package/dist/middlewares/logQuery.js +0 -25
- package/dist/middlewares/logQuery.js.map +0 -1
- package/dist/tools/add.d.ts +0 -8
- package/dist/tools/add.js +0 -11
- package/dist/tools/add.js.map +0 -1
- package/dist/tools/add.test.d.ts +0 -1
- package/dist/tools/add.test.js +0 -6
- package/dist/tools/add.test.js.map +0 -1
- package/dist/tools/filterItem.test.d.ts +0 -1
- package/dist/tools/filterItem.test.js +0 -86
- package/dist/tools/filterItem.test.js.map +0 -1
- package/dist/tools/impasse.d.ts +0 -2
- package/dist/tools/impasse.js +0 -2
- package/dist/tools/impasse.js.map +0 -1
- package/dist/tools/queryItemList.test.d.ts +0 -1
- package/dist/tools/queryItemList.test.js +0 -181
- package/dist/tools/queryItemList.test.js.map +0 -1
- package/dist/tools/sortItemList.test.d.ts +0 -1
- package/dist/tools/sortItemList.test.js +0 -47
- package/dist/tools/sortItemList.test.js.map +0 -1
- package/lib/tools/impasse.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFunctionFormatDate.js","sourceRoot":"","sources":["../../lib/types/FieldFunctionFormatDate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldFunctionReturn.js","sourceRoot":"","sources":["../../lib/types/FieldFunctionReturn.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FilterArray } from "./FilterArray";
|
|
2
|
+
import type { FilterBoolean } from "./FilterBoolean";
|
|
3
|
+
import type { FilterField } from "./FilterField";
|
|
4
|
+
import type { FilterNumber } from "./FilterNumber";
|
|
5
|
+
import type { FilterSequence } from "./FilterSequence";
|
|
6
|
+
import type { FilterString } from "./FilterString";
|
|
7
|
+
import type { FilterStringIntersect } from "./FilterStringIntersect";
|
|
8
|
+
import type { FilterStringMatch } from "./FilterStringMatch";
|
|
9
|
+
/**
|
|
10
|
+
* Describes a predicate for filtering items.
|
|
11
|
+
*/
|
|
12
|
+
export type Filter<T extends object> = FilterSequence<T> | FilterField<T> | FilterBoolean<T> | FilterString<T> | FilterStringMatch<T> | FilterStringIntersect<T> | FilterNumber<T> | FilterArray<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Filter.js","sourceRoot":"","sources":["../../lib/types/Filter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Any } from "./Any";
|
|
2
|
+
import type { FilterKeys } from "./FilterKeys";
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a given array field matches a given array value according to a given operator.
|
|
5
|
+
*/
|
|
6
|
+
export type FilterArray<T extends object, P = Any> = {
|
|
7
|
+
operator: "equal" | "include" | "intersect";
|
|
8
|
+
field: FilterKeys<T, P[]>;
|
|
9
|
+
value: P[];
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterArray.js","sourceRoot":"","sources":["../../lib/types/FilterArray.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBoolean.js","sourceRoot":"","sources":["../../lib/types/FilterBoolean.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterField.js","sourceRoot":"","sources":["../../lib/types/FilterField.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterKeys.js","sourceRoot":"","sources":["../../lib/types/FilterKeys.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FilterKeys } from "./FilterKeys";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a given number field matches a given number value according to a given operator.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterNumber<T extends object> = {
|
|
6
|
+
operator: "equal" | "notEqual" | "greaterThan" | "greaterThanOrEqual" | "lowerThan" | "lowerThanOrEqual";
|
|
7
|
+
field: FilterKeys<T, number>;
|
|
8
|
+
value: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterNumber.js","sourceRoot":"","sources":["../../lib/types/FilterNumber.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterOperator.js","sourceRoot":"","sources":["../../lib/types/FilterOperator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Filter } from "./Filter";
|
|
2
|
+
/**
|
|
3
|
+
* Joins a list of filters with a specific boolean operator.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterSequence<T extends object> = {
|
|
6
|
+
/**
|
|
7
|
+
* Boolean operator to use for joining the filters.
|
|
8
|
+
*/
|
|
9
|
+
operator: "all";
|
|
10
|
+
/**
|
|
11
|
+
* Filters to join.
|
|
12
|
+
*/
|
|
13
|
+
value: Filter<T>[];
|
|
14
|
+
} | {
|
|
15
|
+
/**
|
|
16
|
+
* Boolean operator to use for joining the filters.
|
|
17
|
+
*/
|
|
18
|
+
operator: "any" | "none";
|
|
19
|
+
/**
|
|
20
|
+
* Filters to join.
|
|
21
|
+
*/
|
|
22
|
+
value?: Filter<T>[];
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterSequence.js","sourceRoot":"","sources":["../../lib/types/FilterSequence.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FilterKeys } from "./FilterKeys";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a given string field matches a given string value according to a given operator.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterString<T extends object> = {
|
|
6
|
+
operator: "equal" | "notEqual" | "startWith" | "endWith" | "include" | "greaterThan" | "greaterThanOrEqual" | "lowerThan" | "lowerThanOrEqual";
|
|
7
|
+
field: FilterKeys<T, string>;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterString.js","sourceRoot":"","sources":["../../lib/types/FilterString.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FilterKeys } from "./FilterKeys";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a given string field has any of the provided values.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterStringIntersect<T extends object> = {
|
|
6
|
+
operator: "intersect";
|
|
7
|
+
field: FilterKeys<T, string>;
|
|
8
|
+
value: string[];
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterStringIntersect.js","sourceRoot":"","sources":["../../lib/types/FilterStringIntersect.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FilterKeys } from "./FilterKeys";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if a given string field matches a given regular expression.
|
|
4
|
+
*/
|
|
5
|
+
export type FilterStringMatch<T extends object> = {
|
|
6
|
+
operator: "match";
|
|
7
|
+
field: FilterKeys<T, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Raw regular expression string.
|
|
10
|
+
*/
|
|
11
|
+
value: string;
|
|
12
|
+
/**
|
|
13
|
+
* Regular expression options.
|
|
14
|
+
*/
|
|
15
|
+
options?: {
|
|
16
|
+
/**
|
|
17
|
+
* When matching, casing differences are ignored.
|
|
18
|
+
*/
|
|
19
|
+
ignoreCase?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Allows . to match newlines.
|
|
22
|
+
*/
|
|
23
|
+
dotAll?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Compiled regular expression generated by the `testFilter` function.
|
|
27
|
+
*/
|
|
28
|
+
regularExpression?: RegExp;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterStringMatch.js","sourceRoot":"","sources":["../../lib/types/FilterStringMatch.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Get.js","sourceRoot":"","sources":["../../lib/types/Get.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Group.js","sourceRoot":"","sources":["../../lib/types/Group.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Handler.js","sourceRoot":"","sources":["../../lib/types/Handler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Immutable.js","sourceRoot":"","sources":["../../lib/types/Immutable.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CustomFieldMap } from "./CustomFieldMap";
|
|
2
|
+
import type { FieldFunctionCustom } from "./FieldFunctionCustom";
|
|
3
|
+
import type { FieldFunctionReturn } from "./FieldFunctionReturn";
|
|
4
|
+
/**
|
|
5
|
+
* Injects the custom fields into the entity type.
|
|
6
|
+
*/
|
|
7
|
+
export type InjectCustomFields<T extends object, C extends CustomFieldMap<T> | undefined> = C extends CustomFieldMap<T> ? {
|
|
8
|
+
readonly [K in keyof T | keyof C]: K extends keyof T ? T[K] : K extends keyof C ? C[K] extends FieldFunctionCustom<T> ? ReturnType<C[K]["value"]> : C[K]["operator"] extends keyof FieldFunctionReturn ? FieldFunctionReturn[C[K]["operator"]] : never : never;
|
|
9
|
+
} : T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InjectCustomFields.js","sourceRoot":"","sources":["../../lib/types/InjectCustomFields.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Item.js","sourceRoot":"","sources":["../../lib/types/Item.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Key = string | number | symbol;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Key.js","sourceRoot":"","sources":["../../lib/types/Key.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Mutable.js","sourceRoot":"","sources":["../../lib/types/Mutable.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextHandler.js","sourceRoot":"","sources":["../../lib/types/NextHandler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Order.js","sourceRoot":"","sources":["../../lib/types/Order.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Context } from "./Context";
|
|
2
|
+
import type { CustomFieldMap } from "./CustomFieldMap";
|
|
3
|
+
import type { InjectCustomFields } from "./InjectCustomFields";
|
|
4
|
+
import type { QueryAggregate } from "./QueryAggregate";
|
|
5
|
+
import type { QueryCreate } from "./QueryCreate";
|
|
6
|
+
import type { QueryCreateMultiple } from "./QueryCreateMultiple";
|
|
7
|
+
import type { QueryDelete } from "./QueryDelete";
|
|
8
|
+
import type { QueryDeleteMultiple } from "./QueryDeleteMultiple";
|
|
9
|
+
import type { QueryRead } from "./QueryRead";
|
|
10
|
+
import type { QueryReadMultiple } from "./QueryReadMultiple";
|
|
11
|
+
import type { QueryUpdate } from "./QueryUpdate";
|
|
12
|
+
import type { QueryUpdateMultiple } from "./QueryUpdateMultiple";
|
|
13
|
+
type QueryBase<T extends object> = QueryRead<T> | QueryReadMultiple<T> | QueryCreate<T> | QueryCreateMultiple<T> | QueryUpdate<T> | QueryUpdateMultiple<T> | QueryDelete<T> | QueryDeleteMultiple<T> | QueryAggregate<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Query that fetches or mutates an entity.
|
|
16
|
+
*/
|
|
17
|
+
export type Query<T extends object, C extends CustomFieldMap<T> | undefined> = QueryBase<InjectCustomFields<T, C>> & {
|
|
18
|
+
/**
|
|
19
|
+
* Common item properties to use for identifying the item.
|
|
20
|
+
*/
|
|
21
|
+
context?: Context<T>;
|
|
22
|
+
};
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../lib/types/Query.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AggregateFunction } from "./AggregateFunction";
|
|
2
|
+
import type { Filter } from "./Filter";
|
|
3
|
+
/**
|
|
4
|
+
* Query for computing an aggregated value.
|
|
5
|
+
*/
|
|
6
|
+
export type QueryAggregate<T extends object> = {
|
|
7
|
+
method: "aggregate";
|
|
8
|
+
aggregator: AggregateFunction<T>;
|
|
9
|
+
filter?: Filter<T>;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryAggregate.js","sourceRoot":"","sources":["../../lib/types/QueryAggregate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryAny.js","sourceRoot":"","sources":["../../lib/types/QueryAny.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryCreate.js","sourceRoot":"","sources":["../../lib/types/QueryCreate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryCreateMultiple.js","sourceRoot":"","sources":["../../lib/types/QueryCreateMultiple.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CustomFieldMap } from "./CustomFieldMap";
|
|
2
|
+
import type { Filter } from "./Filter";
|
|
3
|
+
/**
|
|
4
|
+
* Query for deleting an item.
|
|
5
|
+
*/
|
|
6
|
+
export type QueryDelete<T extends object> = {
|
|
7
|
+
method: "delete";
|
|
8
|
+
filter?: Filter<T>;
|
|
9
|
+
customFields?: CustomFieldMap<T>;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryDelete.js","sourceRoot":"","sources":["../../lib/types/QueryDelete.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomFieldMap } from "./CustomFieldMap";
|
|
2
|
+
import type { Filter } from "./Filter";
|
|
3
|
+
/**
|
|
4
|
+
* Query for deleting multiple items.
|
|
5
|
+
*/
|
|
6
|
+
export type QueryDeleteMultiple<T extends object> = {
|
|
7
|
+
method: "delete";
|
|
8
|
+
multiple: true;
|
|
9
|
+
filter?: Filter<T>;
|
|
10
|
+
customFields?: CustomFieldMap<T>;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryDeleteMultiple.js","sourceRoot":"","sources":["../../lib/types/QueryDeleteMultiple.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryMethod.js","sourceRoot":"","sources":["../../lib/types/QueryMethod.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Filter } from "./Filter";
|
|
2
|
+
import type { Order } from "./Order";
|
|
3
|
+
/**
|
|
4
|
+
* Query for reading a single item.
|
|
5
|
+
*/
|
|
6
|
+
export type QueryRead<T extends object> = {
|
|
7
|
+
method?: "read";
|
|
8
|
+
multiple?: false;
|
|
9
|
+
offset?: never;
|
|
10
|
+
group?: never;
|
|
11
|
+
/**
|
|
12
|
+
* Item fields to pick. If omitted, all fields are picked.
|
|
13
|
+
*/
|
|
14
|
+
fields?: readonly (keyof T)[];
|
|
15
|
+
/**
|
|
16
|
+
* Filter for finding the item, if it cannot be found based on the `context`.
|
|
17
|
+
*/
|
|
18
|
+
filter?: Filter<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Order by which the items should be sorted.
|
|
21
|
+
*/
|
|
22
|
+
order?: Order<T>[];
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryRead.js","sourceRoot":"","sources":["../../lib/types/QueryRead.ts"],"names":[],"mappings":""}
|