quetch 0.4.0 → 0.5.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/types/Query.d.ts +20 -1
- package/dist/types/QueryCreate.d.ts +1 -0
- package/dist/types/QueryDelete.d.ts +1 -0
- package/dist/types/QueryUpdate.d.ts +1 -0
- package/doc/README.md +70 -65
- package/doc/interfaces/GenericFetch.md +2 -2
- package/lib/types/Query.ts +18 -1
- package/lib/types/QueryCreate.ts +1 -0
- package/lib/types/QueryDelete.ts +1 -0
- package/lib/types/QueryUpdate.ts +1 -0
- package/package.json +1 -1
package/dist/types/Query.d.ts
CHANGED
|
@@ -14,7 +14,26 @@ type QueryBase<T extends object> = QueryRead<T> | QueryReadMultiple<T> | QueryCr
|
|
|
14
14
|
/**
|
|
15
15
|
* Query that fetches or mutates an entity.
|
|
16
16
|
*/
|
|
17
|
-
export type Query<
|
|
17
|
+
export type Query<
|
|
18
|
+
/**
|
|
19
|
+
* Type.
|
|
20
|
+
*/
|
|
21
|
+
T extends object,
|
|
22
|
+
/**
|
|
23
|
+
* Custom fields.
|
|
24
|
+
*/
|
|
25
|
+
C extends CustomFieldMap<T> | undefined,
|
|
26
|
+
/**
|
|
27
|
+
* Methods.
|
|
28
|
+
*/
|
|
29
|
+
M extends QueryBase<never>["method"] = QueryBase<never>["method"],
|
|
30
|
+
/**
|
|
31
|
+
* Multiple.
|
|
32
|
+
*/
|
|
33
|
+
L extends boolean | undefined = boolean> = Extract<QueryBase<InjectCustomFields<T, C>>, {
|
|
34
|
+
method?: M;
|
|
35
|
+
multiple?: L;
|
|
36
|
+
}> & {
|
|
18
37
|
/**
|
|
19
38
|
* Common item properties to use for identifying the item.
|
|
20
39
|
*/
|
package/doc/README.md
CHANGED
|
@@ -94,7 +94,7 @@ Aggregation function.
|
|
|
94
94
|
|
|
95
95
|
#### Defined in
|
|
96
96
|
|
|
97
|
-
[lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
97
|
+
[lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/AggregateFunction.ts#L4)
|
|
98
98
|
|
|
99
99
|
___
|
|
100
100
|
|
|
@@ -104,7 +104,7 @@ ___
|
|
|
104
104
|
|
|
105
105
|
#### Defined in
|
|
106
106
|
|
|
107
|
-
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
107
|
+
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/AggregateFunctionOperator.ts#L3)
|
|
108
108
|
|
|
109
109
|
___
|
|
110
110
|
|
|
@@ -114,7 +114,7 @@ ___
|
|
|
114
114
|
|
|
115
115
|
#### Defined in
|
|
116
116
|
|
|
117
|
-
[lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/
|
|
117
|
+
[lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Any.ts#L1)
|
|
118
118
|
|
|
119
119
|
___
|
|
120
120
|
|
|
@@ -130,7 +130,7 @@ ___
|
|
|
130
130
|
|
|
131
131
|
#### Defined in
|
|
132
132
|
|
|
133
|
-
[lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/
|
|
133
|
+
[lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Context.ts#L1)
|
|
134
134
|
|
|
135
135
|
___
|
|
136
136
|
|
|
@@ -146,7 +146,7 @@ ___
|
|
|
146
146
|
|
|
147
147
|
#### Defined in
|
|
148
148
|
|
|
149
|
-
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
149
|
+
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/CustomFieldAggregateMap.ts#L3)
|
|
150
150
|
|
|
151
151
|
___
|
|
152
152
|
|
|
@@ -162,7 +162,7 @@ ___
|
|
|
162
162
|
|
|
163
163
|
#### Defined in
|
|
164
164
|
|
|
165
|
-
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
165
|
+
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/CustomFieldMap.ts#L3)
|
|
166
166
|
|
|
167
167
|
___
|
|
168
168
|
|
|
@@ -188,7 +188,7 @@ ___
|
|
|
188
188
|
|
|
189
189
|
#### Defined in
|
|
190
190
|
|
|
191
|
-
[lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/
|
|
191
|
+
[lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/CustomRequest.ts#L4)
|
|
192
192
|
|
|
193
193
|
___
|
|
194
194
|
|
|
@@ -204,7 +204,7 @@ ___
|
|
|
204
204
|
|
|
205
205
|
#### Defined in
|
|
206
206
|
|
|
207
|
-
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
207
|
+
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FieldFunction.ts#L4)
|
|
208
208
|
|
|
209
209
|
___
|
|
210
210
|
|
|
@@ -229,7 +229,7 @@ Applies a custom field transform function.
|
|
|
229
229
|
|
|
230
230
|
#### Defined in
|
|
231
231
|
|
|
232
|
-
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/
|
|
232
|
+
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FieldFunctionCustom.ts#L4)
|
|
233
233
|
|
|
234
234
|
___
|
|
235
235
|
|
|
@@ -255,7 +255,7 @@ Formats the date found in a given field, which can be an ISO string date or a ti
|
|
|
255
255
|
|
|
256
256
|
#### Defined in
|
|
257
257
|
|
|
258
|
-
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/
|
|
258
|
+
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FieldFunctionFormatDate.ts#L6)
|
|
259
259
|
|
|
260
260
|
___
|
|
261
261
|
|
|
@@ -273,7 +273,7 @@ Return types of custom field functions.
|
|
|
273
273
|
|
|
274
274
|
#### Defined in
|
|
275
275
|
|
|
276
|
-
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/
|
|
276
|
+
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FieldFunctionReturn.ts#L4)
|
|
277
277
|
|
|
278
278
|
___
|
|
279
279
|
|
|
@@ -291,7 +291,7 @@ Describes a predicate for filtering items.
|
|
|
291
291
|
|
|
292
292
|
#### Defined in
|
|
293
293
|
|
|
294
|
-
[lib/types/Filter.ts:12](https://github.com/nevoland/quetch/blob/
|
|
294
|
+
[lib/types/Filter.ts:12](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Filter.ts#L12)
|
|
295
295
|
|
|
296
296
|
___
|
|
297
297
|
|
|
@@ -318,7 +318,7 @@ Checks if a given array field matches a given array value according to a given o
|
|
|
318
318
|
|
|
319
319
|
#### Defined in
|
|
320
320
|
|
|
321
|
-
[lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/
|
|
321
|
+
[lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterArray.ts#L7)
|
|
322
322
|
|
|
323
323
|
___
|
|
324
324
|
|
|
@@ -344,7 +344,7 @@ Checks if a given boolean field is `true` or `false`.
|
|
|
344
344
|
|
|
345
345
|
#### Defined in
|
|
346
346
|
|
|
347
|
-
[lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/
|
|
347
|
+
[lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterBoolean.ts#L6)
|
|
348
348
|
|
|
349
349
|
___
|
|
350
350
|
|
|
@@ -369,7 +369,7 @@ Checks if a given field exists.
|
|
|
369
369
|
|
|
370
370
|
#### Defined in
|
|
371
371
|
|
|
372
|
-
[lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/
|
|
372
|
+
[lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterField.ts#L4)
|
|
373
373
|
|
|
374
374
|
___
|
|
375
375
|
|
|
@@ -388,7 +388,7 @@ Returns object type with field extending the provided `P` type.
|
|
|
388
388
|
|
|
389
389
|
#### Defined in
|
|
390
390
|
|
|
391
|
-
[lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/
|
|
391
|
+
[lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterKeys.ts#L4)
|
|
392
392
|
|
|
393
393
|
___
|
|
394
394
|
|
|
@@ -414,7 +414,7 @@ Checks if a given number field matches a given number value according to a given
|
|
|
414
414
|
|
|
415
415
|
#### Defined in
|
|
416
416
|
|
|
417
|
-
[lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/
|
|
417
|
+
[lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterNumber.ts#L6)
|
|
418
418
|
|
|
419
419
|
___
|
|
420
420
|
|
|
@@ -424,7 +424,7 @@ ___
|
|
|
424
424
|
|
|
425
425
|
#### Defined in
|
|
426
426
|
|
|
427
|
-
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
427
|
+
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterOperator.ts#L3)
|
|
428
428
|
|
|
429
429
|
___
|
|
430
430
|
|
|
@@ -442,7 +442,7 @@ Joins a list of filters with a specific boolean operator.
|
|
|
442
442
|
|
|
443
443
|
#### Defined in
|
|
444
444
|
|
|
445
|
-
[lib/types/FilterSequence.ts:6](https://github.com/nevoland/quetch/blob/
|
|
445
|
+
[lib/types/FilterSequence.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterSequence.ts#L6)
|
|
446
446
|
|
|
447
447
|
___
|
|
448
448
|
|
|
@@ -468,7 +468,7 @@ Checks if a given string field matches a given string value according to a given
|
|
|
468
468
|
|
|
469
469
|
#### Defined in
|
|
470
470
|
|
|
471
|
-
[lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/
|
|
471
|
+
[lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterString.ts#L6)
|
|
472
472
|
|
|
473
473
|
___
|
|
474
474
|
|
|
@@ -494,7 +494,7 @@ Checks if a given string field has any of the provided values.
|
|
|
494
494
|
|
|
495
495
|
#### Defined in
|
|
496
496
|
|
|
497
|
-
[lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/
|
|
497
|
+
[lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterStringIntersect.ts#L6)
|
|
498
498
|
|
|
499
499
|
___
|
|
500
500
|
|
|
@@ -524,7 +524,7 @@ Checks if a given string field matches a given regular expression.
|
|
|
524
524
|
|
|
525
525
|
#### Defined in
|
|
526
526
|
|
|
527
|
-
[lib/types/FilterStringMatch.ts:6](https://github.com/nevoland/quetch/blob/
|
|
527
|
+
[lib/types/FilterStringMatch.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/FilterStringMatch.ts#L6)
|
|
528
528
|
|
|
529
529
|
___
|
|
530
530
|
|
|
@@ -544,7 +544,7 @@ Returns the type of the property at the specified `K` key.
|
|
|
544
544
|
|
|
545
545
|
#### Defined in
|
|
546
546
|
|
|
547
|
-
[lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/
|
|
547
|
+
[lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Get.ts#L4)
|
|
548
548
|
|
|
549
549
|
___
|
|
550
550
|
|
|
@@ -562,7 +562,7 @@ Specifies how items should be grouped.
|
|
|
562
562
|
|
|
563
563
|
#### Defined in
|
|
564
564
|
|
|
565
|
-
[lib/types/Group.ts:6](https://github.com/nevoland/quetch/blob/
|
|
565
|
+
[lib/types/Group.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Group.ts#L6)
|
|
566
566
|
|
|
567
567
|
___
|
|
568
568
|
|
|
@@ -598,7 +598,7 @@ Handles an `input` query and returns an `output` promise, eventually using the `
|
|
|
598
598
|
|
|
599
599
|
#### Defined in
|
|
600
600
|
|
|
601
|
-
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/
|
|
601
|
+
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Handler.ts#L6)
|
|
602
602
|
|
|
603
603
|
___
|
|
604
604
|
|
|
@@ -614,7 +614,7 @@ ___
|
|
|
614
614
|
|
|
615
615
|
#### Defined in
|
|
616
616
|
|
|
617
|
-
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
617
|
+
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Immutable.ts#L1)
|
|
618
618
|
|
|
619
619
|
___
|
|
620
620
|
|
|
@@ -633,7 +633,7 @@ Injects the custom fields into the entity type.
|
|
|
633
633
|
|
|
634
634
|
#### Defined in
|
|
635
635
|
|
|
636
|
-
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/
|
|
636
|
+
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/InjectCustomFields.ts#L8)
|
|
637
637
|
|
|
638
638
|
___
|
|
639
639
|
|
|
@@ -652,7 +652,7 @@ Returns the inferred item type of an array, or an alternative type if it is some
|
|
|
652
652
|
|
|
653
653
|
#### Defined in
|
|
654
654
|
|
|
655
|
-
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/
|
|
655
|
+
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Item.ts#L4)
|
|
656
656
|
|
|
657
657
|
___
|
|
658
658
|
|
|
@@ -662,7 +662,7 @@ ___
|
|
|
662
662
|
|
|
663
663
|
#### Defined in
|
|
664
664
|
|
|
665
|
-
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/
|
|
665
|
+
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Key.ts#L1)
|
|
666
666
|
|
|
667
667
|
___
|
|
668
668
|
|
|
@@ -678,7 +678,7 @@ ___
|
|
|
678
678
|
|
|
679
679
|
#### Defined in
|
|
680
680
|
|
|
681
|
-
[lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
681
|
+
[lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Mutable.ts#L1)
|
|
682
682
|
|
|
683
683
|
___
|
|
684
684
|
|
|
@@ -711,7 +711,7 @@ Handles an `input` query and returns an `output` promise.
|
|
|
711
711
|
|
|
712
712
|
#### Defined in
|
|
713
713
|
|
|
714
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
714
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/NextHandler.ts#L4)
|
|
715
715
|
|
|
716
716
|
___
|
|
717
717
|
|
|
@@ -729,13 +729,13 @@ Order item.
|
|
|
729
729
|
|
|
730
730
|
#### Defined in
|
|
731
731
|
|
|
732
|
-
[lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/
|
|
732
|
+
[lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Order.ts#L4)
|
|
733
733
|
|
|
734
734
|
___
|
|
735
735
|
|
|
736
736
|
### Query
|
|
737
737
|
|
|
738
|
-
Ƭ **Query**<`T`, `C`\>: `QueryBase`<[`InjectCustomFields`](README.md#injectcustomfields)<`T`, `C
|
|
738
|
+
Ƭ **Query**<`T`, `C`, `M`, `L`\>: `Extract`<`QueryBase`<[`InjectCustomFields`](README.md#injectcustomfields)<`T`, `C`\>\>, { `method?`: `M` ; `multiple?`: `L` }\> & { `context?`: [`Context`](README.md#context)<`T`\> }
|
|
739
739
|
|
|
740
740
|
Query that fetches or mutates an entity.
|
|
741
741
|
|
|
@@ -745,10 +745,12 @@ Query that fetches or mutates an entity.
|
|
|
745
745
|
| :------ | :------ |
|
|
746
746
|
| `T` | extends `object` |
|
|
747
747
|
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> \| `undefined` |
|
|
748
|
+
| `M` | extends `QueryBase`<`never`\>[``"method"``] = `QueryBase`<`never`\>[``"method"``] |
|
|
749
|
+
| `L` | extends `boolean` \| `undefined` = `boolean` |
|
|
748
750
|
|
|
749
751
|
#### Defined in
|
|
750
752
|
|
|
751
|
-
[lib/types/Query.ts:28](https://github.com/nevoland/quetch/blob/
|
|
753
|
+
[lib/types/Query.ts:28](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Query.ts#L28)
|
|
752
754
|
|
|
753
755
|
___
|
|
754
756
|
|
|
@@ -774,7 +776,7 @@ Query for computing an aggregated value.
|
|
|
774
776
|
|
|
775
777
|
#### Defined in
|
|
776
778
|
|
|
777
|
-
[lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/
|
|
779
|
+
[lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryAggregate.ts#L7)
|
|
778
780
|
|
|
779
781
|
___
|
|
780
782
|
|
|
@@ -784,7 +786,7 @@ ___
|
|
|
784
786
|
|
|
785
787
|
#### Defined in
|
|
786
788
|
|
|
787
|
-
[lib/types/QueryAny.ts:5](https://github.com/nevoland/quetch/blob/
|
|
789
|
+
[lib/types/QueryAny.ts:5](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryAny.ts#L5)
|
|
788
790
|
|
|
789
791
|
___
|
|
790
792
|
|
|
@@ -805,11 +807,12 @@ Query for creating an item.
|
|
|
805
807
|
| Name | Type |
|
|
806
808
|
| :------ | :------ |
|
|
807
809
|
| `method` | ``"create"`` |
|
|
810
|
+
| `multiple?` | ``false`` |
|
|
808
811
|
| `value` | `Partial`<`T`\> |
|
|
809
812
|
|
|
810
813
|
#### Defined in
|
|
811
814
|
|
|
812
|
-
[lib/types/QueryCreate.ts:4](https://github.com/nevoland/quetch/blob/
|
|
815
|
+
[lib/types/QueryCreate.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryCreate.ts#L4)
|
|
813
816
|
|
|
814
817
|
___
|
|
815
818
|
|
|
@@ -835,7 +838,7 @@ Query for creating multiple items.
|
|
|
835
838
|
|
|
836
839
|
#### Defined in
|
|
837
840
|
|
|
838
|
-
[lib/types/QueryCreateMultiple.ts:4](https://github.com/nevoland/quetch/blob/
|
|
841
|
+
[lib/types/QueryCreateMultiple.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryCreateMultiple.ts#L4)
|
|
839
842
|
|
|
840
843
|
___
|
|
841
844
|
|
|
@@ -858,10 +861,11 @@ Query for deleting an item.
|
|
|
858
861
|
| `customFields?` | [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
859
862
|
| `filter?` | [`Filter`](README.md#filter)<`T`\> |
|
|
860
863
|
| `method` | ``"delete"`` |
|
|
864
|
+
| `multiple?` | ``false`` |
|
|
861
865
|
|
|
862
866
|
#### Defined in
|
|
863
867
|
|
|
864
|
-
[lib/types/QueryDelete.ts:7](https://github.com/nevoland/quetch/blob/
|
|
868
|
+
[lib/types/QueryDelete.ts:7](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryDelete.ts#L7)
|
|
865
869
|
|
|
866
870
|
___
|
|
867
871
|
|
|
@@ -888,7 +892,7 @@ Query for deleting multiple items.
|
|
|
888
892
|
|
|
889
893
|
#### Defined in
|
|
890
894
|
|
|
891
|
-
[lib/types/QueryDeleteMultiple.ts:7](https://github.com/nevoland/quetch/blob/
|
|
895
|
+
[lib/types/QueryDeleteMultiple.ts:7](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryDeleteMultiple.ts#L7)
|
|
892
896
|
|
|
893
897
|
___
|
|
894
898
|
|
|
@@ -900,7 +904,7 @@ Available query methods.
|
|
|
900
904
|
|
|
901
905
|
#### Defined in
|
|
902
906
|
|
|
903
|
-
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/
|
|
907
|
+
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryMethod.ts#L6)
|
|
904
908
|
|
|
905
909
|
___
|
|
906
910
|
|
|
@@ -930,7 +934,7 @@ Query for reading a single item.
|
|
|
930
934
|
|
|
931
935
|
#### Defined in
|
|
932
936
|
|
|
933
|
-
[lib/types/QueryRead.ts:7](https://github.com/nevoland/quetch/blob/
|
|
937
|
+
[lib/types/QueryRead.ts:7](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryRead.ts#L7)
|
|
934
938
|
|
|
935
939
|
___
|
|
936
940
|
|
|
@@ -961,7 +965,7 @@ Query for getting a list of items.
|
|
|
961
965
|
|
|
962
966
|
#### Defined in
|
|
963
967
|
|
|
964
|
-
[lib/types/QueryReadMultiple.ts:8](https://github.com/nevoland/quetch/blob/
|
|
968
|
+
[lib/types/QueryReadMultiple.ts:8](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryReadMultiple.ts#L8)
|
|
965
969
|
|
|
966
970
|
___
|
|
967
971
|
|
|
@@ -984,13 +988,14 @@ Query for updating an item.
|
|
|
984
988
|
| `filter?` | [`Filter`](README.md#filter)<`T`\> | Filter for finding the item, if it cannot be found based on the `context`. |
|
|
985
989
|
| `group?` | `never` | - |
|
|
986
990
|
| `method` | ``"update"`` | - |
|
|
991
|
+
| `multiple?` | ``false`` | - |
|
|
987
992
|
| `offset?` | `never` | - |
|
|
988
993
|
| `order` | `never` | - |
|
|
989
994
|
| `value` | `Partial`<`T`\> | Partial property values to update. |
|
|
990
995
|
|
|
991
996
|
#### Defined in
|
|
992
997
|
|
|
993
|
-
[lib/types/QueryUpdate.ts:6](https://github.com/nevoland/quetch/blob/
|
|
998
|
+
[lib/types/QueryUpdate.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryUpdate.ts#L6)
|
|
994
999
|
|
|
995
1000
|
___
|
|
996
1001
|
|
|
@@ -1020,7 +1025,7 @@ Query for updating multiple items.
|
|
|
1020
1025
|
|
|
1021
1026
|
#### Defined in
|
|
1022
1027
|
|
|
1023
|
-
[lib/types/QueryUpdateMultiple.ts:7](https://github.com/nevoland/quetch/blob/
|
|
1028
|
+
[lib/types/QueryUpdateMultiple.ts:7](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/QueryUpdateMultiple.ts#L7)
|
|
1024
1029
|
|
|
1025
1030
|
___
|
|
1026
1031
|
|
|
@@ -1039,7 +1044,7 @@ ___
|
|
|
1039
1044
|
|
|
1040
1045
|
#### Defined in
|
|
1041
1046
|
|
|
1042
|
-
[lib/types/Result.ts:25](https://github.com/nevoland/quetch/blob/
|
|
1047
|
+
[lib/types/Result.ts:25](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Result.ts#L25)
|
|
1043
1048
|
|
|
1044
1049
|
___
|
|
1045
1050
|
|
|
@@ -1064,7 +1069,7 @@ ___
|
|
|
1064
1069
|
|
|
1065
1070
|
#### Defined in
|
|
1066
1071
|
|
|
1067
|
-
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/
|
|
1072
|
+
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/Store.ts#L2)
|
|
1068
1073
|
|
|
1069
1074
|
## Functions
|
|
1070
1075
|
|
|
@@ -1105,7 +1110,7 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
1105
1110
|
|
|
1106
1111
|
#### Defined in
|
|
1107
1112
|
|
|
1108
|
-
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/
|
|
1113
|
+
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/aggregate.ts#L16)
|
|
1109
1114
|
|
|
1110
1115
|
___
|
|
1111
1116
|
|
|
@@ -1147,7 +1152,7 @@ const customFetch = combine(
|
|
|
1147
1152
|
|
|
1148
1153
|
#### Defined in
|
|
1149
1154
|
|
|
1150
|
-
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/
|
|
1155
|
+
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/branch.ts#L21)
|
|
1151
1156
|
|
|
1152
1157
|
___
|
|
1153
1158
|
|
|
@@ -1176,7 +1181,7 @@ ___
|
|
|
1176
1181
|
|
|
1177
1182
|
#### Defined in
|
|
1178
1183
|
|
|
1179
|
-
[lib/middlewares/cache.ts:39](https://github.com/nevoland/quetch/blob/
|
|
1184
|
+
[lib/middlewares/cache.ts:39](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/cache.ts#L39)
|
|
1180
1185
|
|
|
1181
1186
|
___
|
|
1182
1187
|
|
|
@@ -1249,7 +1254,7 @@ Handler that combines all provided handlers.
|
|
|
1249
1254
|
|
|
1250
1255
|
#### Defined in
|
|
1251
1256
|
|
|
1252
|
-
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/
|
|
1257
|
+
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/combine.ts#L801)
|
|
1253
1258
|
|
|
1254
1259
|
___
|
|
1255
1260
|
|
|
@@ -1271,7 +1276,7 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
|
|
|
1271
1276
|
|
|
1272
1277
|
#### Defined in
|
|
1273
1278
|
|
|
1274
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
1279
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/NextHandler.ts#L4)
|
|
1275
1280
|
|
|
1276
1281
|
___
|
|
1277
1282
|
|
|
@@ -1336,7 +1341,7 @@ typeof `query`
|
|
|
1336
1341
|
|
|
1337
1342
|
#### Defined in
|
|
1338
1343
|
|
|
1339
|
-
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/
|
|
1344
|
+
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/defineCheckQuery.ts#L8)
|
|
1340
1345
|
|
|
1341
1346
|
___
|
|
1342
1347
|
|
|
@@ -1443,7 +1448,7 @@ ___
|
|
|
1443
1448
|
|
|
1444
1449
|
#### Defined in
|
|
1445
1450
|
|
|
1446
|
-
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/
|
|
1451
|
+
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/defineCustomFetch.ts#L11)
|
|
1447
1452
|
|
|
1448
1453
|
___
|
|
1449
1454
|
|
|
@@ -1518,7 +1523,7 @@ ___
|
|
|
1518
1523
|
|
|
1519
1524
|
#### Defined in
|
|
1520
1525
|
|
|
1521
|
-
[lib/tools/defineGenericFetch.ts:5](https://github.com/nevoland/quetch/blob/
|
|
1526
|
+
[lib/tools/defineGenericFetch.ts:5](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/defineGenericFetch.ts#L5)
|
|
1522
1527
|
|
|
1523
1528
|
___
|
|
1524
1529
|
|
|
@@ -1542,7 +1547,7 @@ Handler that returns a promise that resolves to the response.
|
|
|
1542
1547
|
|
|
1543
1548
|
#### Defined in
|
|
1544
1549
|
|
|
1545
|
-
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1550
|
+
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/fetchExternal.ts#L12)
|
|
1546
1551
|
|
|
1547
1552
|
___
|
|
1548
1553
|
|
|
@@ -1567,7 +1572,7 @@ Promise that resolves to the response.
|
|
|
1567
1572
|
|
|
1568
1573
|
#### Defined in
|
|
1569
1574
|
|
|
1570
|
-
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/
|
|
1575
|
+
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/fetchLocal.ts#L9)
|
|
1571
1576
|
|
|
1572
1577
|
___
|
|
1573
1578
|
|
|
@@ -1593,7 +1598,7 @@ ___
|
|
|
1593
1598
|
|
|
1594
1599
|
#### Defined in
|
|
1595
1600
|
|
|
1596
|
-
[lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/
|
|
1601
|
+
[lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/filterFromContext.ts#L5)
|
|
1597
1602
|
|
|
1598
1603
|
___
|
|
1599
1604
|
|
|
@@ -1624,7 +1629,7 @@ Checks wether the provided `value` matches the `filter` or not.
|
|
|
1624
1629
|
|
|
1625
1630
|
#### Defined in
|
|
1626
1631
|
|
|
1627
|
-
[lib/tools/filterItem.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1632
|
+
[lib/tools/filterItem.ts:12](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/filterItem.ts#L12)
|
|
1628
1633
|
|
|
1629
1634
|
___
|
|
1630
1635
|
|
|
@@ -1654,7 +1659,7 @@ ___
|
|
|
1654
1659
|
|
|
1655
1660
|
#### Defined in
|
|
1656
1661
|
|
|
1657
|
-
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/
|
|
1662
|
+
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/identity.ts#L3)
|
|
1658
1663
|
|
|
1659
1664
|
___
|
|
1660
1665
|
|
|
@@ -1687,7 +1692,7 @@ Query handler
|
|
|
1687
1692
|
|
|
1688
1693
|
#### Defined in
|
|
1689
1694
|
|
|
1690
|
-
[lib/middlewares/log.ts:11](https://github.com/nevoland/quetch/blob/
|
|
1695
|
+
[lib/middlewares/log.ts:11](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/log.ts#L11)
|
|
1691
1696
|
|
|
1692
1697
|
___
|
|
1693
1698
|
|
|
@@ -1718,7 +1723,7 @@ ___
|
|
|
1718
1723
|
|
|
1719
1724
|
#### Defined in
|
|
1720
1725
|
|
|
1721
|
-
[lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/
|
|
1726
|
+
[lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/normalizeOrder.ts#L3)
|
|
1722
1727
|
|
|
1723
1728
|
___
|
|
1724
1729
|
|
|
@@ -1745,7 +1750,7 @@ ___
|
|
|
1745
1750
|
|
|
1746
1751
|
#### Defined in
|
|
1747
1752
|
|
|
1748
|
-
[lib/tools/queryItemList.ts:41](https://github.com/nevoland/quetch/blob/
|
|
1753
|
+
[lib/tools/queryItemList.ts:41](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/queryItemList.ts#L41)
|
|
1749
1754
|
|
|
1750
1755
|
___
|
|
1751
1756
|
|
|
@@ -1774,7 +1779,7 @@ Handler
|
|
|
1774
1779
|
|
|
1775
1780
|
#### Defined in
|
|
1776
1781
|
|
|
1777
|
-
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/
|
|
1782
|
+
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/c839ceb/lib/middlewares/retry.ts#L15)
|
|
1778
1783
|
|
|
1779
1784
|
___
|
|
1780
1785
|
|
|
@@ -1805,4 +1810,4 @@ The same array sorted in place.
|
|
|
1805
1810
|
|
|
1806
1811
|
#### Defined in
|
|
1807
1812
|
|
|
1808
|
-
[lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1813
|
+
[lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/c839ceb/lib/tools/sortItemList.ts#L12)
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#### Defined in
|
|
34
34
|
|
|
35
|
-
[lib/types/GenericFetch.ts:6](https://github.com/nevoland/quetch/blob/
|
|
35
|
+
[lib/types/GenericFetch.ts:6](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/GenericFetch.ts#L6)
|
|
36
36
|
|
|
37
37
|
### GenericFetch
|
|
38
38
|
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
|
|
58
58
|
#### Defined in
|
|
59
59
|
|
|
60
|
-
[lib/types/GenericFetch.ts:9](https://github.com/nevoland/quetch/blob/
|
|
60
|
+
[lib/types/GenericFetch.ts:9](https://github.com/nevoland/quetch/blob/c839ceb/lib/types/GenericFetch.ts#L9)
|
package/lib/types/Query.ts
CHANGED
|
@@ -26,9 +26,26 @@ type QueryBase<T extends object> =
|
|
|
26
26
|
* Query that fetches or mutates an entity.
|
|
27
27
|
*/
|
|
28
28
|
export type Query<
|
|
29
|
+
/**
|
|
30
|
+
* Type.
|
|
31
|
+
*/
|
|
29
32
|
T extends object,
|
|
33
|
+
/**
|
|
34
|
+
* Custom fields.
|
|
35
|
+
*/
|
|
30
36
|
C extends CustomFieldMap<T> | undefined,
|
|
31
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Methods.
|
|
39
|
+
*/
|
|
40
|
+
M extends QueryBase<never>["method"] = QueryBase<never>["method"],
|
|
41
|
+
/**
|
|
42
|
+
* Multiple.
|
|
43
|
+
*/
|
|
44
|
+
L extends boolean | undefined = boolean,
|
|
45
|
+
> = Extract<
|
|
46
|
+
QueryBase<InjectCustomFields<T, C>>,
|
|
47
|
+
{ method?: M; multiple?: L }
|
|
48
|
+
> & {
|
|
32
49
|
/**
|
|
33
50
|
* Common item properties to use for identifying the item.
|
|
34
51
|
*/
|
package/lib/types/QueryCreate.ts
CHANGED
package/lib/types/QueryDelete.ts
CHANGED
package/lib/types/QueryUpdate.ts
CHANGED