quetch 0.9.2 → 0.10.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/RequestError.js.map +1 -1
- package/dist/middlewares/aggregate.d.ts +9 -3
- package/dist/middlewares/aggregate.js.map +1 -1
- package/dist/middlewares/cache.d.ts +6 -5
- package/dist/middlewares/cache.js.map +1 -1
- package/dist/middlewares/fetchLocal.d.ts +2 -7
- package/dist/middlewares/fetchLocal.js +5 -0
- package/dist/middlewares/fetchLocal.js.map +1 -1
- package/dist/tools/defineCheckQuery.d.ts +3 -7
- package/dist/tools/defineCheckQuery.js.map +1 -1
- package/dist/tools/defineCustomFetch.d.ts +8 -20
- package/dist/tools/defineCustomFetch.js +3 -3
- package/dist/tools/defineCustomFetch.js.map +1 -1
- package/dist/tools/defineGenericFetch.d.ts +14 -13
- package/dist/tools/defineGenericFetch.js +9 -0
- package/dist/tools/defineGenericFetch.js.map +1 -1
- package/dist/tools/filterItem.d.ts +1 -1
- package/dist/tools/queryItemList.d.ts +3 -8
- package/dist/tools/queryItemList.js.map +1 -1
- package/dist/types/CustomFetch.d.ts +1 -7
- package/dist/types/Group.d.ts +0 -2
- package/dist/types/Parameters.d.ts +1 -0
- package/dist/types/Parameters.js +2 -0
- package/dist/types/Parameters.js.map +1 -0
- package/dist/types/Query.d.ts +2 -36
- package/dist/types/QueryAggregate.d.ts +15 -0
- package/dist/types/QueryCreate.d.ts +18 -0
- package/dist/types/QueryCreateMultiple.d.ts +15 -0
- package/dist/types/QueryDelete.d.ts +15 -2
- package/dist/types/QueryDeleteMultiple.d.ts +15 -2
- package/dist/types/QueryMethod.d.ts +1 -1
- package/dist/types/QueryRead.d.ts +15 -0
- package/dist/types/QueryReadMultiple.d.ts +15 -0
- package/dist/types/QuerySettings.d.ts +22 -1
- package/dist/types/QueryUpdate.d.ts +15 -0
- package/dist/types/QueryUpdateMultiple.d.ts +15 -0
- package/dist/types/Result.d.ts +15 -12
- package/dist/types.d.ts +2 -2
- package/doc/README.md +228 -292
- package/doc/interfaces/CustomFetch.md +5 -30
- package/lib/errors/RequestError.ts +2 -2
- package/lib/middlewares/aggregate.ts +9 -4
- package/lib/middlewares/cache.ts +21 -18
- package/lib/middlewares/fetchLocal.ts +2 -15
- package/lib/tools/defineCheckQuery.ts +8 -12
- package/lib/tools/defineCustomFetch.ts +12 -34
- package/lib/tools/defineGenericFetch.ts +14 -20
- package/lib/tools/filterItem.ts +1 -1
- package/lib/tools/queryItemList.ts +8 -20
- package/lib/types/CustomFetch.ts +1 -7
- package/lib/types/Group.ts +0 -3
- package/lib/types/Parameters.ts +1 -0
- package/lib/types/Query.ts +9 -43
- package/lib/types/QueryAggregate.ts +15 -0
- package/lib/types/QueryCreate.ts +19 -0
- package/lib/types/QueryCreateMultiple.ts +16 -0
- package/lib/types/QueryDelete.ts +15 -2
- package/lib/types/QueryDeleteMultiple.ts +15 -2
- package/lib/types/QueryMethod.ts +1 -1
- package/lib/types/QueryRead.ts +15 -0
- package/lib/types/QueryReadMultiple.ts +15 -0
- package/lib/types/QuerySettings.ts +22 -1
- package/lib/types/QueryUpdate.ts +15 -0
- package/lib/types/QueryUpdateMultiple.ts +15 -0
- package/lib/types/Result.ts +13 -22
- package/lib/types.ts +2 -2
- package/package.json +1 -1
- package/dist/types/CustomRequest.d.ts +0 -16
- package/dist/types/CustomRequest.js +0 -2
- package/dist/types/CustomRequest.js.map +0 -1
- package/dist/types/QueryAny.d.ts +0 -7
- package/dist/types/QueryAny.js +0 -2
- package/dist/types/QueryAny.js.map +0 -1
- package/lib/types/CustomRequest.ts +0 -21
- package/lib/types/QueryAny.ts +0 -8
package/doc/README.md
CHANGED
|
@@ -16,7 +16,6 @@ quetch
|
|
|
16
16
|
- [Context](README.md#context)
|
|
17
17
|
- [CustomFieldAggregateMap](README.md#customfieldaggregatemap)
|
|
18
18
|
- [CustomFieldMap](README.md#customfieldmap)
|
|
19
|
-
- [CustomRequest](README.md#customrequest)
|
|
20
19
|
- [FieldFunction](README.md#fieldfunction)
|
|
21
20
|
- [FieldFunctionCustom](README.md#fieldfunctioncustom)
|
|
22
21
|
- [FieldFunctionFormatDate](README.md#fieldfunctionformatdate)
|
|
@@ -25,6 +24,7 @@ quetch
|
|
|
25
24
|
- [FilterArray](README.md#filterarray)
|
|
26
25
|
- [FilterBoolean](README.md#filterboolean)
|
|
27
26
|
- [FilterChildren](README.md#filterchildren)
|
|
27
|
+
- [FilterCustom](README.md#filtercustom)
|
|
28
28
|
- [FilterField](README.md#filterfield)
|
|
29
29
|
- [FilterGroup](README.md#filtergroup)
|
|
30
30
|
- [FilterKeys](README.md#filterkeys)
|
|
@@ -43,9 +43,9 @@ quetch
|
|
|
43
43
|
- [Mutable](README.md#mutable)
|
|
44
44
|
- [NextHandler](README.md#nexthandler)
|
|
45
45
|
- [Order](README.md#order)
|
|
46
|
+
- [Parameters](README.md#parameters)
|
|
46
47
|
- [Query](README.md#query)
|
|
47
48
|
- [QueryAggregate](README.md#queryaggregate)
|
|
48
|
-
- [QueryAny](README.md#queryany)
|
|
49
49
|
- [QueryCreate](README.md#querycreate)
|
|
50
50
|
- [QueryCreateMultiple](README.md#querycreatemultiple)
|
|
51
51
|
- [QueryDelete](README.md#querydelete)
|
|
@@ -99,7 +99,7 @@ Aggregation function.
|
|
|
99
99
|
|
|
100
100
|
#### Defined in
|
|
101
101
|
|
|
102
|
-
[lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
102
|
+
[lib/types/AggregateFunction.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/AggregateFunction.ts#L4)
|
|
103
103
|
|
|
104
104
|
___
|
|
105
105
|
|
|
@@ -109,7 +109,7 @@ ___
|
|
|
109
109
|
|
|
110
110
|
#### Defined in
|
|
111
111
|
|
|
112
|
-
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
112
|
+
[lib/types/AggregateFunctionOperator.ts:3](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/AggregateFunctionOperator.ts#L3)
|
|
113
113
|
|
|
114
114
|
___
|
|
115
115
|
|
|
@@ -119,7 +119,7 @@ ___
|
|
|
119
119
|
|
|
120
120
|
#### Defined in
|
|
121
121
|
|
|
122
|
-
[lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/
|
|
122
|
+
[lib/types/Any.ts:1](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Any.ts#L1)
|
|
123
123
|
|
|
124
124
|
___
|
|
125
125
|
|
|
@@ -135,7 +135,7 @@ ___
|
|
|
135
135
|
|
|
136
136
|
#### Defined in
|
|
137
137
|
|
|
138
|
-
[lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/
|
|
138
|
+
[lib/types/Context.ts:1](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Context.ts#L1)
|
|
139
139
|
|
|
140
140
|
___
|
|
141
141
|
|
|
@@ -151,7 +151,7 @@ ___
|
|
|
151
151
|
|
|
152
152
|
#### Defined in
|
|
153
153
|
|
|
154
|
-
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
154
|
+
[lib/types/CustomFieldAggregateMap.ts:3](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/CustomFieldAggregateMap.ts#L3)
|
|
155
155
|
|
|
156
156
|
___
|
|
157
157
|
|
|
@@ -167,33 +167,7 @@ ___
|
|
|
167
167
|
|
|
168
168
|
#### Defined in
|
|
169
169
|
|
|
170
|
-
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/
|
|
171
|
-
|
|
172
|
-
___
|
|
173
|
-
|
|
174
|
-
### CustomRequest
|
|
175
|
-
|
|
176
|
-
Ƭ **CustomRequest**<`T`, `Q`, `C`\>: `Object`
|
|
177
|
-
|
|
178
|
-
#### Type parameters
|
|
179
|
-
|
|
180
|
-
| Name | Type |
|
|
181
|
-
| :------ | :------ |
|
|
182
|
-
| `T` | extends `object` |
|
|
183
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `C`\> |
|
|
184
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
185
|
-
|
|
186
|
-
#### Type declaration
|
|
187
|
-
|
|
188
|
-
| Name | Type | Description |
|
|
189
|
-
| :------ | :------ | :------ |
|
|
190
|
-
| `data` | `T` | Entity being queried. |
|
|
191
|
-
| `query` | `Q` | Query. |
|
|
192
|
-
| `signal?` | `AbortSignal` | Abort signal to abort the request. |
|
|
193
|
-
|
|
194
|
-
#### Defined in
|
|
195
|
-
|
|
196
|
-
[lib/types/CustomRequest.ts:4](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/CustomRequest.ts#L4)
|
|
170
|
+
[lib/types/CustomFieldMap.ts:3](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/CustomFieldMap.ts#L3)
|
|
197
171
|
|
|
198
172
|
___
|
|
199
173
|
|
|
@@ -209,7 +183,7 @@ ___
|
|
|
209
183
|
|
|
210
184
|
#### Defined in
|
|
211
185
|
|
|
212
|
-
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/
|
|
186
|
+
[lib/types/FieldFunction.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FieldFunction.ts#L4)
|
|
213
187
|
|
|
214
188
|
___
|
|
215
189
|
|
|
@@ -234,7 +208,7 @@ Applies a custom field transform function.
|
|
|
234
208
|
|
|
235
209
|
#### Defined in
|
|
236
210
|
|
|
237
|
-
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/
|
|
211
|
+
[lib/types/FieldFunctionCustom.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FieldFunctionCustom.ts#L4)
|
|
238
212
|
|
|
239
213
|
___
|
|
240
214
|
|
|
@@ -260,7 +234,7 @@ Formats the date found in a given field, which can be an ISO string date or a ti
|
|
|
260
234
|
|
|
261
235
|
#### Defined in
|
|
262
236
|
|
|
263
|
-
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/
|
|
237
|
+
[lib/types/FieldFunctionFormatDate.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FieldFunctionFormatDate.ts#L6)
|
|
264
238
|
|
|
265
239
|
___
|
|
266
240
|
|
|
@@ -278,13 +252,13 @@ Return types of custom field functions.
|
|
|
278
252
|
|
|
279
253
|
#### Defined in
|
|
280
254
|
|
|
281
|
-
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/
|
|
255
|
+
[lib/types/FieldFunctionReturn.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FieldFunctionReturn.ts#L4)
|
|
282
256
|
|
|
283
257
|
___
|
|
284
258
|
|
|
285
259
|
### Filter
|
|
286
260
|
|
|
287
|
-
Ƭ **Filter**<`T`\>: [`FilterArray`](README.md#filterarray)<`T`\> \| [`FilterBoolean`](README.md#filterboolean)<`T`\> \| [`FilterChildren`](README.md#filterchildren)<`T`\> \| `FilterCustom
|
|
261
|
+
Ƭ **Filter**<`T`\>: [`FilterArray`](README.md#filterarray)<`T`\> \| [`FilterBoolean`](README.md#filterboolean)<`T`\> \| [`FilterChildren`](README.md#filterchildren)<`T`\> \| [`FilterCustom`](README.md#filtercustom)<`T`\> \| [`FilterField`](README.md#filterfield)<`T`\> \| [`FilterNumber`](README.md#filternumber)<`T`\> \| [`FilterGroup`](README.md#filtergroup)<`T`\> \| [`FilterString`](README.md#filterstring)<`T`\> \| [`FilterStringIntersect`](README.md#filterstringintersect)<`T`\> \| [`FilterStringMatch`](README.md#filterstringmatch)<`T`\>
|
|
288
262
|
|
|
289
263
|
Describes a predicate for filtering items.
|
|
290
264
|
|
|
@@ -296,7 +270,7 @@ Describes a predicate for filtering items.
|
|
|
296
270
|
|
|
297
271
|
#### Defined in
|
|
298
272
|
|
|
299
|
-
[lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/
|
|
273
|
+
[lib/types/Filter.ts:15](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Filter.ts#L15)
|
|
300
274
|
|
|
301
275
|
___
|
|
302
276
|
|
|
@@ -323,7 +297,7 @@ Checks if a given array field matches a given array value according to a given o
|
|
|
323
297
|
|
|
324
298
|
#### Defined in
|
|
325
299
|
|
|
326
|
-
[lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/
|
|
300
|
+
[lib/types/FilterArray.ts:7](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterArray.ts#L7)
|
|
327
301
|
|
|
328
302
|
___
|
|
329
303
|
|
|
@@ -349,7 +323,7 @@ Checks if a given boolean field is `true` or `false`.
|
|
|
349
323
|
|
|
350
324
|
#### Defined in
|
|
351
325
|
|
|
352
|
-
[lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/
|
|
326
|
+
[lib/types/FilterBoolean.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterBoolean.ts#L6)
|
|
353
327
|
|
|
354
328
|
___
|
|
355
329
|
|
|
@@ -377,7 +351,32 @@ If `deep` is `true`, also captures all the descendants.
|
|
|
377
351
|
|
|
378
352
|
#### Defined in
|
|
379
353
|
|
|
380
|
-
[lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/
|
|
354
|
+
[lib/types/FilterChildren.ts:10](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterChildren.ts#L10)
|
|
355
|
+
|
|
356
|
+
___
|
|
357
|
+
|
|
358
|
+
### FilterCustom
|
|
359
|
+
|
|
360
|
+
Ƭ **FilterCustom**<`T`\>: `Object`
|
|
361
|
+
|
|
362
|
+
Custom filter where `value(item)` returns `true` for matching items.
|
|
363
|
+
|
|
364
|
+
#### Type parameters
|
|
365
|
+
|
|
366
|
+
| Name | Type |
|
|
367
|
+
| :------ | :------ |
|
|
368
|
+
| `T` | extends `object` |
|
|
369
|
+
|
|
370
|
+
#### Type declaration
|
|
371
|
+
|
|
372
|
+
| Name | Type |
|
|
373
|
+
| :------ | :------ |
|
|
374
|
+
| `operator` | ``"custom"`` |
|
|
375
|
+
| `value` | (`item`: `T`) => `boolean` |
|
|
376
|
+
|
|
377
|
+
#### Defined in
|
|
378
|
+
|
|
379
|
+
[lib/types/FilterCustom.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterCustom.ts#L4)
|
|
381
380
|
|
|
382
381
|
___
|
|
383
382
|
|
|
@@ -402,7 +401,7 @@ Checks if a given field exists.
|
|
|
402
401
|
|
|
403
402
|
#### Defined in
|
|
404
403
|
|
|
405
|
-
[lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/
|
|
404
|
+
[lib/types/FilterField.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterField.ts#L4)
|
|
406
405
|
|
|
407
406
|
___
|
|
408
407
|
|
|
@@ -420,7 +419,7 @@ Joins a list of filters with a specific boolean operator.
|
|
|
420
419
|
|
|
421
420
|
#### Defined in
|
|
422
421
|
|
|
423
|
-
[lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/
|
|
422
|
+
[lib/types/FilterGroup.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterGroup.ts#L6)
|
|
424
423
|
|
|
425
424
|
___
|
|
426
425
|
|
|
@@ -439,7 +438,7 @@ Returns object type with field extending the provided `P` type.
|
|
|
439
438
|
|
|
440
439
|
#### Defined in
|
|
441
440
|
|
|
442
|
-
[lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/
|
|
441
|
+
[lib/types/FilterKeys.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterKeys.ts#L4)
|
|
443
442
|
|
|
444
443
|
___
|
|
445
444
|
|
|
@@ -465,7 +464,7 @@ Checks if a given number field matches a given number value according to a given
|
|
|
465
464
|
|
|
466
465
|
#### Defined in
|
|
467
466
|
|
|
468
|
-
[lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/
|
|
467
|
+
[lib/types/FilterNumber.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterNumber.ts#L6)
|
|
469
468
|
|
|
470
469
|
___
|
|
471
470
|
|
|
@@ -475,7 +474,7 @@ ___
|
|
|
475
474
|
|
|
476
475
|
#### Defined in
|
|
477
476
|
|
|
478
|
-
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/
|
|
477
|
+
[lib/types/FilterOperator.ts:3](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterOperator.ts#L3)
|
|
479
478
|
|
|
480
479
|
___
|
|
481
480
|
|
|
@@ -501,7 +500,7 @@ Checks if a given string field matches a given string value according to a given
|
|
|
501
500
|
|
|
502
501
|
#### Defined in
|
|
503
502
|
|
|
504
|
-
[lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/
|
|
503
|
+
[lib/types/FilterString.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterString.ts#L6)
|
|
505
504
|
|
|
506
505
|
___
|
|
507
506
|
|
|
@@ -527,7 +526,7 @@ Checks if a given string field has any of the provided values.
|
|
|
527
526
|
|
|
528
527
|
#### Defined in
|
|
529
528
|
|
|
530
|
-
[lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/
|
|
529
|
+
[lib/types/FilterStringIntersect.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterStringIntersect.ts#L6)
|
|
531
530
|
|
|
532
531
|
___
|
|
533
532
|
|
|
@@ -557,7 +556,7 @@ Checks if a given string field matches a given regular expression.
|
|
|
557
556
|
|
|
558
557
|
#### Defined in
|
|
559
558
|
|
|
560
|
-
[lib/types/FilterStringMatch.ts:8](https://github.com/nevoland/quetch/blob/
|
|
559
|
+
[lib/types/FilterStringMatch.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/FilterStringMatch.ts#L8)
|
|
561
560
|
|
|
562
561
|
___
|
|
563
562
|
|
|
@@ -577,13 +576,13 @@ Returns the type of the property at the specified `K` key.
|
|
|
577
576
|
|
|
578
577
|
#### Defined in
|
|
579
578
|
|
|
580
|
-
[lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/
|
|
579
|
+
[lib/types/Get.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Get.ts#L4)
|
|
581
580
|
|
|
582
581
|
___
|
|
583
582
|
|
|
584
583
|
### Group
|
|
585
584
|
|
|
586
|
-
Ƭ **Group**<`T`\>: keyof `T` \| { `
|
|
585
|
+
Ƭ **Group**<`T`\>: keyof `T` \| { `field`: keyof `T` }
|
|
587
586
|
|
|
588
587
|
Specifies how items should be grouped.
|
|
589
588
|
|
|
@@ -595,7 +594,7 @@ Specifies how items should be grouped.
|
|
|
595
594
|
|
|
596
595
|
#### Defined in
|
|
597
596
|
|
|
598
|
-
[lib/types/Group.ts:
|
|
597
|
+
[lib/types/Group.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Group.ts#L4)
|
|
599
598
|
|
|
600
599
|
___
|
|
601
600
|
|
|
@@ -631,7 +630,7 @@ Handles an `input` query and returns an `output` promise, eventually using the `
|
|
|
631
630
|
|
|
632
631
|
#### Defined in
|
|
633
632
|
|
|
634
|
-
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/
|
|
633
|
+
[lib/types/Handler.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Handler.ts#L6)
|
|
635
634
|
|
|
636
635
|
___
|
|
637
636
|
|
|
@@ -647,7 +646,7 @@ ___
|
|
|
647
646
|
|
|
648
647
|
#### Defined in
|
|
649
648
|
|
|
650
|
-
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
649
|
+
[lib/types/Immutable.ts:1](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Immutable.ts#L1)
|
|
651
650
|
|
|
652
651
|
___
|
|
653
652
|
|
|
@@ -666,7 +665,7 @@ Injects the custom fields into the entity type.
|
|
|
666
665
|
|
|
667
666
|
#### Defined in
|
|
668
667
|
|
|
669
|
-
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/
|
|
668
|
+
[lib/types/InjectCustomFields.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/InjectCustomFields.ts#L8)
|
|
670
669
|
|
|
671
670
|
___
|
|
672
671
|
|
|
@@ -685,7 +684,7 @@ Returns the inferred item type of an array, or an alternative type if it is some
|
|
|
685
684
|
|
|
686
685
|
#### Defined in
|
|
687
686
|
|
|
688
|
-
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/
|
|
687
|
+
[lib/types/Item.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Item.ts#L4)
|
|
689
688
|
|
|
690
689
|
___
|
|
691
690
|
|
|
@@ -695,7 +694,7 @@ ___
|
|
|
695
694
|
|
|
696
695
|
#### Defined in
|
|
697
696
|
|
|
698
|
-
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/
|
|
697
|
+
[lib/types/Key.ts:1](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Key.ts#L1)
|
|
699
698
|
|
|
700
699
|
___
|
|
701
700
|
|
|
@@ -711,7 +710,7 @@ ___
|
|
|
711
710
|
|
|
712
711
|
#### Defined in
|
|
713
712
|
|
|
714
|
-
[lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/
|
|
713
|
+
[lib/types/Mutable.ts:1](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Mutable.ts#L1)
|
|
715
714
|
|
|
716
715
|
___
|
|
717
716
|
|
|
@@ -744,7 +743,7 @@ Handles an `input` query and returns an `output` promise.
|
|
|
744
743
|
|
|
745
744
|
#### Defined in
|
|
746
745
|
|
|
747
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
746
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/NextHandler.ts#L4)
|
|
748
747
|
|
|
749
748
|
___
|
|
750
749
|
|
|
@@ -762,13 +761,23 @@ Order item.
|
|
|
762
761
|
|
|
763
762
|
#### Defined in
|
|
764
763
|
|
|
765
|
-
[lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/
|
|
764
|
+
[lib/types/Order.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Order.ts#L4)
|
|
765
|
+
|
|
766
|
+
___
|
|
767
|
+
|
|
768
|
+
### Parameters
|
|
769
|
+
|
|
770
|
+
Ƭ **Parameters**: `Record`<`string`, `string` \| `string`[] \| `number` \| `number`[]\>
|
|
771
|
+
|
|
772
|
+
#### Defined in
|
|
773
|
+
|
|
774
|
+
[lib/types/Parameters.ts:1](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Parameters.ts#L1)
|
|
766
775
|
|
|
767
776
|
___
|
|
768
777
|
|
|
769
778
|
### Query
|
|
770
779
|
|
|
771
|
-
Ƭ **Query**<`T
|
|
780
|
+
Ƭ **Query**<`T`\>: [`QueryRead`](README.md#queryread)<`T`\> \| [`QueryReadMultiple`](README.md#queryreadmultiple)<`T`\> \| [`QueryCreate`](README.md#querycreate)<`T`\> \| [`QueryCreateMultiple`](README.md#querycreatemultiple)<`T`\> \| [`QueryUpdate`](README.md#queryupdate)<`T`\> \| [`QueryUpdateMultiple`](README.md#queryupdatemultiple)<`T`\> \| [`QueryDelete`](README.md#querydelete)<`T`\> \| [`QueryDeleteMultiple`](README.md#querydeletemultiple)<`T`\> \| [`QueryAggregate`](README.md#queryaggregate)<`T`\>
|
|
772
781
|
|
|
773
782
|
Query that fetches or mutates an entity.
|
|
774
783
|
|
|
@@ -777,13 +786,10 @@ Query that fetches or mutates an entity.
|
|
|
777
786
|
| Name | Type |
|
|
778
787
|
| :------ | :------ |
|
|
779
788
|
| `T` | extends `object` |
|
|
780
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> \| `undefined` |
|
|
781
|
-
| `M` | extends `QueryBase`<`never`\>[``"method"``] = `QueryBase`<`never`\>[``"method"``] |
|
|
782
|
-
| `L` | extends `boolean` \| `undefined` = `boolean` |
|
|
783
789
|
|
|
784
790
|
#### Defined in
|
|
785
791
|
|
|
786
|
-
[lib/types/Query.ts:
|
|
792
|
+
[lib/types/Query.ts:14](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Query.ts#L14)
|
|
787
793
|
|
|
788
794
|
___
|
|
789
795
|
|
|
@@ -801,25 +807,18 @@ Query for computing an aggregated value.
|
|
|
801
807
|
|
|
802
808
|
#### Type declaration
|
|
803
809
|
|
|
804
|
-
| Name | Type |
|
|
805
|
-
| :------ | :------ |
|
|
806
|
-
| `aggregator` | [`AggregateFunction`](README.md#aggregatefunction)<`T`\> |
|
|
807
|
-
| `
|
|
808
|
-
| `
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
[lib/types/QueryAggregate.ts:7](https://github.com/nevoland/quetch/blob/91f8b5b/lib/types/QueryAggregate.ts#L7)
|
|
813
|
-
|
|
814
|
-
___
|
|
815
|
-
|
|
816
|
-
### QueryAny
|
|
817
|
-
|
|
818
|
-
Ƭ **QueryAny**: [`Query`](README.md#query)<`any`, `any`\> & { `customFields?`: [`CustomFieldMap`](README.md#customfieldmap)<`any`\> ; `type`: [`Key`](README.md#key) \| `any`[] }
|
|
810
|
+
| Name | Type | Description |
|
|
811
|
+
| :------ | :------ | :------ |
|
|
812
|
+
| `aggregator` | [`AggregateFunction`](README.md#aggregatefunction)<`T`\> | - |
|
|
813
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the item. |
|
|
814
|
+
| `filter?` | [`Filter`](README.md#filter)<`T`\> | - |
|
|
815
|
+
| `method` | ``"aggregate"`` | - |
|
|
816
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
817
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
819
818
|
|
|
820
819
|
#### Defined in
|
|
821
820
|
|
|
822
|
-
[lib/types/
|
|
821
|
+
[lib/types/QueryAggregate.ts:10](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryAggregate.ts#L10)
|
|
823
822
|
|
|
824
823
|
___
|
|
825
824
|
|
|
@@ -837,15 +836,18 @@ Query for creating an item.
|
|
|
837
836
|
|
|
838
837
|
#### Type declaration
|
|
839
838
|
|
|
840
|
-
| Name | Type |
|
|
841
|
-
| :------ | :------ |
|
|
842
|
-
| `
|
|
843
|
-
| `
|
|
844
|
-
| `
|
|
839
|
+
| Name | Type | Description |
|
|
840
|
+
| :------ | :------ | :------ |
|
|
841
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to create the item. |
|
|
842
|
+
| `method` | ``"create"`` | - |
|
|
843
|
+
| `multiple?` | ``false`` | - |
|
|
844
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
845
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
846
|
+
| `value` | `Partial`<`T`\> | Value properties of the item to create. |
|
|
845
847
|
|
|
846
848
|
#### Defined in
|
|
847
849
|
|
|
848
|
-
[lib/types/QueryCreate.ts:
|
|
850
|
+
[lib/types/QueryCreate.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryCreate.ts#L8)
|
|
849
851
|
|
|
850
852
|
___
|
|
851
853
|
|
|
@@ -863,15 +865,18 @@ Query for creating multiple items.
|
|
|
863
865
|
|
|
864
866
|
#### Type declaration
|
|
865
867
|
|
|
866
|
-
| Name | Type |
|
|
867
|
-
| :------ | :------ |
|
|
868
|
-
| `
|
|
869
|
-
| `
|
|
870
|
-
| `
|
|
868
|
+
| Name | Type | Description |
|
|
869
|
+
| :------ | :------ | :------ |
|
|
870
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to create the items. |
|
|
871
|
+
| `method` | ``"create"`` | - |
|
|
872
|
+
| `multiple` | ``true`` | - |
|
|
873
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
874
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
875
|
+
| `value` | `Partial`<`T`\>[] | - |
|
|
871
876
|
|
|
872
877
|
#### Defined in
|
|
873
878
|
|
|
874
|
-
[lib/types/QueryCreateMultiple.ts:
|
|
879
|
+
[lib/types/QueryCreateMultiple.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryCreateMultiple.ts#L8)
|
|
875
880
|
|
|
876
881
|
___
|
|
877
882
|
|
|
@@ -889,16 +894,18 @@ Query for deleting an item.
|
|
|
889
894
|
|
|
890
895
|
#### Type declaration
|
|
891
896
|
|
|
892
|
-
| Name | Type |
|
|
893
|
-
| :------ | :------ |
|
|
894
|
-
| `
|
|
895
|
-
| `filter?` | [`Filter`](README.md#filter)<`T`\> |
|
|
896
|
-
| `method` | ``"delete"`` |
|
|
897
|
-
| `multiple?` | ``false`` |
|
|
897
|
+
| Name | Type | Description |
|
|
898
|
+
| :------ | :------ | :------ |
|
|
899
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to delete the item. |
|
|
900
|
+
| `filter?` | [`Filter`](README.md#filter)<`T`\> | - |
|
|
901
|
+
| `method` | ``"delete"`` | - |
|
|
902
|
+
| `multiple?` | ``false`` | - |
|
|
903
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
904
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
898
905
|
|
|
899
906
|
#### Defined in
|
|
900
907
|
|
|
901
|
-
[lib/types/QueryDelete.ts:
|
|
908
|
+
[lib/types/QueryDelete.ts:9](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryDelete.ts#L9)
|
|
902
909
|
|
|
903
910
|
___
|
|
904
911
|
|
|
@@ -916,28 +923,30 @@ Query for deleting multiple items.
|
|
|
916
923
|
|
|
917
924
|
#### Type declaration
|
|
918
925
|
|
|
919
|
-
| Name | Type |
|
|
920
|
-
| :------ | :------ |
|
|
921
|
-
| `
|
|
922
|
-
| `filter?` | [`Filter`](README.md#filter)<`T`\> |
|
|
923
|
-
| `method` | ``"delete"`` |
|
|
924
|
-
| `multiple` | ``true`` |
|
|
926
|
+
| Name | Type | Description |
|
|
927
|
+
| :------ | :------ | :------ |
|
|
928
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to delete the item. |
|
|
929
|
+
| `filter?` | [`Filter`](README.md#filter)<`T`\> | - |
|
|
930
|
+
| `method` | ``"delete"`` | - |
|
|
931
|
+
| `multiple` | ``true`` | - |
|
|
932
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
933
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
925
934
|
|
|
926
935
|
#### Defined in
|
|
927
936
|
|
|
928
|
-
[lib/types/QueryDeleteMultiple.ts:
|
|
937
|
+
[lib/types/QueryDeleteMultiple.ts:9](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryDeleteMultiple.ts#L9)
|
|
929
938
|
|
|
930
939
|
___
|
|
931
940
|
|
|
932
941
|
### QueryMethod
|
|
933
942
|
|
|
934
|
-
Ƭ **QueryMethod**: `Exclude`<[`Query`](README.md#query)<`never
|
|
943
|
+
Ƭ **QueryMethod**: `Exclude`<[`Query`](README.md#query)<`never`\>[``"method"``], `undefined`\>
|
|
935
944
|
|
|
936
945
|
Available query methods.
|
|
937
946
|
|
|
938
947
|
#### Defined in
|
|
939
948
|
|
|
940
|
-
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/
|
|
949
|
+
[lib/types/QueryMethod.ts:6](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryMethod.ts#L6)
|
|
941
950
|
|
|
942
951
|
___
|
|
943
952
|
|
|
@@ -957,6 +966,7 @@ Query for reading a single item.
|
|
|
957
966
|
|
|
958
967
|
| Name | Type | Description |
|
|
959
968
|
| :------ | :------ | :------ |
|
|
969
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to delete the item. |
|
|
960
970
|
| `fields?` | readonly keyof `T`[] | Item fields to pick. If omitted, all fields are picked. |
|
|
961
971
|
| `filter?` | [`Filter`](README.md#filter)<`T`\> | Filter for finding the item, if it cannot be found based on the `context`. |
|
|
962
972
|
| `group?` | `never` | - |
|
|
@@ -965,10 +975,12 @@ Query for reading a single item.
|
|
|
965
975
|
| `multiple?` | ``false`` | - |
|
|
966
976
|
| `offset?` | `never` | - |
|
|
967
977
|
| `order?` | [`Order`](README.md#order)<`T`\>[] | Order by which the items should be sorted. |
|
|
978
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
979
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
968
980
|
|
|
969
981
|
#### Defined in
|
|
970
982
|
|
|
971
|
-
[lib/types/QueryRead.ts:
|
|
983
|
+
[lib/types/QueryRead.ts:10](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryRead.ts#L10)
|
|
972
984
|
|
|
973
985
|
___
|
|
974
986
|
|
|
@@ -988,6 +1000,7 @@ Query for getting a list of items.
|
|
|
988
1000
|
|
|
989
1001
|
| Name | Type | Description |
|
|
990
1002
|
| :------ | :------ | :------ |
|
|
1003
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the item. |
|
|
991
1004
|
| `fields?` | readonly keyof `T`[] | Item fields to pick. If omitted, all fields are picked. |
|
|
992
1005
|
| `filter?` | [`Filter`](README.md#filter)<`T`\> | Filter that picks the items. |
|
|
993
1006
|
| `group?` | [`Group`](README.md#group)<`T`\>[] | Groups items by specified fields. |
|
|
@@ -996,10 +1009,12 @@ Query for getting a list of items.
|
|
|
996
1009
|
| `multiple` | ``true`` | - |
|
|
997
1010
|
| `offset?` | `number` | Offset of the first matching item. |
|
|
998
1011
|
| `order?` | [`Order`](README.md#order)<`T`\>[] | Order by which the items should be sorted. |
|
|
1012
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
1013
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
999
1014
|
|
|
1000
1015
|
#### Defined in
|
|
1001
1016
|
|
|
1002
|
-
[lib/types/QueryReadMultiple.ts:
|
|
1017
|
+
[lib/types/QueryReadMultiple.ts:11](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryReadMultiple.ts#L11)
|
|
1003
1018
|
|
|
1004
1019
|
___
|
|
1005
1020
|
|
|
@@ -1007,6 +1022,8 @@ ___
|
|
|
1007
1022
|
|
|
1008
1023
|
Ƭ **QuerySettings**<`T`\>: `Object`
|
|
1009
1024
|
|
|
1025
|
+
Settings to use when doing a query.
|
|
1026
|
+
|
|
1010
1027
|
#### Type parameters
|
|
1011
1028
|
|
|
1012
1029
|
| Name | Type |
|
|
@@ -1015,15 +1032,16 @@ ___
|
|
|
1015
1032
|
|
|
1016
1033
|
#### Type declaration
|
|
1017
1034
|
|
|
1018
|
-
| Name | Type |
|
|
1019
|
-
| :------ | :------ |
|
|
1020
|
-
| `pathFieldKey?` | [`FilterKeys`](README.md#filterkeys)<`T`, `string`\> |
|
|
1021
|
-
| `pathFieldSeparator?` | `string` |
|
|
1022
|
-
| `
|
|
1035
|
+
| Name | Type | Description |
|
|
1036
|
+
| :------ | :------ | :------ |
|
|
1037
|
+
| `pathFieldKey?` | [`FilterKeys`](README.md#filterkeys)<`T`, `string`\> | Field key to that contains the path value of an item. |
|
|
1038
|
+
| `pathFieldSeparator?` | `string` | String used to separate the path nodes of an item. |
|
|
1039
|
+
| `signal?` | `AbortSignal` | Abort signal to abort the query. |
|
|
1040
|
+
| `transformFilterChildren?` | (`filter`: [`FilterChildren`](README.md#filterchildren)<`T`\>) => `Exclude`<[`Filter`](README.md#filter)<`T`\>, { `operator`: ``"children"`` }\> | Returns a filter that captures the items expressed by the provided `FilterChildren`. The return filter cannot use filters of type `FilterChildren`. |
|
|
1023
1041
|
|
|
1024
1042
|
#### Defined in
|
|
1025
1043
|
|
|
1026
|
-
[lib/types/QuerySettings.ts:
|
|
1044
|
+
[lib/types/QuerySettings.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QuerySettings.ts#L8)
|
|
1027
1045
|
|
|
1028
1046
|
___
|
|
1029
1047
|
|
|
@@ -1043,17 +1061,20 @@ Query for updating an item.
|
|
|
1043
1061
|
|
|
1044
1062
|
| Name | Type | Description |
|
|
1045
1063
|
| :------ | :------ | :------ |
|
|
1064
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to update the item. |
|
|
1046
1065
|
| `filter?` | [`Filter`](README.md#filter)<`T`\> | Filter for finding the item, if it cannot be found based on the `context`. |
|
|
1047
1066
|
| `group?` | `never` | - |
|
|
1048
1067
|
| `method` | ``"update"`` | - |
|
|
1049
1068
|
| `multiple?` | ``false`` | - |
|
|
1050
1069
|
| `offset?` | `never` | - |
|
|
1051
1070
|
| `order` | `never` | - |
|
|
1071
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
1072
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
1052
1073
|
| `value` | `Partial`<`T`\> | Partial property values to update. |
|
|
1053
1074
|
|
|
1054
1075
|
#### Defined in
|
|
1055
1076
|
|
|
1056
|
-
[lib/types/QueryUpdate.ts:
|
|
1077
|
+
[lib/types/QueryUpdate.ts:9](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryUpdate.ts#L9)
|
|
1057
1078
|
|
|
1058
1079
|
___
|
|
1059
1080
|
|
|
@@ -1073,36 +1094,37 @@ Query for updating multiple items.
|
|
|
1073
1094
|
|
|
1074
1095
|
| Name | Type | Description |
|
|
1075
1096
|
| :------ | :------ | :------ |
|
|
1097
|
+
| `context?` | [`Context`](README.md#context)<`T`\> | Common item properties to use for identifying the context in which to update the item. |
|
|
1076
1098
|
| `filter?` | [`Filter`](README.md#filter)<`T`\> | - |
|
|
1077
1099
|
| `limit?` | `number` | Sets the upper bound of the number of items to update. |
|
|
1078
1100
|
| `method` | ``"update"`` | - |
|
|
1079
1101
|
| `multiple` | ``true`` | - |
|
|
1080
1102
|
| `offset?` | `number` | Offset of the first matching item to update. |
|
|
1081
1103
|
| `order?` | [`Order`](README.md#order)<`T`\>[] | Order by which the items should be sorted. |
|
|
1104
|
+
| `parameters?` | [`Parameters`](README.md#parameters) | Query parameters. |
|
|
1105
|
+
| `settings?` | [`QuerySettings`](README.md#querysettings)<`T`\> | Query settings. |
|
|
1082
1106
|
| `value` | `Partial`<`T`\>[] | Partial property values to update. |
|
|
1083
1107
|
|
|
1084
1108
|
#### Defined in
|
|
1085
1109
|
|
|
1086
|
-
[lib/types/QueryUpdateMultiple.ts:
|
|
1110
|
+
[lib/types/QueryUpdateMultiple.ts:10](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/QueryUpdateMultiple.ts#L10)
|
|
1087
1111
|
|
|
1088
1112
|
___
|
|
1089
1113
|
|
|
1090
1114
|
### Result
|
|
1091
1115
|
|
|
1092
|
-
Ƭ **Result**<`T`, `Q
|
|
1116
|
+
Ƭ **Result**<`T`, `Q`\>: [`Q`] extends [{ `method`: ``"read"`` }] ? [`Q`] extends [{ `multiple`: ``true`` }] ? `ResultRead`<`T`, `Q`\>[] : `ResultRead`<`T`, `Q`\> : [`Q`] extends [{ `method`: ``"aggregate"`` }] ? `number` : [`Q`] extends [{ `multiple`: ``true`` }] ? `ResultRead`<`T`, `Q`\>[] : `ResultRead`<`T`, `Q`\>
|
|
1093
1117
|
|
|
1094
1118
|
#### Type parameters
|
|
1095
1119
|
|
|
1096
1120
|
| Name | Type |
|
|
1097
1121
|
| :------ | :------ |
|
|
1098
1122
|
| `T` | extends `object` |
|
|
1099
|
-
| `Q` | extends [`Query`](README.md#query)<`T
|
|
1100
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> \| `undefined` |
|
|
1101
|
-
| `U` | extends [`InjectCustomFields`](README.md#injectcustomfields)<`T`, `C`\> \| `undefined` = [`InjectCustomFields`](README.md#injectcustomfields)<`T`, `C`\> |
|
|
1123
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1102
1124
|
|
|
1103
1125
|
#### Defined in
|
|
1104
1126
|
|
|
1105
|
-
[lib/types/Result.ts:
|
|
1127
|
+
[lib/types/Result.ts:20](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Result.ts#L20)
|
|
1106
1128
|
|
|
1107
1129
|
___
|
|
1108
1130
|
|
|
@@ -1127,7 +1149,7 @@ ___
|
|
|
1127
1149
|
|
|
1128
1150
|
#### Defined in
|
|
1129
1151
|
|
|
1130
|
-
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/
|
|
1152
|
+
[lib/types/Store.ts:2](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/Store.ts#L2)
|
|
1131
1153
|
|
|
1132
1154
|
## Functions
|
|
1133
1155
|
|
|
@@ -1145,9 +1167,9 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
1145
1167
|
|
|
1146
1168
|
| Name | Type |
|
|
1147
1169
|
| :------ | :------ |
|
|
1148
|
-
| `I` | extends
|
|
1170
|
+
| `I` | extends `Object` |
|
|
1149
1171
|
| `O` | `O` |
|
|
1150
|
-
| `In` | extends
|
|
1172
|
+
| `In` | extends `Object` |
|
|
1151
1173
|
| `On` | `On` |
|
|
1152
1174
|
|
|
1153
1175
|
#### Parameters
|
|
@@ -1157,7 +1179,7 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
1157
1179
|
| `options` | `Object` |
|
|
1158
1180
|
| `options.delay?` | `number` |
|
|
1159
1181
|
| `options.mergeQuery?` | (`query`: `I`, `currentQuery`: `I`) => `I` |
|
|
1160
|
-
| `options.queryForGroup` | (`queryList`: `I`[], `group`: `string`) =>
|
|
1182
|
+
| `options.queryForGroup` | (`queryList`: `I`[], `group`: `string`) => `Object` |
|
|
1161
1183
|
| `options.queryGroupId?` | (`query`: `I`) => `undefined` \| `string` |
|
|
1162
1184
|
| `options.queryId?` | (`query`: `I`) => `undefined` \| `string` |
|
|
1163
1185
|
| `options.resultForQuery` | (`resultList`: `O`[], `query`: `I`) => `O` |
|
|
@@ -1168,7 +1190,7 @@ If a query occurs twice, `mergeQuery(query, currentQuery)` is called and the out
|
|
|
1168
1190
|
|
|
1169
1191
|
#### Defined in
|
|
1170
1192
|
|
|
1171
|
-
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/
|
|
1193
|
+
[lib/middlewares/aggregate.ts:16](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/aggregate.ts#L16)
|
|
1172
1194
|
|
|
1173
1195
|
___
|
|
1174
1196
|
|
|
@@ -1210,7 +1232,7 @@ const customFetch = combine(
|
|
|
1210
1232
|
|
|
1211
1233
|
#### Defined in
|
|
1212
1234
|
|
|
1213
|
-
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/
|
|
1235
|
+
[lib/middlewares/branch.ts:21](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/branch.ts#L21)
|
|
1214
1236
|
|
|
1215
1237
|
___
|
|
1216
1238
|
|
|
@@ -1222,16 +1244,22 @@ ___
|
|
|
1222
1244
|
|
|
1223
1245
|
| Name | Type |
|
|
1224
1246
|
| :------ | :------ |
|
|
1225
|
-
| `I` | extends
|
|
1247
|
+
| `I` | extends `Object` |
|
|
1226
1248
|
| `O` | `O` |
|
|
1227
|
-
| `In` | extends [`
|
|
1249
|
+
| `In` | extends [`Query`](README.md#query)<`any`\> |
|
|
1228
1250
|
| `On` | `On` |
|
|
1229
1251
|
|
|
1230
1252
|
#### Parameters
|
|
1231
1253
|
|
|
1232
|
-
| Name | Type |
|
|
1233
|
-
| :------ | :------ |
|
|
1234
|
-
| `«destructured»` | `
|
|
1254
|
+
| Name | Type | Description |
|
|
1255
|
+
| :------ | :------ | :------ |
|
|
1256
|
+
| `«destructured»` | `Object` | - |
|
|
1257
|
+
| › `extendCachedQuery` | (`query`: `I`, `cachedQuery`: `I`) => `undefined` \| `I` | Returns a query that completes the cached value. Returns `undefined` if the query should not be completed. |
|
|
1258
|
+
| › `invalidatesItem` | (`query`: `I`, `cachedQuery`: `I`, `cachedValue`: `any`) => `boolean` | Returns `true` if the cached item must be invalidated. |
|
|
1259
|
+
| › `itemId?` | (`query`: `I`) => `undefined` \| `string` | Unique identifier for the item to cache. Returns `undefined` if the item should not be cached. |
|
|
1260
|
+
| › `mergeItem` | (`value`: `any`, `cachedValue`: `any`, `query`: `I`, `cachedQuery`: `I`) => `any` | Merges the value from the extended query with the cached value. Only called when `extendCachedQuery` returns a query. |
|
|
1261
|
+
| › `mergeQuery` | (`extendedQuery`: `I`, `cachedQuery`: `I`) => `I` | Merges the extended query with the cached query. Only called when `extendCachedQuery` returns a query. |
|
|
1262
|
+
| › `store` | [`Store`](README.md#store)<`CachedItem`<`I`\>\> | Cache store. |
|
|
1235
1263
|
|
|
1236
1264
|
#### Returns
|
|
1237
1265
|
|
|
@@ -1239,7 +1267,7 @@ ___
|
|
|
1239
1267
|
|
|
1240
1268
|
#### Defined in
|
|
1241
1269
|
|
|
1242
|
-
[lib/middlewares/cache.ts:
|
|
1270
|
+
[lib/middlewares/cache.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/cache.ts#L8)
|
|
1243
1271
|
|
|
1244
1272
|
___
|
|
1245
1273
|
|
|
@@ -1312,7 +1340,7 @@ Handler that combines all provided handlers.
|
|
|
1312
1340
|
|
|
1313
1341
|
#### Defined in
|
|
1314
1342
|
|
|
1315
|
-
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/
|
|
1343
|
+
[lib/middlewares/combine.ts:801](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/combine.ts#L801)
|
|
1316
1344
|
|
|
1317
1345
|
___
|
|
1318
1346
|
|
|
@@ -1334,13 +1362,13 @@ Uncallable handler used to terminate a sequence of handlers combined with `combi
|
|
|
1334
1362
|
|
|
1335
1363
|
#### Defined in
|
|
1336
1364
|
|
|
1337
|
-
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/
|
|
1365
|
+
[lib/types/NextHandler.ts:4](https://github.com/nevoland/quetch/blob/c78a2c0/lib/types/NextHandler.ts#L4)
|
|
1338
1366
|
|
|
1339
1367
|
___
|
|
1340
1368
|
|
|
1341
1369
|
### defineCheckQuery
|
|
1342
1370
|
|
|
1343
|
-
▸ **defineCheckQuery**<`M`\>(): <T,
|
|
1371
|
+
▸ **defineCheckQuery**<`M`\>(): <T, Q\>(`query`: `Q` & { `type`: `T`[] }) => typeof `query`<K, T, Q\>(`query`: `Q` & { `type`: `K` }) => typeof `query`
|
|
1344
1372
|
|
|
1345
1373
|
Returns a function that checks queries. This is useful to prevent the query to have its type being narrowed if declared outside of a custom fetcher function argument.
|
|
1346
1374
|
|
|
@@ -1356,27 +1384,26 @@ Returns a function that checks queries. This is useful to prevent the query to h
|
|
|
1356
1384
|
|
|
1357
1385
|
Function that checks queries.
|
|
1358
1386
|
|
|
1359
|
-
▸ <`T`, `
|
|
1387
|
+
▸ <`T`, `Q`\>(`query`): typeof `query`
|
|
1360
1388
|
|
|
1361
1389
|
##### Type parameters
|
|
1362
1390
|
|
|
1363
1391
|
| Name | Type |
|
|
1364
1392
|
| :------ | :------ |
|
|
1365
1393
|
| `T` | extends `object` |
|
|
1366
|
-
| `
|
|
1367
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `C`\> |
|
|
1394
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1368
1395
|
|
|
1369
1396
|
##### Parameters
|
|
1370
1397
|
|
|
1371
1398
|
| Name | Type |
|
|
1372
1399
|
| :------ | :------ |
|
|
1373
|
-
| `query` | `Q` & { `
|
|
1400
|
+
| `query` | `Q` & { `type`: `T`[] } |
|
|
1374
1401
|
|
|
1375
1402
|
##### Returns
|
|
1376
1403
|
|
|
1377
1404
|
typeof `query`
|
|
1378
1405
|
|
|
1379
|
-
▸ <`K`, `T`, `
|
|
1406
|
+
▸ <`K`, `T`, `Q`\>(`query`): typeof `query`
|
|
1380
1407
|
|
|
1381
1408
|
##### Type parameters
|
|
1382
1409
|
|
|
@@ -1384,14 +1411,13 @@ typeof `query`
|
|
|
1384
1411
|
| :------ | :------ |
|
|
1385
1412
|
| `K` | extends `string` \| `number` \| `symbol` |
|
|
1386
1413
|
| `T` | extends `object` |
|
|
1387
|
-
| `
|
|
1388
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `C`\> |
|
|
1414
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1389
1415
|
|
|
1390
1416
|
##### Parameters
|
|
1391
1417
|
|
|
1392
1418
|
| Name | Type |
|
|
1393
1419
|
| :------ | :------ |
|
|
1394
|
-
| `query` | `Q` & { `
|
|
1420
|
+
| `query` | `Q` & { `type`: `K` } |
|
|
1395
1421
|
|
|
1396
1422
|
##### Returns
|
|
1397
1423
|
|
|
@@ -1399,13 +1425,15 @@ typeof `query`
|
|
|
1399
1425
|
|
|
1400
1426
|
#### Defined in
|
|
1401
1427
|
|
|
1402
|
-
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/
|
|
1428
|
+
[lib/tools/defineCheckQuery.ts:8](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/defineCheckQuery.ts#L8)
|
|
1403
1429
|
|
|
1404
1430
|
___
|
|
1405
1431
|
|
|
1406
1432
|
### defineCustomFetch
|
|
1407
1433
|
|
|
1408
|
-
▸ **defineCustomFetch**<`M`\>(`handler`): <K, T, Q\>(`query`: `Q` & { `
|
|
1434
|
+
▸ **defineCustomFetch**<`M`\>(`handler`): <K, T, Q\>(`query`: `Q` & { `type`: `K` }) => `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\><T, Q\>(`type`: `T`[], `query`: `Q`) => `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1435
|
+
|
|
1436
|
+
Returns a custom fetch function that handles a `query`
|
|
1409
1437
|
|
|
1410
1438
|
#### Type parameters
|
|
1411
1439
|
|
|
@@ -1415,35 +1443,17 @@ ___
|
|
|
1415
1443
|
|
|
1416
1444
|
#### Parameters
|
|
1417
1445
|
|
|
1418
|
-
| Name | Type |
|
|
1419
|
-
| :------ | :------ |
|
|
1420
|
-
| `handler` | [`Handler`](README.md#handler)<`Object`, `any`, `never`, `never`\> |
|
|
1446
|
+
| Name | Type | Description |
|
|
1447
|
+
| :------ | :------ | :------ |
|
|
1448
|
+
| `handler` | [`Handler`](README.md#handler)<`Object`, `any`, `never`, `never`\> | The query handler. |
|
|
1421
1449
|
|
|
1422
1450
|
#### Returns
|
|
1423
1451
|
|
|
1424
1452
|
`fn`
|
|
1425
1453
|
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
##### Type parameters
|
|
1429
|
-
|
|
1430
|
-
| Name | Type |
|
|
1431
|
-
| :------ | :------ |
|
|
1432
|
-
| `K` | extends `string` \| `number` \| `symbol` |
|
|
1433
|
-
| `T` | extends `object` |
|
|
1434
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `undefined`\> |
|
|
1435
|
-
|
|
1436
|
-
##### Parameters
|
|
1454
|
+
A custom fetch function.
|
|
1437
1455
|
|
|
1438
|
-
|
|
1439
|
-
| :------ | :------ |
|
|
1440
|
-
| `query` | `Q` & { `customFields?`: `undefined` ; `type`: `K` } |
|
|
1441
|
-
|
|
1442
|
-
##### Returns
|
|
1443
|
-
|
|
1444
|
-
`Promise`<[`Result`](README.md#result)<`T`, `Q`, `undefined`\>\>
|
|
1445
|
-
|
|
1446
|
-
▸ <`K`, `T`, `Q`, `C`\>(`query`): `Promise`<[`Result`](README.md#result)<`T`, `Q`, `C`\>\>
|
|
1456
|
+
▸ <`K`, `T`, `Q`\>(`query`): `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1447
1457
|
|
|
1448
1458
|
##### Type parameters
|
|
1449
1459
|
|
|
@@ -1451,68 +1461,52 @@ ___
|
|
|
1451
1461
|
| :------ | :------ |
|
|
1452
1462
|
| `K` | extends `string` \| `number` \| `symbol` |
|
|
1453
1463
|
| `T` | extends `object` |
|
|
1454
|
-
| `Q` | extends [`Query`](README.md#query)<`T
|
|
1455
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
1464
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1456
1465
|
|
|
1457
1466
|
##### Parameters
|
|
1458
1467
|
|
|
1459
1468
|
| Name | Type |
|
|
1460
1469
|
| :------ | :------ |
|
|
1461
|
-
| `query` | `Q` & { `
|
|
1470
|
+
| `query` | `Q` & { `type`: `K` } |
|
|
1462
1471
|
|
|
1463
1472
|
##### Returns
|
|
1464
1473
|
|
|
1465
|
-
`Promise`<[`Result`](README.md#result)<`T`, `Q
|
|
1474
|
+
`Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1466
1475
|
|
|
1467
|
-
▸ <`T`, `Q`\>(`type`, `query`): `Promise`<[`Result`](README.md#result)<`T`, `Q
|
|
1476
|
+
▸ <`T`, `Q`\>(`type`, `query`): `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1468
1477
|
|
|
1469
1478
|
##### Type parameters
|
|
1470
1479
|
|
|
1471
1480
|
| Name | Type |
|
|
1472
1481
|
| :------ | :------ |
|
|
1473
1482
|
| `T` | extends `object` |
|
|
1474
|
-
| `Q` | extends [`Query`](README.md#query)<`T
|
|
1483
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1475
1484
|
|
|
1476
1485
|
##### Parameters
|
|
1477
1486
|
|
|
1478
1487
|
| Name | Type |
|
|
1479
1488
|
| :------ | :------ |
|
|
1480
1489
|
| `type` | `T`[] |
|
|
1481
|
-
| `query` | `Q`
|
|
1482
|
-
|
|
1483
|
-
##### Returns
|
|
1484
|
-
|
|
1485
|
-
`Promise`<[`Result`](README.md#result)<`T`, `Q`, `undefined`\>\>
|
|
1486
|
-
|
|
1487
|
-
▸ <`T`, `Q`, `C`\>(`query`): `Promise`<[`Result`](README.md#result)<`T`, `Q`, `C`\>\>
|
|
1488
|
-
|
|
1489
|
-
##### Type parameters
|
|
1490
|
-
|
|
1491
|
-
| Name | Type |
|
|
1492
|
-
| :------ | :------ |
|
|
1493
|
-
| `T` | extends `object` |
|
|
1494
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `C`\> |
|
|
1495
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
1496
|
-
|
|
1497
|
-
##### Parameters
|
|
1498
|
-
|
|
1499
|
-
| Name | Type |
|
|
1500
|
-
| :------ | :------ |
|
|
1501
|
-
| `query` | `Q` & { `customFields`: `C` ; `type`: `T`[] } |
|
|
1490
|
+
| `query` | `Q` |
|
|
1502
1491
|
|
|
1503
1492
|
##### Returns
|
|
1504
1493
|
|
|
1505
|
-
`Promise`<[`Result`](README.md#result)<`T`, `Q
|
|
1494
|
+
`Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1506
1495
|
|
|
1507
1496
|
#### Defined in
|
|
1508
1497
|
|
|
1509
|
-
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/
|
|
1498
|
+
[lib/tools/defineCustomFetch.ts:11](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/defineCustomFetch.ts#L11)
|
|
1510
1499
|
|
|
1511
1500
|
___
|
|
1512
1501
|
|
|
1513
1502
|
### defineGenericFetch
|
|
1514
1503
|
|
|
1515
|
-
▸ **defineGenericFetch**<`K`\>(`handler`): <T\>() => <Q\>(`query`: `Q` & { `
|
|
1504
|
+
▸ **defineGenericFetch**<`K`\>(`handler`): <T\>() => <Q\>(`query`: `Q` & { `type`: `K` \| `T`[] }) => `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1505
|
+
|
|
1506
|
+
Returns a generic fetch function that has to be called like this:
|
|
1507
|
+
```ts
|
|
1508
|
+
genericFetch<T>()(query)
|
|
1509
|
+
```
|
|
1516
1510
|
|
|
1517
1511
|
#### Type parameters
|
|
1518
1512
|
|
|
@@ -1522,15 +1516,17 @@ ___
|
|
|
1522
1516
|
|
|
1523
1517
|
#### Parameters
|
|
1524
1518
|
|
|
1525
|
-
| Name | Type |
|
|
1526
|
-
| :------ | :------ |
|
|
1527
|
-
| `handler` | [`Handler`](README.md#handler)<`Object`, `any`, `never`, `never`\> |
|
|
1519
|
+
| Name | Type | Description |
|
|
1520
|
+
| :------ | :------ | :------ |
|
|
1521
|
+
| `handler` | [`Handler`](README.md#handler)<`Object`, `any`, `never`, `never`\> | The query handler. |
|
|
1528
1522
|
|
|
1529
1523
|
#### Returns
|
|
1530
1524
|
|
|
1531
1525
|
`fn`
|
|
1532
1526
|
|
|
1533
|
-
|
|
1527
|
+
A curried generic fetch function.
|
|
1528
|
+
|
|
1529
|
+
▸ <`T`\>(): <Q\>(`query`: `Q` & { `type`: `K` \| `T`[] }) => `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1534
1530
|
|
|
1535
1531
|
##### Type parameters
|
|
1536
1532
|
|
|
@@ -1542,46 +1538,27 @@ ___
|
|
|
1542
1538
|
|
|
1543
1539
|
`fn`
|
|
1544
1540
|
|
|
1545
|
-
▸ <`Q`\>(`query`): `Promise`<[`Result`](README.md#result)<`T`, `Q
|
|
1546
|
-
|
|
1547
|
-
##### Type parameters
|
|
1548
|
-
|
|
1549
|
-
| Name | Type |
|
|
1550
|
-
| :------ | :------ |
|
|
1551
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `undefined`\> |
|
|
1552
|
-
|
|
1553
|
-
##### Parameters
|
|
1554
|
-
|
|
1555
|
-
| Name | Type |
|
|
1556
|
-
| :------ | :------ |
|
|
1557
|
-
| `query` | `Q` & { `customFields?`: `undefined` ; `type`: `K` \| `T`[] } |
|
|
1558
|
-
|
|
1559
|
-
##### Returns
|
|
1560
|
-
|
|
1561
|
-
`Promise`<[`Result`](README.md#result)<`T`, `Q`, `undefined`\>\>
|
|
1562
|
-
|
|
1563
|
-
▸ <`Q`, `C`\>(`query`): `Promise`<[`Result`](README.md#result)<`T`, `Q`, `C`\>\>
|
|
1541
|
+
▸ <`Q`\>(`query`): `Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1564
1542
|
|
|
1565
1543
|
##### Type parameters
|
|
1566
1544
|
|
|
1567
1545
|
| Name | Type |
|
|
1568
1546
|
| :------ | :------ |
|
|
1569
|
-
| `Q` | extends [`Query`](README.md#query)<`T
|
|
1570
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
1547
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1571
1548
|
|
|
1572
1549
|
##### Parameters
|
|
1573
1550
|
|
|
1574
1551
|
| Name | Type |
|
|
1575
1552
|
| :------ | :------ |
|
|
1576
|
-
| `query` | `Q` & { `
|
|
1553
|
+
| `query` | `Q` & { `type`: `K` \| `T`[] } |
|
|
1577
1554
|
|
|
1578
1555
|
##### Returns
|
|
1579
1556
|
|
|
1580
|
-
`Promise`<[`Result`](README.md#result)<`T`, `Q
|
|
1557
|
+
`Promise`<[`Result`](README.md#result)<`T`, `Q`\>\>
|
|
1581
1558
|
|
|
1582
1559
|
#### Defined in
|
|
1583
1560
|
|
|
1584
|
-
[lib/tools/defineGenericFetch.ts:
|
|
1561
|
+
[lib/tools/defineGenericFetch.ts:14](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/defineGenericFetch.ts#L14)
|
|
1585
1562
|
|
|
1586
1563
|
___
|
|
1587
1564
|
|
|
@@ -1605,7 +1582,7 @@ Escaped regular expression
|
|
|
1605
1582
|
|
|
1606
1583
|
#### Defined in
|
|
1607
1584
|
|
|
1608
|
-
[lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/
|
|
1585
|
+
[lib/tools/escapeRegex.ts:7](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/escapeRegex.ts#L7)
|
|
1609
1586
|
|
|
1610
1587
|
___
|
|
1611
1588
|
|
|
@@ -1629,13 +1606,13 @@ Handler that returns a promise that resolves to the response.
|
|
|
1629
1606
|
|
|
1630
1607
|
#### Defined in
|
|
1631
1608
|
|
|
1632
|
-
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1609
|
+
[lib/middlewares/fetchExternal.ts:12](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/fetchExternal.ts#L12)
|
|
1633
1610
|
|
|
1634
1611
|
___
|
|
1635
1612
|
|
|
1636
1613
|
### fetchLocal
|
|
1637
1614
|
|
|
1638
|
-
▸ **fetchLocal**<`T`\>(): [`Handler`](README.md#handler)<[`Query`](README.md#query)<`T
|
|
1615
|
+
▸ **fetchLocal**<`T`\>(): [`Handler`](README.md#handler)<[`Query`](README.md#query)<`T`\> & { `type`: `T`[] }, `any`, `never`, `never`\>
|
|
1639
1616
|
|
|
1640
1617
|
Performs the fetch query on local data.
|
|
1641
1618
|
|
|
@@ -1647,30 +1624,13 @@ Performs the fetch query on local data.
|
|
|
1647
1624
|
|
|
1648
1625
|
#### Returns
|
|
1649
1626
|
|
|
1650
|
-
[`Handler`](README.md#handler)<[`Query`](README.md#query)<`T
|
|
1627
|
+
[`Handler`](README.md#handler)<[`Query`](README.md#query)<`T`\> & { `type`: `T`[] }, `any`, `never`, `never`\>
|
|
1651
1628
|
|
|
1652
1629
|
Promise that resolves to the response.
|
|
1653
1630
|
|
|
1654
1631
|
#### Defined in
|
|
1655
1632
|
|
|
1656
|
-
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/
|
|
1657
|
-
|
|
1658
|
-
▸ **fetchLocal**<`T`, `C`\>(): [`Handler`](README.md#handler)<[`Query`](README.md#query)<`T`, `C`\> & { `customFields`: `C` ; `type`: `T`[] }, `any`, `never`, `never`\>
|
|
1659
|
-
|
|
1660
|
-
#### Type parameters
|
|
1661
|
-
|
|
1662
|
-
| Name | Type |
|
|
1663
|
-
| :------ | :------ |
|
|
1664
|
-
| `T` | extends `object` |
|
|
1665
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
1666
|
-
|
|
1667
|
-
#### Returns
|
|
1668
|
-
|
|
1669
|
-
[`Handler`](README.md#handler)<[`Query`](README.md#query)<`T`, `C`\> & { `customFields`: `C` ; `type`: `T`[] }, `any`, `never`, `never`\>
|
|
1670
|
-
|
|
1671
|
-
#### Defined in
|
|
1672
|
-
|
|
1673
|
-
[lib/middlewares/fetchLocal.ts:15](https://github.com/nevoland/quetch/blob/91f8b5b/lib/middlewares/fetchLocal.ts#L15)
|
|
1633
|
+
[lib/middlewares/fetchLocal.ts:9](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/fetchLocal.ts#L9)
|
|
1674
1634
|
|
|
1675
1635
|
___
|
|
1676
1636
|
|
|
@@ -1699,7 +1659,7 @@ ___
|
|
|
1699
1659
|
|
|
1700
1660
|
#### Defined in
|
|
1701
1661
|
|
|
1702
|
-
[lib/tools/filterChildren.ts:5](https://github.com/nevoland/quetch/blob/
|
|
1662
|
+
[lib/tools/filterChildren.ts:5](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/filterChildren.ts#L5)
|
|
1703
1663
|
|
|
1704
1664
|
___
|
|
1705
1665
|
|
|
@@ -1725,7 +1685,7 @@ ___
|
|
|
1725
1685
|
|
|
1726
1686
|
#### Defined in
|
|
1727
1687
|
|
|
1728
|
-
[lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/
|
|
1688
|
+
[lib/tools/filterFromContext.ts:5](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/filterFromContext.ts#L5)
|
|
1729
1689
|
|
|
1730
1690
|
___
|
|
1731
1691
|
|
|
@@ -1757,7 +1717,7 @@ Checks wether the provided `value` matches the `filter` or not.
|
|
|
1757
1717
|
|
|
1758
1718
|
#### Defined in
|
|
1759
1719
|
|
|
1760
|
-
[lib/tools/filterItem.ts:17](https://github.com/nevoland/quetch/blob/
|
|
1720
|
+
[lib/tools/filterItem.ts:17](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/filterItem.ts#L17)
|
|
1761
1721
|
|
|
1762
1722
|
___
|
|
1763
1723
|
|
|
@@ -1787,7 +1747,7 @@ ___
|
|
|
1787
1747
|
|
|
1788
1748
|
#### Defined in
|
|
1789
1749
|
|
|
1790
|
-
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/
|
|
1750
|
+
[lib/middlewares/identity.ts:3](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/identity.ts#L3)
|
|
1791
1751
|
|
|
1792
1752
|
___
|
|
1793
1753
|
|
|
@@ -1817,7 +1777,7 @@ Whether the provided filter is a group filter or not.
|
|
|
1817
1777
|
|
|
1818
1778
|
#### Defined in
|
|
1819
1779
|
|
|
1820
|
-
[lib/tools/isFilterGroup.ts:9](https://github.com/nevoland/quetch/blob/
|
|
1780
|
+
[lib/tools/isFilterGroup.ts:9](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/isFilterGroup.ts#L9)
|
|
1821
1781
|
|
|
1822
1782
|
___
|
|
1823
1783
|
|
|
@@ -1850,7 +1810,7 @@ Query handler
|
|
|
1850
1810
|
|
|
1851
1811
|
#### Defined in
|
|
1852
1812
|
|
|
1853
|
-
[lib/middlewares/log.ts:13](https://github.com/nevoland/quetch/blob/
|
|
1813
|
+
[lib/middlewares/log.ts:13](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/log.ts#L13)
|
|
1854
1814
|
|
|
1855
1815
|
___
|
|
1856
1816
|
|
|
@@ -1881,58 +1841,34 @@ ___
|
|
|
1881
1841
|
|
|
1882
1842
|
#### Defined in
|
|
1883
1843
|
|
|
1884
|
-
[lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/
|
|
1844
|
+
[lib/tools/normalizeOrder.ts:3](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/normalizeOrder.ts#L3)
|
|
1885
1845
|
|
|
1886
1846
|
___
|
|
1887
1847
|
|
|
1888
1848
|
### queryItemList
|
|
1889
1849
|
|
|
1890
|
-
▸ **queryItemList**<`T`, `Q`\>(`query`): [`Result`](README.md#result)<`T`, `Q
|
|
1891
|
-
|
|
1892
|
-
#### Type parameters
|
|
1893
|
-
|
|
1894
|
-
| Name | Type |
|
|
1895
|
-
| :------ | :------ |
|
|
1896
|
-
| `T` | extends `object` |
|
|
1897
|
-
| `Q` | extends [`Query`](README.md#query)<`T`, `undefined`\> |
|
|
1898
|
-
|
|
1899
|
-
#### Parameters
|
|
1900
|
-
|
|
1901
|
-
| Name | Type |
|
|
1902
|
-
| :------ | :------ |
|
|
1903
|
-
| `query` | `Q` & { `customFields?`: `undefined` ; `type`: `T`[] } |
|
|
1904
|
-
|
|
1905
|
-
#### Returns
|
|
1906
|
-
|
|
1907
|
-
[`Result`](README.md#result)<`T`, `Q`, `undefined`\>
|
|
1908
|
-
|
|
1909
|
-
#### Defined in
|
|
1910
|
-
|
|
1911
|
-
[lib/tools/queryItemList.ts:43](https://github.com/nevoland/quetch/blob/91f8b5b/lib/tools/queryItemList.ts#L43)
|
|
1912
|
-
|
|
1913
|
-
▸ **queryItemList**<`T`, `Q`, `C`\>(`query`): [`Result`](README.md#result)<`T`, `Q`, `C`\>
|
|
1850
|
+
▸ **queryItemList**<`T`, `Q`\>(`query`): [`Result`](README.md#result)<`T`, `Q`\>
|
|
1914
1851
|
|
|
1915
1852
|
#### Type parameters
|
|
1916
1853
|
|
|
1917
1854
|
| Name | Type |
|
|
1918
1855
|
| :------ | :------ |
|
|
1919
1856
|
| `T` | extends `object` |
|
|
1920
|
-
| `Q` | extends [`Query`](README.md#query)<`T
|
|
1921
|
-
| `C` | extends [`CustomFieldMap`](README.md#customfieldmap)<`T`\> |
|
|
1857
|
+
| `Q` | extends [`Query`](README.md#query)<`T`\> |
|
|
1922
1858
|
|
|
1923
1859
|
#### Parameters
|
|
1924
1860
|
|
|
1925
1861
|
| Name | Type |
|
|
1926
1862
|
| :------ | :------ |
|
|
1927
|
-
| `query` | `Q` & { `
|
|
1863
|
+
| `query` | `Q` & { `type`: `T`[] } |
|
|
1928
1864
|
|
|
1929
1865
|
#### Returns
|
|
1930
1866
|
|
|
1931
|
-
[`Result`](README.md#result)<`T`, `Q
|
|
1867
|
+
[`Result`](README.md#result)<`T`, `Q`\>
|
|
1932
1868
|
|
|
1933
1869
|
#### Defined in
|
|
1934
1870
|
|
|
1935
|
-
[lib/tools/queryItemList.ts:
|
|
1871
|
+
[lib/tools/queryItemList.ts:41](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/queryItemList.ts#L41)
|
|
1936
1872
|
|
|
1937
1873
|
___
|
|
1938
1874
|
|
|
@@ -1961,7 +1897,7 @@ Handler
|
|
|
1961
1897
|
|
|
1962
1898
|
#### Defined in
|
|
1963
1899
|
|
|
1964
|
-
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/
|
|
1900
|
+
[lib/middlewares/retry.ts:15](https://github.com/nevoland/quetch/blob/c78a2c0/lib/middlewares/retry.ts#L15)
|
|
1965
1901
|
|
|
1966
1902
|
___
|
|
1967
1903
|
|
|
@@ -1992,4 +1928,4 @@ The same array sorted in place.
|
|
|
1992
1928
|
|
|
1993
1929
|
#### Defined in
|
|
1994
1930
|
|
|
1995
|
-
[lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/
|
|
1931
|
+
[lib/tools/sortItemList.ts:12](https://github.com/nevoland/quetch/blob/c78a2c0/lib/tools/sortItemList.ts#L12)
|