quetch 0.24.0 → 0.25.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.
Files changed (110) hide show
  1. package/dist/tools/filterFromValue.d.ts +2 -2
  2. package/dist/tools/filterFromValue.js +25 -9
  3. package/dist/tools/filterFromValue.js.map +1 -1
  4. package/dist/tools/queryItemList.js.map +1 -1
  5. package/dist/types/QueryDelete.d.ts +8 -0
  6. package/dist/types/QueryDeleteMultiple.d.ts +11 -0
  7. package/dist/types/QueryReadMultiple.d.ts +1 -1
  8. package/dist/types/QueryUpdate.d.ts +1 -1
  9. package/dist/types/QueryUpdateMultiple.d.ts +3 -0
  10. package/doc/classes/RequestError.md +5 -5
  11. package/doc/functions/aggregate.md +1 -1
  12. package/doc/functions/branch.md +1 -1
  13. package/doc/functions/cache.md +1 -1
  14. package/doc/functions/combine.md +1 -1
  15. package/doc/functions/cork.md +1 -1
  16. package/doc/functions/defineCheckQuery.md +1 -1
  17. package/doc/functions/defineCustomFetch.md +1 -1
  18. package/doc/functions/defineGenericFetch.md +1 -1
  19. package/doc/functions/escapeRegex.md +1 -1
  20. package/doc/functions/fetchExternal.md +1 -1
  21. package/doc/functions/fetchLocal.md +1 -1
  22. package/doc/functions/fieldListFromFilter.md +1 -1
  23. package/doc/functions/filterChildren.md +1 -1
  24. package/doc/functions/filterFromValue.md +4 -4
  25. package/doc/functions/get.md +1 -1
  26. package/doc/functions/identity.md +1 -1
  27. package/doc/functions/isFilterGroup.md +1 -1
  28. package/doc/functions/log.md +1 -1
  29. package/doc/functions/normalizeOrder.md +1 -1
  30. package/doc/functions/queryItemList.md +1 -1
  31. package/doc/functions/retry.md +1 -1
  32. package/doc/functions/reverseOrder.md +1 -1
  33. package/doc/functions/sameField.md +1 -1
  34. package/doc/functions/sortItemList.md +1 -1
  35. package/doc/functions/splitPath.md +2 -2
  36. package/doc/functions/testFilter.md +1 -1
  37. package/doc/interfaces/CustomFetch.md +1 -1
  38. package/doc/type-aliases/AggregateFunction.md +1 -1
  39. package/doc/type-aliases/AggregateFunctionOperator.md +1 -1
  40. package/doc/type-aliases/CombineUnion.md +1 -1
  41. package/doc/type-aliases/Context.md +1 -1
  42. package/doc/type-aliases/CustomFieldAggregateMap.md +1 -1
  43. package/doc/type-aliases/CustomFieldMap.md +1 -1
  44. package/doc/type-aliases/Field.md +1 -1
  45. package/doc/type-aliases/FieldFiltered.md +1 -1
  46. package/doc/type-aliases/FieldFunction.md +1 -1
  47. package/doc/type-aliases/FieldFunctionCustom.md +1 -1
  48. package/doc/type-aliases/FieldFunctionFormatDate.md +1 -1
  49. package/doc/type-aliases/FieldFunctionReturn.md +1 -1
  50. package/doc/type-aliases/FieldKey.md +1 -1
  51. package/doc/type-aliases/FieldMap.md +1 -1
  52. package/doc/type-aliases/Filter.md +1 -1
  53. package/doc/type-aliases/FilterArray.md +1 -1
  54. package/doc/type-aliases/FilterBoolean.md +1 -1
  55. package/doc/type-aliases/FilterChildren.md +1 -1
  56. package/doc/type-aliases/FilterCustom.md +1 -1
  57. package/doc/type-aliases/FilterField.md +1 -1
  58. package/doc/type-aliases/FilterGroup.md +1 -1
  59. package/doc/type-aliases/FilterNumber.md +1 -1
  60. package/doc/type-aliases/FilterOperator.md +1 -1
  61. package/doc/type-aliases/FilterString.md +1 -1
  62. package/doc/type-aliases/FilterStringIntersect.md +1 -1
  63. package/doc/type-aliases/FilterStringMatch.md +1 -1
  64. package/doc/type-aliases/Get.md +1 -1
  65. package/doc/type-aliases/Group.md +1 -1
  66. package/doc/type-aliases/Handler.md +1 -1
  67. package/doc/type-aliases/Immutable.md +1 -1
  68. package/doc/type-aliases/Increment.md +1 -1
  69. package/doc/type-aliases/InjectCustomFields.md +1 -1
  70. package/doc/type-aliases/IntersectUnion.md +1 -1
  71. package/doc/type-aliases/Item.md +1 -1
  72. package/doc/type-aliases/Join.md +1 -1
  73. package/doc/type-aliases/Key.md +1 -1
  74. package/doc/type-aliases/KeyFiltered.md +1 -1
  75. package/doc/type-aliases/KeyFromUnion.md +1 -1
  76. package/doc/type-aliases/Locale.md +1 -1
  77. package/doc/type-aliases/NextHandler.md +1 -1
  78. package/doc/type-aliases/Order.md +1 -1
  79. package/doc/type-aliases/OrderNormalized.md +1 -1
  80. package/doc/type-aliases/Parameters.md +1 -1
  81. package/doc/type-aliases/Path.md +1 -1
  82. package/doc/type-aliases/PathFiltered.md +1 -1
  83. package/doc/type-aliases/Primitive.md +1 -1
  84. package/doc/type-aliases/PrimitiveObject.md +1 -1
  85. package/doc/type-aliases/Query.md +1 -1
  86. package/doc/type-aliases/QueryAggregate.md +1 -1
  87. package/doc/type-aliases/QueryCreate.md +1 -1
  88. package/doc/type-aliases/QueryCreateMultiple.md +1 -1
  89. package/doc/type-aliases/QueryDelete.md +13 -1
  90. package/doc/type-aliases/QueryDeleteMultiple.md +15 -1
  91. package/doc/type-aliases/QueryMethod.md +1 -1
  92. package/doc/type-aliases/QueryRead.md +1 -1
  93. package/doc/type-aliases/QueryReadMultiple.md +2 -2
  94. package/doc/type-aliases/QuerySettings.md +1 -1
  95. package/doc/type-aliases/QueryUpdate.md +3 -3
  96. package/doc/type-aliases/QueryUpdateMultiple.md +3 -1
  97. package/doc/type-aliases/Result.md +1 -1
  98. package/doc/type-aliases/Store.md +1 -1
  99. package/doc/type-aliases/Value.md +1 -1
  100. package/doc/type-aliases/ValueMap.md +1 -1
  101. package/doc/variables/CACHE.md +1 -1
  102. package/doc/variables/SELF.md +1 -1
  103. package/lib/tools/filterFromValue.ts +27 -13
  104. package/lib/tools/queryItemList.ts +2 -2
  105. package/lib/types/QueryDelete.ts +8 -0
  106. package/lib/types/QueryDeleteMultiple.ts +11 -0
  107. package/lib/types/QueryReadMultiple.ts +1 -1
  108. package/lib/types/QueryUpdate.ts +1 -1
  109. package/lib/types/QueryUpdateMultiple.ts +3 -0
  110. package/package.json +1 -1
@@ -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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/FilterString.ts#L8)
37
+ [lib/types/FilterString.ts:8](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/FilterStringIntersect.ts#L8)
37
+ [lib/types/FilterStringIntersect.ts:8](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/FilterStringMatch.ts#L9)
53
+ [lib/types/FilterStringMatch.ts:9](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/FilterStringMatch.ts#L9)
@@ -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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Get.ts#L6)
21
+ [lib/types/Get.ts:6](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Group.ts#L4)
19
+ [lib/types/Group.ts:4](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Handler.ts#L6)
39
+ [lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Immutable.ts#L1)
17
+ [lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Increment.ts#L5)
17
+ [lib/types/Increment.ts:5](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/InjectCustomFields.ts#L8)
21
+ [lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/IntersectUnion.ts#L1)
17
+ [lib/types/IntersectUnion.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/IntersectUnion.ts#L1)
@@ -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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Item.ts#L4)
21
+ [lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/Item.ts#L4)
@@ -16,4 +16,4 @@
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Join.ts:1](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Join.ts#L1)
19
+ [lib/types/Join.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/Join.ts#L1)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Key.ts#L1)
13
+ [lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/KeyFiltered.ts#L10)
21
+ [lib/types/KeyFiltered.ts:10](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/KeyFromUnion.ts#L1)
17
+ [lib/types/KeyFromUnion.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Locale.ts#L1)
13
+ [lib/types/Locale.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/NextHandler.ts#L4)
31
+ [lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Order.ts#L6)
19
+ [lib/types/Order.ts:6](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/Order.ts#L6)
@@ -24,4 +24,4 @@
24
24
 
25
25
  ## Defined in
26
26
 
27
- [lib/types/OrderNormalized.ts:3](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/OrderNormalized.ts#L3)
27
+ [lib/types/OrderNormalized.ts:3](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/OrderNormalized.ts#L3)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Parameters.ts#L1)
13
+ [lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/Parameters.ts#L1)
@@ -16,4 +16,4 @@
16
16
 
17
17
  ## Defined in
18
18
 
19
- [lib/types/Path.ts:5](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Path.ts#L5)
19
+ [lib/types/Path.ts:5](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/PathFiltered.ts#L4)
21
+ [lib/types/PathFiltered.ts:4](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Primitive.ts#L1)
13
+ [lib/types/Primitive.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/PrimitiveObject.ts#L1)
13
+ [lib/types/PrimitiveObject.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Query.ts#L14)
19
+ [lib/types/Query.ts:14](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryAggregate.ts#L11)
71
+ [lib/types/QueryAggregate.ts:11](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryCreate.ts#L8)
53
+ [lib/types/QueryCreate.ts:8](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryCreateMultiple.ts#L8)
51
+ [lib/types/QueryCreateMultiple.ts:8](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/QueryCreateMultiple.ts#L8)
@@ -26,6 +26,12 @@ Common item properties to use for identifying the context in which to delete the
26
26
 
27
27
  > `optional` **filter**: [`Filter`](Filter.md)\<`T`\>
28
28
 
29
+ Filter for finding the item, if it cannot be found based on the `context`.
30
+
31
+ ### limit?
32
+
33
+ > `optional` **limit**: `never`
34
+
29
35
  ### method
30
36
 
31
37
  > **method**: `"delete"`
@@ -34,6 +40,12 @@ Common item properties to use for identifying the context in which to delete the
34
40
 
35
41
  > `optional` **multiple**: `false`
36
42
 
43
+ ### offset?
44
+
45
+ > `optional` **offset**: `number`
46
+
47
+ Offset of the first matching item to delete.
48
+
37
49
  ### parameters?
38
50
 
39
51
  > `optional` **parameters**: [`Parameters`](Parameters.md)
@@ -48,4 +60,4 @@ Query settings.
48
60
 
49
61
  ## Defined in
50
62
 
51
- [lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryDelete.ts#L9)
63
+ [lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/QueryDelete.ts#L9)
@@ -26,6 +26,14 @@ Common item properties to use for identifying the context in which to delete the
26
26
 
27
27
  > `optional` **filter**: [`Filter`](Filter.md)\<`T`\>
28
28
 
29
+ Filter for finding the items to delete.
30
+
31
+ ### limit?
32
+
33
+ > `optional` **limit**: `number`
34
+
35
+ Upper bound of the number of items to delete.
36
+
29
37
  ### method
30
38
 
31
39
  > **method**: `"delete"`
@@ -34,6 +42,12 @@ Common item properties to use for identifying the context in which to delete the
34
42
 
35
43
  > **multiple**: `true`
36
44
 
45
+ ### offset?
46
+
47
+ > `optional` **offset**: `number`
48
+
49
+ Offset of the first matching item to delete.
50
+
37
51
  ### parameters?
38
52
 
39
53
  > `optional` **parameters**: [`Parameters`](Parameters.md)
@@ -48,4 +62,4 @@ Query settings.
48
62
 
49
63
  ## Defined in
50
64
 
51
- [lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryDeleteMultiple.ts#L9)
65
+ [lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryMethod.ts#L6)
15
+ [lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryRead.ts#L10)
79
+ [lib/types/QueryRead.ts:10](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/QueryRead.ts#L10)
@@ -32,7 +32,7 @@ Item fields to pick. If omitted, all fields are picked.
32
32
 
33
33
  > `optional` **filter**: [`Filter`](Filter.md)\<`T`\>
34
34
 
35
- Filter that picks the items.
35
+ Filter for finding the items.
36
36
 
37
37
  ### group?
38
38
 
@@ -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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryReadMultiple.ts#L11)
83
+ [lib/types/QueryReadMultiple.ts:11](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/QueryReadMultiple.ts#L11)
@@ -80,4 +80,4 @@ A filter that captures the items expressed by the provided `FilterChildren`.
80
80
 
81
81
  ## Defined in
82
82
 
83
- [lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QuerySettings.ts#L8)
83
+ [lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/QuerySettings.ts#L8)
@@ -44,9 +44,9 @@ Filter for finding the item, if it cannot be found based on the `context`.
44
44
 
45
45
  > `optional` **offset**: `never`
46
46
 
47
- ### order
47
+ ### order?
48
48
 
49
- > **order**: `never`
49
+ > `optional` **order**: `never`
50
50
 
51
51
  ### parameters?
52
52
 
@@ -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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryUpdate.ts#L9)
71
+ [lib/types/QueryUpdate.ts:9](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/QueryUpdate.ts#L9)
@@ -26,6 +26,8 @@ Common item properties to use for identifying the context in which to update the
26
26
 
27
27
  > `optional` **filter**: [`Filter`](Filter.md)\<`T`\>
28
28
 
29
+ Filter for finding the items to update.
30
+
29
31
  ### limit?
30
32
 
31
33
  > `optional` **limit**: `number`
@@ -72,4 +74,4 @@ Partial property values to update.
72
74
 
73
75
  ## Defined in
74
76
 
75
- [lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/QueryUpdateMultiple.ts#L10)
77
+ [lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Result.ts#L20)
19
+ [lib/types/Result.ts:20](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Store.ts#L2)
71
+ [lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/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/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/Value.ts#L6)
39
+ [lib/types/Value.ts:6](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/Value.ts#L6)
@@ -18,4 +18,4 @@ Maps the properties of the provided value `T` to a specific value `V`.
18
18
 
19
19
  ## Defined in
20
20
 
21
- [lib/types/ValueMap.ts:6](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/types/ValueMap.ts#L6)
21
+ [lib/types/ValueMap.ts:6](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/types/ValueMap.ts#L6)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/constants/CACHE.ts:1](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/constants/CACHE.ts#L1)
13
+ [lib/constants/CACHE.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/constants/CACHE.ts#L1)
@@ -10,4 +10,4 @@
10
10
 
11
11
  ## Defined in
12
12
 
13
- [lib/constants/SELF.ts:1](https://github.com/nevoland/quetch/blob/a3ccd863643bdab12f1ae3f17b69623aaeed1b9f/lib/constants/SELF.ts#L1)
13
+ [lib/constants/SELF.ts:1](https://github.com/nevoland/quetch/blob/9da567b909b330487e6cd515ad713dcc58d03ec9/lib/constants/SELF.ts#L1)
@@ -1,22 +1,22 @@
1
1
  import { EMPTY_ARRAY } from "unchangeable";
2
2
 
3
3
  import { SELF } from "../constants/SELF.js";
4
- import type { Context, Filter } from "../types.js";
4
+ import type { Filter } from "../types.js";
5
5
 
6
6
  const { entries } = Object;
7
7
 
8
- export function filterFromValue<T>(context: Context<T>): Filter<T> {
8
+ export function filterFromValue<T>(value: T): Filter<T> {
9
9
  return {
10
10
  operator: "all",
11
- value: criteria(context),
11
+ value: criteria(value),
12
12
  };
13
13
  }
14
14
 
15
15
  function criteria<T>(
16
- context: object,
16
+ value: T,
17
17
  path: readonly string[] = EMPTY_ARRAY,
18
18
  ): readonly Filter<T>[] {
19
- return entriesAndSelf(context).flatMap(([field, value]) => {
19
+ return entriesAndSelf(value).flatMap(([field, value]) => {
20
20
  switch (typeof value) {
21
21
  case "symbol":
22
22
  return [
@@ -48,7 +48,7 @@ function criteria<T>(
48
48
  } as Filter<T>,
49
49
  ];
50
50
  }
51
- return criteria(value, [...path, field as string]);
51
+ return criteria<T>(value, [...path, field as string]);
52
52
  }
53
53
  default:
54
54
  return EMPTY_ARRAY;
@@ -57,12 +57,26 @@ function criteria<T>(
57
57
  });
58
58
  }
59
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]]);
60
+ function entriesAndSelf<T>(value: T): readonly [string | typeof SELF, any][] {
61
+ switch (typeof value) {
62
+ case "symbol":
63
+ case "bigint":
64
+ case "string":
65
+ case "number":
66
+ case "boolean":
67
+ case "undefined":
68
+ return [[SELF, value]];
69
+ case "object": {
70
+ if (value == null) {
71
+ return [[SELF, value]];
72
+ }
73
+ const result = entries(value) as [string | typeof SELF, any][];
74
+ if (SELF in value) {
75
+ result.push([SELF, value[SELF]]);
76
+ }
77
+ return result;
78
+ }
79
+ default:
80
+ return EMPTY_ARRAY;
66
81
  }
67
- return result;
68
82
  }
@@ -22,11 +22,11 @@ function mergeContextAndFilter<T>(
22
22
  return filter ?? { operator: "any" };
23
23
  }
24
24
  if (filter === undefined) {
25
- return filterFromValue(context);
25
+ return filterFromValue(context as T);
26
26
  }
27
27
  return {
28
28
  operator: "all",
29
- value: [filterFromValue(context), filter],
29
+ value: [filterFromValue(context as T), filter],
30
30
  };
31
31
  }
32
32
 
@@ -13,7 +13,15 @@ export type QueryDelete<T> = {
13
13
  * Common item properties to use for identifying the context in which to delete the item.
14
14
  */
15
15
  context?: Context<T>;
16
+ /**
17
+ * Filter for finding the item, if it cannot be found based on the `context`.
18
+ */
16
19
  filter?: Filter<T>;
20
+ /**
21
+ * Offset of the first matching item to delete.
22
+ */
23
+ offset?: number;
24
+ limit?: never;
17
25
  /**
18
26
  * Query parameters.
19
27
  */
@@ -13,7 +13,18 @@ export type QueryDeleteMultiple<T> = {
13
13
  * Common item properties to use for identifying the context in which to delete the item.
14
14
  */
15
15
  context?: Context<T>;
16
+ /**
17
+ * Filter for finding the items to delete.
18
+ */
16
19
  filter?: Filter<T>;
20
+ /**
21
+ * Offset of the first matching item to delete.
22
+ */
23
+ offset?: number;
24
+ /**
25
+ * Upper bound of the number of items to delete.
26
+ */
27
+ limit?: number;
17
28
  /**
18
29
  * Query parameters.
19
30
  */
@@ -28,7 +28,7 @@ export type QueryReadMultiple<T> = {
28
28
  */
29
29
  fields?: readonly (keyof T)[];
30
30
  /**
31
- * Filter that picks the items.
31
+ * Filter for finding the items.
32
32
  */
33
33
  filter?: Filter<T>;
34
34
  /**
@@ -22,7 +22,7 @@ export type QueryUpdate<T> = {
22
22
  */
23
23
  filter?: Filter<T>;
24
24
  offset?: never;
25
- order: never;
25
+ order?: never;
26
26
  group?: never;
27
27
  /**
28
28
  * Query parameters.
@@ -18,6 +18,9 @@ export type QueryUpdateMultiple<T> = {
18
18
  * Partial property values to update.
19
19
  */
20
20
  value: readonly Partial<T>[];
21
+ /**
22
+ * Filter for finding the items to update.
23
+ */
21
24
  filter?: Filter<T>;
22
25
  /**
23
26
  * Order by which the items should be sorted.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quetch",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "main": "./dist/main.js",
6
6
  "exports": {