quetch 0.3.0 → 0.4.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/GenericFetch.d.ts +11 -0
- package/dist/types/GenericFetch.js +2 -0
- package/dist/types/GenericFetch.js.map +1 -0
- package/dist/types.d.ts +1 -0
- package/doc/README.md +68 -64
- package/doc/interfaces/GenericFetch.md +60 -0
- package/lib/types/GenericFetch.ts +12 -0
- package/lib/types.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CustomFieldMap } from "./CustomFieldMap";
|
|
2
|
+
import type { Query } from "./Query";
|
|
3
|
+
import type { Result } from "./Result";
|
|
4
|
+
export interface GenericFetch<T extends object> {
|
|
5
|
+
<Q extends Query<T, {}>>(query: Q & {
|
|
6
|
+
customFields?: never;
|
|
7
|
+
}): Promise<Result<T, Q, {}>>;
|
|
8
|
+
<Q extends Query<T, C>, C extends CustomFieldMap<T>>(query: Q & {
|
|
9
|
+
customFields: C;
|
|
10
|
+
}): Promise<Result<T, Q, C>>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFetch.js","sourceRoot":"","sources":["../../lib/types/GenericFetch.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export type { FilterSequence } from "./types/FilterSequence";
|
|
|
20
20
|
export type { FilterString } from "./types/FilterString";
|
|
21
21
|
export type { FilterStringIntersect } from "./types/FilterStringIntersect";
|
|
22
22
|
export type { FilterStringMatch } from "./types/FilterStringMatch";
|
|
23
|
+
export type { GenericFetch } from "./types/GenericFetch";
|
|
23
24
|
export type { Get } from "./types/Get";
|
|
24
25
|
export type { Group } from "./types/Group";
|
|
25
26
|
export type { Handler } from "./types/Handler";
|
package/doc/README.md
CHANGED
|
@@ -4,6 +4,10 @@ quetch
|
|
|
4
4
|
|
|
5
5
|
## Table of contents
|
|
6
6
|
|
|
7
|
+
### Interfaces
|
|
8
|
+
|
|
9
|
+
- [GenericFetch](interfaces/GenericFetch.md)
|
|
10
|
+
|
|
7
11
|
### Type Aliases
|
|
8
12
|
|
|
9
13
|
- [AggregateFunction](README.md#aggregatefunction)
|
|
@@ -90,7 +94,7 @@ Aggregation function.
|
|
|
90
94
|
|
|
91
95
|
#### Defined in
|
|
92
96
|
|
|
93
|
-
[lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
97
|
+
[lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/AggregateFunction.ts#L4)
|
|
94
98
|
|
|
95
99
|
___
|
|
96
100
|
|
|
@@ -100,7 +104,7 @@ ___
|
|
|
100
104
|
|
|
101
105
|
#### Defined in
|
|
102
106
|
|
|
103
|
-
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
107
|
+
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/AggregateFunctionOperator.ts#L3)
|
|
104
108
|
|
|
105
109
|
___
|
|
106
110
|
|
|
@@ -110,7 +114,7 @@ ___
|
|
|
110
114
|
|
|
111
115
|
#### Defined in
|
|
112
116
|
|
|
113
|
-
[lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/
|
|
117
|
+
[lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Any.ts#L1)
|
|
114
118
|
|
|
115
119
|
___
|
|
116
120
|
|
|
@@ -126,7 +130,7 @@ ___
|
|
|
126
130
|
|
|
127
131
|
#### Defined in
|
|
128
132
|
|
|
129
|
-
[lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/
|
|
133
|
+
[lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Context.ts#L1)
|
|
130
134
|
|
|
131
135
|
___
|
|
132
136
|
|
|
@@ -142,7 +146,7 @@ ___
|
|
|
142
146
|
|
|
143
147
|
#### Defined in
|
|
144
148
|
|
|
145
|
-
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
149
|
+
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/CustomFieldAggregateMap.ts#L3)
|
|
146
150
|
|
|
147
151
|
___
|
|
148
152
|
|
|
@@ -158,7 +162,7 @@ ___
|
|
|
158
162
|
|
|
159
163
|
#### Defined in
|
|
160
164
|
|
|
161
|
-
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
165
|
+
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/CustomFieldMap.ts#L3)
|
|
162
166
|
|
|
163
167
|
___
|
|
164
168
|
|
|
@@ -184,7 +188,7 @@ ___
|
|
|
184
188
|
|
|
185
189
|
#### Defined in
|
|
186
190
|
|
|
187
|
-
[lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/
|
|
191
|
+
[lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/CustomRequest.ts#L4)
|
|
188
192
|
|
|
189
193
|
___
|
|
190
194
|
|
|
@@ -200,7 +204,7 @@ ___
|
|
|
200
204
|
|
|
201
205
|
#### Defined in
|
|
202
206
|
|
|
203
|
-
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
207
|
+
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FieldFunction.ts#L4)
|
|
204
208
|
|
|
205
209
|
___
|
|
206
210
|
|
|
@@ -225,7 +229,7 @@ Applies a custom field transform function.
|
|
|
225
229
|
|
|
226
230
|
#### Defined in
|
|
227
231
|
|
|
228
|
-
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/
|
|
232
|
+
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FieldFunctionCustom.ts#L4)
|
|
229
233
|
|
|
230
234
|
___
|
|
231
235
|
|
|
@@ -251,7 +255,7 @@ Formats the date found in a given field, which can be an ISO string date or a ti
|
|
|
251
255
|
|
|
252
256
|
#### Defined in
|
|
253
257
|
|
|
254
|
-
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/
|
|
258
|
+
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FieldFunctionFormatDate.ts#L6)
|
|
255
259
|
|
|
256
260
|
___
|
|
257
261
|
|
|
@@ -269,7 +273,7 @@ Return types of custom field functions.
|
|
|
269
273
|
|
|
270
274
|
#### Defined in
|
|
271
275
|
|
|
272
|
-
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/
|
|
276
|
+
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FieldFunctionReturn.ts#L4)
|
|
273
277
|
|
|
274
278
|
___
|
|
275
279
|
|
|
@@ -287,7 +291,7 @@ Describes a predicate for filtering items.
|
|
|
287
291
|
|
|
288
292
|
#### Defined in
|
|
289
293
|
|
|
290
|
-
[lib/types/Filter.ts:12](https://github.com/nevoland/quetch/blob/
|
|
294
|
+
[lib/types/Filter.ts:12](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Filter.ts#L12)
|
|
291
295
|
|
|
292
296
|
___
|
|
293
297
|
|
|
@@ -314,7 +318,7 @@ Checks if a given array field matches a given array value according to a given o
|
|
|
314
318
|
|
|
315
319
|
#### Defined in
|
|
316
320
|
|
|
317
|
-
[lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/
|
|
321
|
+
[lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterArray.ts#L7)
|
|
318
322
|
|
|
319
323
|
___
|
|
320
324
|
|
|
@@ -340,7 +344,7 @@ Checks if a given boolean field is `true` or `false`.
|
|
|
340
344
|
|
|
341
345
|
#### Defined in
|
|
342
346
|
|
|
343
|
-
[lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/
|
|
347
|
+
[lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterBoolean.ts#L6)
|
|
344
348
|
|
|
345
349
|
___
|
|
346
350
|
|
|
@@ -365,7 +369,7 @@ Checks if a given field exists.
|
|
|
365
369
|
|
|
366
370
|
#### Defined in
|
|
367
371
|
|
|
368
|
-
[lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/
|
|
372
|
+
[lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterField.ts#L4)
|
|
369
373
|
|
|
370
374
|
___
|
|
371
375
|
|
|
@@ -384,7 +388,7 @@ Returns object type with field extending the provided `P` type.
|
|
|
384
388
|
|
|
385
389
|
#### Defined in
|
|
386
390
|
|
|
387
|
-
[lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/
|
|
391
|
+
[lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterKeys.ts#L4)
|
|
388
392
|
|
|
389
393
|
___
|
|
390
394
|
|
|
@@ -410,7 +414,7 @@ Checks if a given number field matches a given number value according to a given
|
|
|
410
414
|
|
|
411
415
|
#### Defined in
|
|
412
416
|
|
|
413
|
-
[lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/
|
|
417
|
+
[lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterNumber.ts#L6)
|
|
414
418
|
|
|
415
419
|
___
|
|
416
420
|
|
|
@@ -420,7 +424,7 @@ ___
|
|
|
420
424
|
|
|
421
425
|
#### Defined in
|
|
422
426
|
|
|
423
|
-
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
427
|
+
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterOperator.ts#L3)
|
|
424
428
|
|
|
425
429
|
___
|
|
426
430
|
|
|
@@ -438,7 +442,7 @@ Joins a list of filters with a specific boolean operator.
|
|
|
438
442
|
|
|
439
443
|
#### Defined in
|
|
440
444
|
|
|
441
|
-
[lib/types/FilterSequence.ts:6](https://github.com/nevoland/quetch/blob/
|
|
445
|
+
[lib/types/FilterSequence.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterSequence.ts#L6)
|
|
442
446
|
|
|
443
447
|
___
|
|
444
448
|
|
|
@@ -464,7 +468,7 @@ Checks if a given string field matches a given string value according to a given
|
|
|
464
468
|
|
|
465
469
|
#### Defined in
|
|
466
470
|
|
|
467
|
-
[lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/
|
|
471
|
+
[lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterString.ts#L6)
|
|
468
472
|
|
|
469
473
|
___
|
|
470
474
|
|
|
@@ -490,7 +494,7 @@ Checks if a given string field has any of the provided values.
|
|
|
490
494
|
|
|
491
495
|
#### Defined in
|
|
492
496
|
|
|
493
|
-
[lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/
|
|
497
|
+
[lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterStringIntersect.ts#L6)
|
|
494
498
|
|
|
495
499
|
___
|
|
496
500
|
|
|
@@ -520,7 +524,7 @@ Checks if a given string field matches a given regular expression.
|
|
|
520
524
|
|
|
521
525
|
#### Defined in
|
|
522
526
|
|
|
523
|
-
[lib/types/FilterStringMatch.ts:6](https://github.com/nevoland/quetch/blob/
|
|
527
|
+
[lib/types/FilterStringMatch.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/FilterStringMatch.ts#L6)
|
|
524
528
|
|
|
525
529
|
___
|
|
526
530
|
|
|
@@ -540,7 +544,7 @@ Returns the type of the property at the specified `K` key.
|
|
|
540
544
|
|
|
541
545
|
#### Defined in
|
|
542
546
|
|
|
543
|
-
[lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/
|
|
547
|
+
[lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Get.ts#L4)
|
|
544
548
|
|
|
545
549
|
___
|
|
546
550
|
|
|
@@ -558,7 +562,7 @@ Specifies how items should be grouped.
|
|
|
558
562
|
|
|
559
563
|
#### Defined in
|
|
560
564
|
|
|
561
|
-
[lib/types/Group.ts:6](https://github.com/nevoland/quetch/blob/
|
|
565
|
+
[lib/types/Group.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Group.ts#L6)
|
|
562
566
|
|
|
563
567
|
___
|
|
564
568
|
|
|
@@ -594,7 +598,7 @@ Handles an `input` query and returns an `output` promise, eventually using the `
|
|
|
594
598
|
|
|
595
599
|
#### Defined in
|
|
596
600
|
|
|
597
|
-
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/
|
|
601
|
+
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Handler.ts#L6)
|
|
598
602
|
|
|
599
603
|
___
|
|
600
604
|
|
|
@@ -610,7 +614,7 @@ ___
|
|
|
610
614
|
|
|
611
615
|
#### Defined in
|
|
612
616
|
|
|
613
|
-
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
617
|
+
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Immutable.ts#L1)
|
|
614
618
|
|
|
615
619
|
___
|
|
616
620
|
|
|
@@ -629,7 +633,7 @@ Injects the custom fields into the entity type.
|
|
|
629
633
|
|
|
630
634
|
#### Defined in
|
|
631
635
|
|
|
632
|
-
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/
|
|
636
|
+
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/InjectCustomFields.ts#L8)
|
|
633
637
|
|
|
634
638
|
___
|
|
635
639
|
|
|
@@ -648,7 +652,7 @@ Returns the inferred item type of an array, or an alternative type if it is some
|
|
|
648
652
|
|
|
649
653
|
#### Defined in
|
|
650
654
|
|
|
651
|
-
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/
|
|
655
|
+
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Item.ts#L4)
|
|
652
656
|
|
|
653
657
|
___
|
|
654
658
|
|
|
@@ -658,7 +662,7 @@ ___
|
|
|
658
662
|
|
|
659
663
|
#### Defined in
|
|
660
664
|
|
|
661
|
-
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/
|
|
665
|
+
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Key.ts#L1)
|
|
662
666
|
|
|
663
667
|
___
|
|
664
668
|
|
|
@@ -674,7 +678,7 @@ ___
|
|
|
674
678
|
|
|
675
679
|
#### Defined in
|
|
676
680
|
|
|
677
|
-
[lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
681
|
+
[lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Mutable.ts#L1)
|
|
678
682
|
|
|
679
683
|
___
|
|
680
684
|
|
|
@@ -707,7 +711,7 @@ Handles an `input` query and returns an `output` promise.
|
|
|
707
711
|
|
|
708
712
|
#### Defined in
|
|
709
713
|
|
|
710
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
714
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/NextHandler.ts#L4)
|
|
711
715
|
|
|
712
716
|
___
|
|
713
717
|
|
|
@@ -725,7 +729,7 @@ Order item.
|
|
|
725
729
|
|
|
726
730
|
#### Defined in
|
|
727
731
|
|
|
728
|
-
[lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/
|
|
732
|
+
[lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Order.ts#L4)
|
|
729
733
|
|
|
730
734
|
___
|
|
731
735
|
|
|
@@ -744,7 +748,7 @@ Query that fetches or mutates an entity.
|
|
|
744
748
|
|
|
745
749
|
#### Defined in
|
|
746
750
|
|
|
747
|
-
[lib/types/Query.ts:28](https://github.com/nevoland/quetch/blob/
|
|
751
|
+
[lib/types/Query.ts:28](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Query.ts#L28)
|
|
748
752
|
|
|
749
753
|
___
|
|
750
754
|
|
|
@@ -770,7 +774,7 @@ Query for computing an aggregated value.
|
|
|
770
774
|
|
|
771
775
|
#### Defined in
|
|
772
776
|
|
|
773
|
-
[lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/
|
|
777
|
+
[lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryAggregate.ts#L7)
|
|
774
778
|
|
|
775
779
|
___
|
|
776
780
|
|
|
@@ -780,7 +784,7 @@ ___
|
|
|
780
784
|
|
|
781
785
|
#### Defined in
|
|
782
786
|
|
|
783
|
-
[lib/types/QueryAny.ts:5](https://github.com/nevoland/quetch/blob/
|
|
787
|
+
[lib/types/QueryAny.ts:5](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryAny.ts#L5)
|
|
784
788
|
|
|
785
789
|
___
|
|
786
790
|
|
|
@@ -805,7 +809,7 @@ Query for creating an item.
|
|
|
805
809
|
|
|
806
810
|
#### Defined in
|
|
807
811
|
|
|
808
|
-
[lib/types/QueryCreate.ts:4](https://github.com/nevoland/quetch/blob/
|
|
812
|
+
[lib/types/QueryCreate.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryCreate.ts#L4)
|
|
809
813
|
|
|
810
814
|
___
|
|
811
815
|
|
|
@@ -831,7 +835,7 @@ Query for creating multiple items.
|
|
|
831
835
|
|
|
832
836
|
#### Defined in
|
|
833
837
|
|
|
834
|
-
[lib/types/QueryCreateMultiple.ts:4](https://github.com/nevoland/quetch/blob/
|
|
838
|
+
[lib/types/QueryCreateMultiple.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryCreateMultiple.ts#L4)
|
|
835
839
|
|
|
836
840
|
___
|
|
837
841
|
|
|
@@ -857,7 +861,7 @@ Query for deleting an item.
|
|
|
857
861
|
|
|
858
862
|
#### Defined in
|
|
859
863
|
|
|
860
|
-
[lib/types/QueryDelete.ts:7](https://github.com/nevoland/quetch/blob/
|
|
864
|
+
[lib/types/QueryDelete.ts:7](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryDelete.ts#L7)
|
|
861
865
|
|
|
862
866
|
___
|
|
863
867
|
|
|
@@ -884,7 +888,7 @@ Query for deleting multiple items.
|
|
|
884
888
|
|
|
885
889
|
#### Defined in
|
|
886
890
|
|
|
887
|
-
[lib/types/QueryDeleteMultiple.ts:7](https://github.com/nevoland/quetch/blob/
|
|
891
|
+
[lib/types/QueryDeleteMultiple.ts:7](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryDeleteMultiple.ts#L7)
|
|
888
892
|
|
|
889
893
|
___
|
|
890
894
|
|
|
@@ -896,7 +900,7 @@ Available query methods.
|
|
|
896
900
|
|
|
897
901
|
#### Defined in
|
|
898
902
|
|
|
899
|
-
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/
|
|
903
|
+
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryMethod.ts#L6)
|
|
900
904
|
|
|
901
905
|
___
|
|
902
906
|
|
|
@@ -926,7 +930,7 @@ Query for reading a single item.
|
|
|
926
930
|
|
|
927
931
|
#### Defined in
|
|
928
932
|
|
|
929
|
-
[lib/types/QueryRead.ts:7](https://github.com/nevoland/quetch/blob/
|
|
933
|
+
[lib/types/QueryRead.ts:7](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryRead.ts#L7)
|
|
930
934
|
|
|
931
935
|
___
|
|
932
936
|
|
|
@@ -957,7 +961,7 @@ Query for getting a list of items.
|
|
|
957
961
|
|
|
958
962
|
#### Defined in
|
|
959
963
|
|
|
960
|
-
[lib/types/QueryReadMultiple.ts:8](https://github.com/nevoland/quetch/blob/
|
|
964
|
+
[lib/types/QueryReadMultiple.ts:8](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryReadMultiple.ts#L8)
|
|
961
965
|
|
|
962
966
|
___
|
|
963
967
|
|
|
@@ -986,7 +990,7 @@ Query for updating an item.
|
|
|
986
990
|
|
|
987
991
|
#### Defined in
|
|
988
992
|
|
|
989
|
-
[lib/types/QueryUpdate.ts:6](https://github.com/nevoland/quetch/blob/
|
|
993
|
+
[lib/types/QueryUpdate.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryUpdate.ts#L6)
|
|
990
994
|
|
|
991
995
|
___
|
|
992
996
|
|
|
@@ -1016,7 +1020,7 @@ Query for updating multiple items.
|
|
|
1016
1020
|
|
|
1017
1021
|
#### Defined in
|
|
1018
1022
|
|
|
1019
|
-
[lib/types/QueryUpdateMultiple.ts:7](https://github.com/nevoland/quetch/blob/
|
|
1023
|
+
[lib/types/QueryUpdateMultiple.ts:7](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/QueryUpdateMultiple.ts#L7)
|
|
1020
1024
|
|
|
1021
1025
|
___
|
|
1022
1026
|
|
|
@@ -1035,7 +1039,7 @@ ___
|
|
|
1035
1039
|
|
|
1036
1040
|
#### Defined in
|
|
1037
1041
|
|
|
1038
|
-
[lib/types/Result.ts:25](https://github.com/nevoland/quetch/blob/
|
|
1042
|
+
[lib/types/Result.ts:25](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Result.ts#L25)
|
|
1039
1043
|
|
|
1040
1044
|
___
|
|
1041
1045
|
|
|
@@ -1060,7 +1064,7 @@ ___
|
|
|
1060
1064
|
|
|
1061
1065
|
#### Defined in
|
|
1062
1066
|
|
|
1063
|
-
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/
|
|
1067
|
+
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/Store.ts#L2)
|
|
1064
1068
|
|
|
1065
1069
|
## Functions
|
|
1066
1070
|
|
|
@@ -1101,7 +1105,7 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
1101
1105
|
|
|
1102
1106
|
#### Defined in
|
|
1103
1107
|
|
|
1104
|
-
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/
|
|
1108
|
+
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/aggregate.ts#L16)
|
|
1105
1109
|
|
|
1106
1110
|
___
|
|
1107
1111
|
|
|
@@ -1143,7 +1147,7 @@ const customFetch = combine(
|
|
|
1143
1147
|
|
|
1144
1148
|
#### Defined in
|
|
1145
1149
|
|
|
1146
|
-
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/
|
|
1150
|
+
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/branch.ts#L21)
|
|
1147
1151
|
|
|
1148
1152
|
___
|
|
1149
1153
|
|
|
@@ -1172,7 +1176,7 @@ ___
|
|
|
1172
1176
|
|
|
1173
1177
|
#### Defined in
|
|
1174
1178
|
|
|
1175
|
-
[lib/middlewares/cache.ts:39](https://github.com/nevoland/quetch/blob/
|
|
1179
|
+
[lib/middlewares/cache.ts:39](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/cache.ts#L39)
|
|
1176
1180
|
|
|
1177
1181
|
___
|
|
1178
1182
|
|
|
@@ -1245,7 +1249,7 @@ Handler that combines all provided handlers.
|
|
|
1245
1249
|
|
|
1246
1250
|
#### Defined in
|
|
1247
1251
|
|
|
1248
|
-
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/
|
|
1252
|
+
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/combine.ts#L801)
|
|
1249
1253
|
|
|
1250
1254
|
___
|
|
1251
1255
|
|
|
@@ -1267,7 +1271,7 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
|
|
|
1267
1271
|
|
|
1268
1272
|
#### Defined in
|
|
1269
1273
|
|
|
1270
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
1274
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/NextHandler.ts#L4)
|
|
1271
1275
|
|
|
1272
1276
|
___
|
|
1273
1277
|
|
|
@@ -1332,7 +1336,7 @@ typeof `query`
|
|
|
1332
1336
|
|
|
1333
1337
|
#### Defined in
|
|
1334
1338
|
|
|
1335
|
-
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/
|
|
1339
|
+
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/defineCheckQuery.ts#L8)
|
|
1336
1340
|
|
|
1337
1341
|
___
|
|
1338
1342
|
|
|
@@ -1439,7 +1443,7 @@ ___
|
|
|
1439
1443
|
|
|
1440
1444
|
#### Defined in
|
|
1441
1445
|
|
|
1442
|
-
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/
|
|
1446
|
+
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/defineCustomFetch.ts#L11)
|
|
1443
1447
|
|
|
1444
1448
|
___
|
|
1445
1449
|
|
|
@@ -1514,7 +1518,7 @@ ___
|
|
|
1514
1518
|
|
|
1515
1519
|
#### Defined in
|
|
1516
1520
|
|
|
1517
|
-
[lib/tools/defineGenericFetch.ts:5](https://github.com/nevoland/quetch/blob/
|
|
1521
|
+
[lib/tools/defineGenericFetch.ts:5](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/defineGenericFetch.ts#L5)
|
|
1518
1522
|
|
|
1519
1523
|
___
|
|
1520
1524
|
|
|
@@ -1538,7 +1542,7 @@ Handler that returns a promise that resolves to the response.
|
|
|
1538
1542
|
|
|
1539
1543
|
#### Defined in
|
|
1540
1544
|
|
|
1541
|
-
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1545
|
+
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/fetchExternal.ts#L12)
|
|
1542
1546
|
|
|
1543
1547
|
___
|
|
1544
1548
|
|
|
@@ -1563,7 +1567,7 @@ Promise that resolves to the response.
|
|
|
1563
1567
|
|
|
1564
1568
|
#### Defined in
|
|
1565
1569
|
|
|
1566
|
-
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/
|
|
1570
|
+
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/fetchLocal.ts#L9)
|
|
1567
1571
|
|
|
1568
1572
|
___
|
|
1569
1573
|
|
|
@@ -1589,7 +1593,7 @@ ___
|
|
|
1589
1593
|
|
|
1590
1594
|
#### Defined in
|
|
1591
1595
|
|
|
1592
|
-
[lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/
|
|
1596
|
+
[lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/filterFromContext.ts#L5)
|
|
1593
1597
|
|
|
1594
1598
|
___
|
|
1595
1599
|
|
|
@@ -1620,7 +1624,7 @@ Checks wether the provided `value` matches the `filter` or not.
|
|
|
1620
1624
|
|
|
1621
1625
|
#### Defined in
|
|
1622
1626
|
|
|
1623
|
-
[lib/tools/filterItem.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1627
|
+
[lib/tools/filterItem.ts:12](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/filterItem.ts#L12)
|
|
1624
1628
|
|
|
1625
1629
|
___
|
|
1626
1630
|
|
|
@@ -1650,7 +1654,7 @@ ___
|
|
|
1650
1654
|
|
|
1651
1655
|
#### Defined in
|
|
1652
1656
|
|
|
1653
|
-
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/
|
|
1657
|
+
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/identity.ts#L3)
|
|
1654
1658
|
|
|
1655
1659
|
___
|
|
1656
1660
|
|
|
@@ -1683,7 +1687,7 @@ Query handler
|
|
|
1683
1687
|
|
|
1684
1688
|
#### Defined in
|
|
1685
1689
|
|
|
1686
|
-
[lib/middlewares/log.ts:11](https://github.com/nevoland/quetch/blob/
|
|
1690
|
+
[lib/middlewares/log.ts:11](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/log.ts#L11)
|
|
1687
1691
|
|
|
1688
1692
|
___
|
|
1689
1693
|
|
|
@@ -1714,7 +1718,7 @@ ___
|
|
|
1714
1718
|
|
|
1715
1719
|
#### Defined in
|
|
1716
1720
|
|
|
1717
|
-
[lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/
|
|
1721
|
+
[lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/normalizeOrder.ts#L3)
|
|
1718
1722
|
|
|
1719
1723
|
___
|
|
1720
1724
|
|
|
@@ -1741,7 +1745,7 @@ ___
|
|
|
1741
1745
|
|
|
1742
1746
|
#### Defined in
|
|
1743
1747
|
|
|
1744
|
-
[lib/tools/queryItemList.ts:41](https://github.com/nevoland/quetch/blob/
|
|
1748
|
+
[lib/tools/queryItemList.ts:41](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/queryItemList.ts#L41)
|
|
1745
1749
|
|
|
1746
1750
|
___
|
|
1747
1751
|
|
|
@@ -1770,7 +1774,7 @@ Handler
|
|
|
1770
1774
|
|
|
1771
1775
|
#### Defined in
|
|
1772
1776
|
|
|
1773
|
-
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/
|
|
1777
|
+
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/9d131a5/lib/middlewares/retry.ts#L15)
|
|
1774
1778
|
|
|
1775
1779
|
___
|
|
1776
1780
|
|
|
@@ -1801,4 +1805,4 @@ The same array sorted in place.
|
|
|
1801
1805
|
|
|
1802
1806
|
#### Defined in
|
|
1803
1807
|
|
|
1804
|
-
[lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1808
|
+
[lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/9d131a5/lib/tools/sortItemList.ts#L12)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[quetch](../README.md) / GenericFetch
|
|
2
|
+
|
|
3
|
+
# Interface: GenericFetch<T\>
|
|
4
|
+
|
|
5
|
+
## Type parameters
|
|
6
|
+
|
|
7
|
+
| Name | Type |
|
|
8
|
+
| :------ | :------ |
|
|
9
|
+
| `T` | extends `object` |
|
|
10
|
+
|
|
11
|
+
## Callable
|
|
12
|
+
|
|
13
|
+
### GenericFetch
|
|
14
|
+
|
|
15
|
+
▸ **GenericFetch**<`Q`\>(`query`): `Promise`<[`Result`](../README.md#result)<`T`, `Q`, {}, { readonly [K in string \| number \| symbol]: K extends keyof T ? T[K] : K extends never ? Object[K] extends FieldFunctionCustom<T\> ? ReturnType<Object[K]["value"]\> : Object[K]["operator"] extends "formatDate" ? FieldFunctionReturn[Object[K]["operator"]] : never : never }\>\>
|
|
16
|
+
|
|
17
|
+
#### Type parameters
|
|
18
|
+
|
|
19
|
+
| Name | Type |
|
|
20
|
+
| :------ | :------ |
|
|
21
|
+
| `Q` | extends [`Query`](../README.md#query)<`T`, {}\> |
|
|
22
|
+
|
|
23
|
+
#### Parameters
|
|
24
|
+
|
|
25
|
+
| Name | Type |
|
|
26
|
+
| :------ | :------ |
|
|
27
|
+
| `query` | `Q` & { `customFields?`: `undefined` } |
|
|
28
|
+
|
|
29
|
+
#### Returns
|
|
30
|
+
|
|
31
|
+
`Promise`<[`Result`](../README.md#result)<`T`, `Q`, {}, { readonly [K in string \| number \| symbol]: K extends keyof T ? T[K] : K extends never ? Object[K] extends FieldFunctionCustom<T\> ? ReturnType<Object[K]["value"]\> : Object[K]["operator"] extends "formatDate" ? FieldFunctionReturn[Object[K]["operator"]] : never : never }\>\>
|
|
32
|
+
|
|
33
|
+
#### Defined in
|
|
34
|
+
|
|
35
|
+
[lib/types/GenericFetch.ts:6](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/GenericFetch.ts#L6)
|
|
36
|
+
|
|
37
|
+
### GenericFetch
|
|
38
|
+
|
|
39
|
+
▸ **GenericFetch**<`Q`, `C`\>(`query`): `Promise`<[`Result`](../README.md#result)<`T`, `Q`, `C`, [`InjectCustomFields`](../README.md#injectcustomfields)<`T`, `C`\>\>\>
|
|
40
|
+
|
|
41
|
+
#### Type parameters
|
|
42
|
+
|
|
43
|
+
| Name | Type |
|
|
44
|
+
| :------ | :------ |
|
|
45
|
+
| `Q` | extends [`Query`](../README.md#query)<`T`, `C`\> |
|
|
46
|
+
| `C` | extends [`CustomFieldMap`](../README.md#customfieldmap)<`T`\> |
|
|
47
|
+
|
|
48
|
+
#### Parameters
|
|
49
|
+
|
|
50
|
+
| Name | Type |
|
|
51
|
+
| :------ | :------ |
|
|
52
|
+
| `query` | `Q` & { `customFields`: `C` } |
|
|
53
|
+
|
|
54
|
+
#### Returns
|
|
55
|
+
|
|
56
|
+
`Promise`<[`Result`](../README.md#result)<`T`, `Q`, `C`, [`InjectCustomFields`](../README.md#injectcustomfields)<`T`, `C`\>\>\>
|
|
57
|
+
|
|
58
|
+
#### Defined in
|
|
59
|
+
|
|
60
|
+
[lib/types/GenericFetch.ts:9](https://github.com/nevoland/quetch/blob/9d131a5/lib/types/GenericFetch.ts#L9)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CustomFieldMap } from "./CustomFieldMap";
|
|
2
|
+
import type { Query } from "./Query";
|
|
3
|
+
import type { Result } from "./Result";
|
|
4
|
+
|
|
5
|
+
export interface GenericFetch<T extends object> {
|
|
6
|
+
<Q extends Query<T, {}>>(
|
|
7
|
+
query: Q & { customFields?: never },
|
|
8
|
+
): Promise<Result<T, Q, {}>>;
|
|
9
|
+
<Q extends Query<T, C>, C extends CustomFieldMap<T>>(
|
|
10
|
+
query: Q & { customFields: C },
|
|
11
|
+
): Promise<Result<T, Q, C>>;
|
|
12
|
+
}
|
package/lib/types.ts
CHANGED
|
@@ -21,6 +21,7 @@ export type { FilterSequence } from "./types/FilterSequence";
|
|
|
21
21
|
export type { FilterString } from "./types/FilterString";
|
|
22
22
|
export type { FilterStringIntersect } from "./types/FilterStringIntersect";
|
|
23
23
|
export type { FilterStringMatch } from "./types/FilterStringMatch";
|
|
24
|
+
export type { GenericFetch } from "./types/GenericFetch";
|
|
24
25
|
export type { Get } from "./types/Get";
|
|
25
26
|
export type { Group } from "./types/Group";
|
|
26
27
|
export type { Handler } from "./types/Handler";
|