-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathAccountsService.ts.snapshot.ts
More file actions
501 lines (500 loc) · 40.9 KB
/
Copy pathAccountsService.ts.snapshot.ts
File metadata and controls
501 lines (500 loc) · 40.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
/**
* This file was auto-generated by @openapi-qraft/cli.
* Do not make direct changes to the file.
*/
import type { paths } from "../../openapi.d.ts";
import type { DeepReadonly, InvalidateQueryFilters, OperationError, OperationInfiniteData, PartialParameters, QueryFiltersByParameters, QueryFiltersByQueryKey, QueryFnOptions, QueryFnOptionsByParameters, QueryFnOptionsByQueryKey, RequestFnResponse, ServiceOperationEnsureInfiniteQueryDataOptions, ServiceOperationEnsureQueryDataOptions, ServiceOperationFetchInfiniteQueryOptions, ServiceOperationFetchQueryOptions, ServiceOperationInfiniteQueryKey, ServiceOperationQueryKey, UseQueryOptionsForUseQueries, UseQueryOptionsForUseSuspenseQuery, WithOptional, QraftServiceOperationsToken } from "@openapi-qraft/tanstack-query-react-types";
import type { CancelOptions, DefinedInitialDataInfiniteOptions, DefinedInitialDataOptions, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, InfiniteQueryPageParamsOptions, InvalidateOptions, QueryState, RefetchOptions, ResetOptions, SetDataOptions, UndefinedInitialDataInfiniteOptions, UndefinedInitialDataOptions, Updater, UseInfiniteQueryResult, UseQueryResult, UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query";
export interface AccountsService {
getAccounts: {
/**/
<TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal>(options: QueryFnOptionsByQueryKey<GetAccountsSchema, GetAccountsParameters, TMeta, TSignal> | (QueryFnOptionsByParameters<GetAccountsParameters, TMeta, TSignal> | QueryFnOptions<TMeta, TSignal> | void), client?: (schema: GetAccountsSchema, options: {
parameters: GetAccountsParameters;
signal?: TSignal;
meta?: TMeta;
}) => Promise<RequestFnResponse<GetAccountsData, GetAccountsError>>): Promise<RequestFnResponse<GetAccountsData, GetAccountsError>>;
/**/
getQueryKey(parameters: DeepReadonly<GetAccountsParameters> | void): ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters>;
/**
* Performs asynchronous data fetching, manages loading states and error handling.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useQuery|`useQuery(...)` documentation}
* @example Query without parameters
* ```ts
* const { data, isLoading } = qraft.accounts.getAccounts.useQuery()
* ```
*/
useQuery<TData = GetAccountsData>(parameters: ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void), options: Omit<DefinedInitialDataOptions<GetAccountsData, GetAccountsError, TData, ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters>>, "queryKey">): DefinedUseQueryResult<TData, OperationError<GetAccountsError>>;
/**
* Performs asynchronous data fetching, manages loading states and error handling.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useQuery|`useQuery(...)` documentation}
* @example Query without parameters
* ```ts
* const { data, isLoading } = qraft.accounts.getAccounts.useQuery()
* ```
*/
useQuery<TData = GetAccountsData>(parameters: ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void), options?: Omit<UndefinedInitialDataOptions<GetAccountsData, GetAccountsError, TData, ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters>>, "queryKey">): UseQueryResult<TData, OperationError<GetAccountsError>>;
/**/
getInfiniteQueryKey(parameters: DeepReadonly<GetAccountsParameters> | void): ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters>;
/**
* Performs asynchronous data fetching with support for infinite scrolling scenarios.
* Manages paginated data and provides utilities for fetching additional pages.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useInfiniteQuery|`useInfiniteQuery(...)` documentation}
*
* @example Infinite Query
* ```ts
* const { data, isLoading, fetchNextPage } = qraft.accounts.getAccounts.useInfiniteQuery({}, {
* initialPageParam: {},
* getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => getNextPageParams(lastPage)
* })
*
* console.log(data);
* fetchNextPage(); // Fetch the next page
* ```
*/
useInfiniteQuery<TPageParam extends GetAccountsParameters, TQueryFnData = GetAccountsData, TData = OperationInfiniteData<TQueryFnData, GetAccountsParameters>>(parameters: ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void), options: Omit<DefinedInitialDataInfiniteOptions<TQueryFnData, GetAccountsError, TData, ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters>, PartialParameters<DeepReadonly<TPageParam>>>, "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> & InfiniteQueryPageParamsOptions<TQueryFnData, PartialParameters<DeepReadonly<TPageParam>>>): DefinedUseInfiniteQueryResult<TData, OperationError<GetAccountsError>>;
/**
* Performs asynchronous data fetching with support for infinite scrolling scenarios.
* Manages paginated data and provides utilities for fetching additional pages.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useInfiniteQuery|`useInfiniteQuery(...)` documentation}
*
* @example Infinite Query
* ```ts
* const { data, isLoading, fetchNextPage } = qraft.accounts.getAccounts.useInfiniteQuery({}, {
* initialPageParam: {},
* getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => getNextPageParams(lastPage)
* })
*
* console.log(data);
* fetchNextPage(); // Fetch the next page
* ```
*/
useInfiniteQuery<TPageParam extends GetAccountsParameters, TQueryFnData = GetAccountsData, TData = OperationInfiniteData<TQueryFnData, GetAccountsParameters>>(parameters: ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void), options: Omit<UndefinedInitialDataInfiniteOptions<TQueryFnData, GetAccountsError, TData, ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters>, PartialParameters<DeepReadonly<TPageParam>>>, "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> & InfiniteQueryPageParamsOptions<TQueryFnData, PartialParameters<DeepReadonly<TPageParam>>>): UseInfiniteQueryResult<TData, OperationError<GetAccountsError>>;
/**
* Monitors the number of queries currently fetching, matching the provided filters.
* Useful for creating loading indicators or performing actions based on active requests.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useIsFetching|`useIsFetching(...)` documentation}
* @example Checks the total number of queries fetching from the specified service method,
* both normal and infinite. If no parameters are provided, no filtering is applied.
* ```ts
* const getAccountsTotal = qraft.accounts.getAccounts.useIsFetching()
* ```
*/
useIsFetching<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>): number;
/**
* Allows you to execute multiple asynchronous data fetching operations concurrently. This is especially useful for managing complex data dependencies in parallel.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useQueries|`useQueries(...)` documentation}
* @example Multiple queries. Returns `data`, `error`, `isSuccess` and other properties.
* ```ts
* const getAccountsResults = qraft.accounts.getAccounts.useQueries({
* queries: [
* {},
* {}
* ]
* });
* getAccountsResults.forEach(({ isSuccess, data, error }) => console.log({ isSuccess, data, error }));
* ```
* @example Combined results. Only the data will be returned.
* ```ts
* const getAccountsCombinedResults = qraft.accounts.getAccounts.useQueries({
* combine: results => results.map(result => result.data),
* queries: [
* {},
* {}
* ]
* });
* getAccountsCombinedResults.forEach(data => console.log({ data }));
* ```
*/
useQueries<T extends Array<UseQueryOptionsForUseQueries<GetAccountsSchema, GetAccountsParameters, GetAccountsData, GetAccountsError>>, TCombinedResult = Array<UseQueryResult<GetAccountsData, GetAccountsError>>>(options: {
queries: T;
combine?: (results: Array<UseQueryResult<GetAccountsData, GetAccountsError>>) => TCombinedResult;
}): TCombinedResult;
/**
* Performs asynchronous data fetching with Suspense support.
* Similar to useQuery but integrates with React Suspense for loading states.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useSuspenseQuery|`useSuspenseQuery(...)` documentation}
* @example Suspense Query without parameters
* ```ts
* const data = qraft.accounts.getAccounts.useSuspenseQuery()
* ```
*/
useSuspenseQuery<TData = GetAccountsData>(parameters: ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void), options?: Omit<UseSuspenseQueryOptions<GetAccountsData, GetAccountsError, TData, ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters>>, "queryKey">): UseSuspenseQueryResult<TData, OperationError<GetAccountsError>>;
/**
* Performs asynchronous data fetching with support for infinite scrolling scenarios.
* Manages paginated data and provides utilities for fetching additional pages.
* It functions similarly to `useInfiniteQuery`, but with added support for React Suspense.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useSuspenseInfiniteQuery|`useSuspenseInfiniteQuery(...)` documentation}
*
* @example Suspense Infinite Query
* ```ts
* const { data, isLoading, fetchNextPage } = qraft.accounts.getAccounts.useSuspenseInfiniteQuery({}, {
* initialPageParam: {},
* getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => getNextPageParams(lastPage)
* })
*
* console.log(data);
* fetchNextPage(); // Fetch the next page
* ```
*/
useSuspenseInfiniteQuery<TPageParam extends GetAccountsParameters, TData = GetAccountsData>(parameters: ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void), options: Omit<UseSuspenseInfiniteQueryOptions<GetAccountsData, GetAccountsError, OperationInfiniteData<TData, GetAccountsParameters>, ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters>, PartialParameters<DeepReadonly<TPageParam>>>, "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> & InfiniteQueryPageParamsOptions<GetAccountsData, PartialParameters<DeepReadonly<TPageParam>>>): UseSuspenseInfiniteQueryResult<OperationInfiniteData<TData, GetAccountsParameters>, OperationError<GetAccountsError>>;
/**
* Allows you to execute multiple asynchronous data fetching operations concurrently with Suspense support.
* Similar to useQueries but integrates with React Suspense for loading states.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useSuspenseQueries|`useSuspenseQueries(...)` documentation}
* @example Basic usage with Suspense
* ```ts
* const getAccountsData = qraft.accounts.getAccounts.useSuspenseQueries({
* queries: [
* {},
* {}
* ]
* });
* getAccountsResults.forEach(({ isSuccess, data, error }) => console.log({ isSuccess, data, error }));
* ```
* @example With data transformation using combine
* ```ts
* const getAccountsCombinedData = qraft.accounts.getAccounts.useSuspenseQueries({
* combine: results => results.map(result => result.data),
* queries: [
* {},
* {}
* ]
* });
* getAccountsCombinedData.forEach(data => console.log({ data }));
* ```
*/
useSuspenseQueries<T extends Array<UseQueryOptionsForUseSuspenseQuery<GetAccountsSchema, GetAccountsParameters, GetAccountsData, GetAccountsError>>, TCombinedResult = Array<UseSuspenseQueryResult<GetAccountsData, GetAccountsError>>>(options: {
queries: T;
combine?: (results: Array<WithOptional<UseSuspenseQueryResult<GetAccountsData, GetAccountsError>, "data">>) => TCombinedResult;
}): TCombinedResult;
/**/
fetchQuery(options: ServiceOperationFetchQueryOptions<GetAccountsSchema, GetAccountsData, GetAccountsParameters, GetAccountsError> | void): Promise<GetAccountsData>;
/**/
prefetchQuery(options: ServiceOperationFetchQueryOptions<GetAccountsSchema, GetAccountsData, GetAccountsParameters, GetAccountsError> | void): Promise<void>;
/**/
ensureQueryData(options: ServiceOperationEnsureQueryDataOptions<GetAccountsSchema, GetAccountsData, GetAccountsParameters, GetAccountsError> | void): Promise<GetAccountsData>;
/**/
fetchInfiniteQuery<TPageParam extends GetAccountsParameters>(options: ServiceOperationFetchInfiniteQueryOptions<GetAccountsSchema, GetAccountsData, GetAccountsParameters, DeepReadonly<TPageParam>, GetAccountsError> | void): Promise<OperationInfiniteData<GetAccountsData, GetAccountsParameters>>;
/**/
prefetchInfiniteQuery<TPageParam extends GetAccountsParameters>(options: ServiceOperationFetchInfiniteQueryOptions<GetAccountsSchema, GetAccountsData, GetAccountsParameters, DeepReadonly<TPageParam>, GetAccountsError> | void): Promise<void>;
/**/
ensureInfiniteQueryData<TPageParam extends GetAccountsParameters>(options: ServiceOperationEnsureInfiniteQueryDataOptions<GetAccountsSchema, GetAccountsData, GetAccountsParameters, DeepReadonly<TPageParam>, GetAccountsError> | void): Promise<OperationInfiniteData<GetAccountsData, GetAccountsParameters>>;
/**/
getQueryData(parameters: ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void)): GetAccountsData | undefined;
/**/
getInfiniteQueryData(parameters: ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void)): OperationInfiniteData<GetAccountsData, GetAccountsParameters> | undefined;
/**/
getQueriesData<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>): TInfinite extends true ? Array<[
queryKey: ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters>,
data: NoInfer<OperationInfiniteData<GetAccountsData, GetAccountsParameters>> | undefined
]> : Array<[
queryKey: ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters>,
data: GetAccountsData | undefined
]>;
/**/
getQueryState(parameters: ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters> | (DeepReadonly<GetAccountsParameters> | void)): QueryState<GetAccountsData, GetAccountsError> | undefined;
/**/
getInfiniteQueryState(parameters: DeepReadonly<GetAccountsParameters> | ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters> | void): QueryState<OperationInfiniteData<GetAccountsData, GetAccountsParameters>, GetAccountsError> | undefined;
/**/
setQueryData(parameters: (DeepReadonly<GetAccountsParameters> | undefined) | ServiceOperationQueryKey<GetAccountsSchema, GetAccountsParameters>, updater: Updater<NoInfer<GetAccountsData> | undefined, NoInfer<DeepReadonly<GetAccountsData>> | undefined>, options?: SetDataOptions): GetAccountsData | undefined;
/**/
setInfiniteQueryData(parameters: (DeepReadonly<GetAccountsParameters> | undefined) | ServiceOperationInfiniteQueryKey<GetAccountsSchema, GetAccountsParameters>, updater: Updater<NoInfer<OperationInfiniteData<GetAccountsData, GetAccountsParameters>> | undefined, NoInfer<DeepReadonly<OperationInfiniteData<GetAccountsData, GetAccountsParameters>>> | undefined>, options?: SetDataOptions): OperationInfiniteData<GetAccountsData, GetAccountsParameters> | undefined;
/**/
setQueriesData<TInfinite extends boolean = false>(filters: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>, updater: Updater<NoInfer<GetAccountsData> | undefined, NoInfer<GetAccountsData> | undefined>, options?: SetDataOptions): Array<GetAccountsData | undefined>;
/**/
invalidateQueries<TInfinite extends boolean = false>(filters?: InvalidateQueryFilters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>, options?: InvalidateOptions): Promise<void>;
/**/
refetchQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>, options?: RefetchOptions): Promise<void>;
/**/
cancelQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>, options?: CancelOptions): Promise<void>;
/**/
removeQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>): void;
/**/
resetQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>, options?: ResetOptions): Promise<void>;
/**/
isFetching<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError> | QueryFiltersByQueryKey<GetAccountsSchema, GetAccountsData, TInfinite, GetAccountsParameters, GetAccountsError>): number;
schema: GetAccountsSchema;
types: {
parameters: GetAccountsParameters;
data: GetAccountsData;
error: GetAccountsError;
};
};
getAccountProfile: {
/**/
<TMeta extends Record<string, any>, TSignal extends AbortSignal = AbortSignal>(options: QueryFnOptionsByQueryKey<GetAccountProfileSchema, GetAccountProfileParameters, TMeta, TSignal> | (QueryFnOptionsByParameters<GetAccountProfileParameters, TMeta, TSignal> | QueryFnOptions<TMeta, TSignal> | void), client?: (schema: GetAccountProfileSchema, options: {
parameters: GetAccountProfileParameters;
signal?: TSignal;
meta?: TMeta;
}) => Promise<RequestFnResponse<GetAccountProfileData, GetAccountProfileError>>): Promise<RequestFnResponse<GetAccountProfileData, GetAccountProfileError>>;
/**/
getQueryKey(parameters: DeepReadonly<GetAccountProfileParameters> | void): ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>;
/**
* Performs asynchronous data fetching, manages loading states and error handling.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useQuery|`useQuery(...)` documentation}
* @example Query without parameters
* ```ts
* const { data, isLoading } = qraft.accounts.getAccountProfile.useQuery()
* ```
*/
useQuery<TData = GetAccountProfileData>(parameters: ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void), options: Omit<DefinedInitialDataOptions<GetAccountProfileData, GetAccountProfileError, TData, ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>>, "queryKey">): DefinedUseQueryResult<TData, OperationError<GetAccountProfileError>>;
/**
* Performs asynchronous data fetching, manages loading states and error handling.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useQuery|`useQuery(...)` documentation}
* @example Query without parameters
* ```ts
* const { data, isLoading } = qraft.accounts.getAccountProfile.useQuery()
* ```
*/
useQuery<TData = GetAccountProfileData>(parameters: ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void), options?: Omit<UndefinedInitialDataOptions<GetAccountProfileData, GetAccountProfileError, TData, ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>>, "queryKey">): UseQueryResult<TData, OperationError<GetAccountProfileError>>;
/**/
getInfiniteQueryKey(parameters: DeepReadonly<GetAccountProfileParameters> | void): ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>;
/**
* Performs asynchronous data fetching with support for infinite scrolling scenarios.
* Manages paginated data and provides utilities for fetching additional pages.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useInfiniteQuery|`useInfiniteQuery(...)` documentation}
*
* @example Infinite Query
* ```ts
* const { data, isLoading, fetchNextPage } = qraft.accounts.getAccountProfile.useInfiniteQuery({}, {
* initialPageParam: {},
* getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => getNextPageParams(lastPage)
* })
*
* console.log(data);
* fetchNextPage(); // Fetch the next page
* ```
*/
useInfiniteQuery<TPageParam extends GetAccountProfileParameters, TQueryFnData = GetAccountProfileData, TData = OperationInfiniteData<TQueryFnData, GetAccountProfileParameters>>(parameters: ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void), options: Omit<DefinedInitialDataInfiniteOptions<TQueryFnData, GetAccountProfileError, TData, ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>, PartialParameters<DeepReadonly<TPageParam>>>, "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> & InfiniteQueryPageParamsOptions<TQueryFnData, PartialParameters<DeepReadonly<TPageParam>>>): DefinedUseInfiniteQueryResult<TData, OperationError<GetAccountProfileError>>;
/**
* Performs asynchronous data fetching with support for infinite scrolling scenarios.
* Manages paginated data and provides utilities for fetching additional pages.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useInfiniteQuery|`useInfiniteQuery(...)` documentation}
*
* @example Infinite Query
* ```ts
* const { data, isLoading, fetchNextPage } = qraft.accounts.getAccountProfile.useInfiniteQuery({}, {
* initialPageParam: {},
* getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => getNextPageParams(lastPage)
* })
*
* console.log(data);
* fetchNextPage(); // Fetch the next page
* ```
*/
useInfiniteQuery<TPageParam extends GetAccountProfileParameters, TQueryFnData = GetAccountProfileData, TData = OperationInfiniteData<TQueryFnData, GetAccountProfileParameters>>(parameters: ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void), options: Omit<UndefinedInitialDataInfiniteOptions<TQueryFnData, GetAccountProfileError, TData, ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>, PartialParameters<DeepReadonly<TPageParam>>>, "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> & InfiniteQueryPageParamsOptions<TQueryFnData, PartialParameters<DeepReadonly<TPageParam>>>): UseInfiniteQueryResult<TData, OperationError<GetAccountProfileError>>;
/**
* Monitors the number of queries currently fetching, matching the provided filters.
* Useful for creating loading indicators or performing actions based on active requests.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useIsFetching|`useIsFetching(...)` documentation}
* @example Checks the total number of queries fetching from the specified service method,
* both normal and infinite. If no parameters are provided, no filtering is applied.
* ```ts
* const getAccountProfileTotal = qraft.accounts.getAccountProfile.useIsFetching()
* ```
*/
useIsFetching<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>): number;
/**
* Allows you to execute multiple asynchronous data fetching operations concurrently. This is especially useful for managing complex data dependencies in parallel.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useQueries|`useQueries(...)` documentation}
* @example Multiple queries. Returns `data`, `error`, `isSuccess` and other properties.
* ```ts
* const getAccountProfileResults = qraft.accounts.getAccountProfile.useQueries({
* queries: [
* {},
* {}
* ]
* });
* getAccountProfileResults.forEach(({ isSuccess, data, error }) => console.log({ isSuccess, data, error }));
* ```
* @example Combined results. Only the data will be returned.
* ```ts
* const getAccountProfileCombinedResults = qraft.accounts.getAccountProfile.useQueries({
* combine: results => results.map(result => result.data),
* queries: [
* {},
* {}
* ]
* });
* getAccountProfileCombinedResults.forEach(data => console.log({ data }));
* ```
*/
useQueries<T extends Array<UseQueryOptionsForUseQueries<GetAccountProfileSchema, GetAccountProfileParameters, GetAccountProfileData, GetAccountProfileError>>, TCombinedResult = Array<UseQueryResult<GetAccountProfileData, GetAccountProfileError>>>(options: {
queries: T;
combine?: (results: Array<UseQueryResult<GetAccountProfileData, GetAccountProfileError>>) => TCombinedResult;
}): TCombinedResult;
/**
* Performs asynchronous data fetching with Suspense support.
* Similar to useQuery but integrates with React Suspense for loading states.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useSuspenseQuery|`useSuspenseQuery(...)` documentation}
* @example Suspense Query without parameters
* ```ts
* const data = qraft.accounts.getAccountProfile.useSuspenseQuery()
* ```
*/
useSuspenseQuery<TData = GetAccountProfileData>(parameters: ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void), options?: Omit<UseSuspenseQueryOptions<GetAccountProfileData, GetAccountProfileError, TData, ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>>, "queryKey">): UseSuspenseQueryResult<TData, OperationError<GetAccountProfileError>>;
/**
* Performs asynchronous data fetching with support for infinite scrolling scenarios.
* Manages paginated data and provides utilities for fetching additional pages.
* It functions similarly to `useInfiniteQuery`, but with added support for React Suspense.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useSuspenseInfiniteQuery|`useSuspenseInfiniteQuery(...)` documentation}
*
* @example Suspense Infinite Query
* ```ts
* const { data, isLoading, fetchNextPage } = qraft.accounts.getAccountProfile.useSuspenseInfiniteQuery({}, {
* initialPageParam: {},
* getNextPageParam: (lastPage, allPages, lastPageParam, allPageParams) => getNextPageParams(lastPage)
* })
*
* console.log(data);
* fetchNextPage(); // Fetch the next page
* ```
*/
useSuspenseInfiniteQuery<TPageParam extends GetAccountProfileParameters, TData = GetAccountProfileData>(parameters: ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void), options: Omit<UseSuspenseInfiniteQueryOptions<GetAccountProfileData, GetAccountProfileError, OperationInfiniteData<TData, GetAccountProfileParameters>, ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>, PartialParameters<DeepReadonly<TPageParam>>>, "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> & InfiniteQueryPageParamsOptions<GetAccountProfileData, PartialParameters<DeepReadonly<TPageParam>>>): UseSuspenseInfiniteQueryResult<OperationInfiniteData<TData, GetAccountProfileParameters>, OperationError<GetAccountProfileError>>;
/**
* Allows you to execute multiple asynchronous data fetching operations concurrently with Suspense support.
* Similar to useQueries but integrates with React Suspense for loading states.
*
* @see {@link https://openapi-qraft.github.io/openapi-qraft/docs/hooks/useSuspenseQueries|`useSuspenseQueries(...)` documentation}
* @example Basic usage with Suspense
* ```ts
* const getAccountProfileData = qraft.accounts.getAccountProfile.useSuspenseQueries({
* queries: [
* {},
* {}
* ]
* });
* getAccountProfileResults.forEach(({ isSuccess, data, error }) => console.log({ isSuccess, data, error }));
* ```
* @example With data transformation using combine
* ```ts
* const getAccountProfileCombinedData = qraft.accounts.getAccountProfile.useSuspenseQueries({
* combine: results => results.map(result => result.data),
* queries: [
* {},
* {}
* ]
* });
* getAccountProfileCombinedData.forEach(data => console.log({ data }));
* ```
*/
useSuspenseQueries<T extends Array<UseQueryOptionsForUseSuspenseQuery<GetAccountProfileSchema, GetAccountProfileParameters, GetAccountProfileData, GetAccountProfileError>>, TCombinedResult = Array<UseSuspenseQueryResult<GetAccountProfileData, GetAccountProfileError>>>(options: {
queries: T;
combine?: (results: Array<WithOptional<UseSuspenseQueryResult<GetAccountProfileData, GetAccountProfileError>, "data">>) => TCombinedResult;
}): TCombinedResult;
/**/
fetchQuery(options: ServiceOperationFetchQueryOptions<GetAccountProfileSchema, GetAccountProfileData, GetAccountProfileParameters, GetAccountProfileError> | void): Promise<GetAccountProfileData>;
/**/
prefetchQuery(options: ServiceOperationFetchQueryOptions<GetAccountProfileSchema, GetAccountProfileData, GetAccountProfileParameters, GetAccountProfileError> | void): Promise<void>;
/**/
ensureQueryData(options: ServiceOperationEnsureQueryDataOptions<GetAccountProfileSchema, GetAccountProfileData, GetAccountProfileParameters, GetAccountProfileError> | void): Promise<GetAccountProfileData>;
/**/
fetchInfiniteQuery<TPageParam extends GetAccountProfileParameters>(options: ServiceOperationFetchInfiniteQueryOptions<GetAccountProfileSchema, GetAccountProfileData, GetAccountProfileParameters, DeepReadonly<TPageParam>, GetAccountProfileError> | void): Promise<OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters>>;
/**/
prefetchInfiniteQuery<TPageParam extends GetAccountProfileParameters>(options: ServiceOperationFetchInfiniteQueryOptions<GetAccountProfileSchema, GetAccountProfileData, GetAccountProfileParameters, DeepReadonly<TPageParam>, GetAccountProfileError> | void): Promise<void>;
/**/
ensureInfiniteQueryData<TPageParam extends GetAccountProfileParameters>(options: ServiceOperationEnsureInfiniteQueryDataOptions<GetAccountProfileSchema, GetAccountProfileData, GetAccountProfileParameters, DeepReadonly<TPageParam>, GetAccountProfileError> | void): Promise<OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters>>;
/**/
getQueryData(parameters: ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void)): GetAccountProfileData | undefined;
/**/
getInfiniteQueryData(parameters: ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void)): OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters> | undefined;
/**/
getQueriesData<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>): TInfinite extends true ? Array<[
queryKey: ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>,
data: NoInfer<OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters>> | undefined
]> : Array<[
queryKey: ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>,
data: GetAccountProfileData | undefined
]>;
/**/
getQueryState(parameters: ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | (DeepReadonly<GetAccountProfileParameters> | void)): QueryState<GetAccountProfileData, GetAccountProfileError> | undefined;
/**/
getInfiniteQueryState(parameters: DeepReadonly<GetAccountProfileParameters> | ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters> | void): QueryState<OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters>, GetAccountProfileError> | undefined;
/**/
setQueryData(parameters: (DeepReadonly<GetAccountProfileParameters> | undefined) | ServiceOperationQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>, updater: Updater<NoInfer<GetAccountProfileData> | undefined, NoInfer<DeepReadonly<GetAccountProfileData>> | undefined>, options?: SetDataOptions): GetAccountProfileData | undefined;
/**/
setInfiniteQueryData(parameters: (DeepReadonly<GetAccountProfileParameters> | undefined) | ServiceOperationInfiniteQueryKey<GetAccountProfileSchema, GetAccountProfileParameters>, updater: Updater<NoInfer<OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters>> | undefined, NoInfer<DeepReadonly<OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters>>> | undefined>, options?: SetDataOptions): OperationInfiniteData<GetAccountProfileData, GetAccountProfileParameters> | undefined;
/**/
setQueriesData<TInfinite extends boolean = false>(filters: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>, updater: Updater<NoInfer<GetAccountProfileData> | undefined, NoInfer<GetAccountProfileData> | undefined>, options?: SetDataOptions): Array<GetAccountProfileData | undefined>;
/**/
invalidateQueries<TInfinite extends boolean = false>(filters?: InvalidateQueryFilters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>, options?: InvalidateOptions): Promise<void>;
/**/
refetchQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>, options?: RefetchOptions): Promise<void>;
/**/
cancelQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>, options?: CancelOptions): Promise<void>;
/**/
removeQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>): void;
/**/
resetQueries<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>, options?: ResetOptions): Promise<void>;
/**/
isFetching<TInfinite extends boolean = false>(filters?: QueryFiltersByParameters<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError> | QueryFiltersByQueryKey<GetAccountProfileSchema, GetAccountProfileData, TInfinite, GetAccountProfileParameters, GetAccountProfileError>): number;
schema: GetAccountProfileSchema;
types: {
parameters: GetAccountProfileParameters;
data: GetAccountProfileData;
error: GetAccountProfileError;
};
};
}
export const getAccounts = {
schema: {
method: "get",
url: "/accounts",
security: ["jwtUserToken", "sessionToken"]
}
} as {
schema: GetAccountsSchema;
[QraftServiceOperationsToken]: AccountsService["getAccounts"];
};
export const getAccountProfile = {
schema: {
method: "get",
url: "/accounts/profile",
security: ["jwtUserToken"]
}
} as {
schema: GetAccountProfileSchema;
[QraftServiceOperationsToken]: AccountsService["getAccountProfile"];
};
export const accountsService = {
getAccounts,
getAccountProfile
} as const;
type GetAccountsSchema = {
method: "get";
url: "/accounts";
security: [
"jwtUserToken",
"sessionToken"
];
};
type GetAccountsParameters = undefined;
type GetAccountsData = null;
type GetAccountsError = unknown;
type GetAccountProfileSchema = {
method: "get";
url: "/accounts/profile";
security: [
"jwtUserToken"
];
};
type GetAccountProfileParameters = undefined;
type GetAccountProfileData = null;
type GetAccountProfileError = unknown;