@squonk/data-manager-client 4.2.0 → 4.3.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/accounting/accounting.cjs +96 -95
- package/accounting/accounting.cjs.map +1 -1
- package/accounting/accounting.d.cts +47 -47
- package/accounting/accounting.d.ts +47 -47
- package/accounting/accounting.js +102 -101
- package/accounting/accounting.js.map +1 -1
- package/admin/admin.cjs +120 -145
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +121 -121
- package/admin/admin.d.ts +121 -121
- package/admin/admin.js +127 -152
- package/admin/admin.js.map +1 -1
- package/application/application.cjs +39 -43
- package/application/application.cjs.map +1 -1
- package/application/application.d.cts +25 -25
- package/application/application.d.ts +25 -25
- package/application/application.js +42 -46
- package/application/application.js.map +1 -1
- package/chunk-OYRETEBZ.js +25 -0
- package/chunk-OYRETEBZ.js.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/chunk-ZLY5XEOQ.cjs +25 -0
- package/chunk-ZLY5XEOQ.cjs.map +1 -0
- package/configuration/configuration.cjs +38 -45
- package/configuration/configuration.cjs.map +1 -1
- package/configuration/configuration.d.cts +25 -25
- package/configuration/configuration.d.ts +25 -25
- package/configuration/configuration.js +42 -49
- package/configuration/configuration.js.map +1 -1
- package/dataset/dataset.cjs +126 -141
- package/dataset/dataset.cjs.map +1 -1
- package/dataset/dataset.d.cts +102 -102
- package/dataset/dataset.d.ts +102 -102
- package/dataset/dataset.js +132 -147
- package/dataset/dataset.js.map +1 -1
- package/digest/digest.cjs +22 -24
- package/digest/digest.cjs.map +1 -1
- package/digest/digest.d.cts +14 -14
- package/digest/digest.d.ts +14 -14
- package/digest/digest.js +24 -26
- package/digest/digest.js.map +1 -1
- package/exchange-rate/exchange-rate.cjs +111 -109
- package/exchange-rate/exchange-rate.cjs.map +1 -1
- package/exchange-rate/exchange-rate.d.cts +69 -69
- package/exchange-rate/exchange-rate.d.ts +69 -69
- package/exchange-rate/exchange-rate.js +117 -115
- package/exchange-rate/exchange-rate.js.map +1 -1
- package/file-and-path/file-and-path.cjs +93 -138
- package/file-and-path/file-and-path.cjs.map +1 -1
- package/file-and-path/file-and-path.d.cts +102 -102
- package/file-and-path/file-and-path.d.ts +102 -102
- package/file-and-path/file-and-path.js +105 -150
- package/file-and-path/file-and-path.js.map +1 -1
- package/index.cjs +80 -102
- package/index.cjs.map +1 -1
- package/index.d.cts +2401 -2326
- package/index.d.ts +2401 -2326
- package/index.js +79 -101
- package/index.js.map +1 -1
- package/instance/instance.cjs +100 -107
- package/instance/instance.cjs.map +1 -1
- package/instance/instance.d.cts +76 -76
- package/instance/instance.d.ts +76 -76
- package/instance/instance.js +105 -112
- package/instance/instance.js.map +1 -1
- package/inventory/inventory.cjs +22 -25
- package/inventory/inventory.cjs.map +1 -1
- package/inventory/inventory.d.cts +14 -14
- package/inventory/inventory.d.ts +14 -14
- package/inventory/inventory.js +24 -27
- package/inventory/inventory.js.map +1 -1
- package/job/job.cjs +55 -67
- package/job/job.cjs.map +1 -1
- package/job/job.d.cts +36 -36
- package/job/job.d.ts +36 -36
- package/job/job.js +60 -72
- package/job/job.js.map +1 -1
- package/metadata/metadata.cjs +61 -59
- package/metadata/metadata.cjs.map +1 -1
- package/metadata/metadata.d.cts +47 -47
- package/metadata/metadata.d.ts +47 -47
- package/metadata/metadata.js +65 -63
- package/metadata/metadata.js.map +1 -1
- package/package.json +13 -16
- package/project/project.cjs +165 -186
- package/project/project.cjs.map +1 -1
- package/project/project.d.cts +157 -157
- package/project/project.d.ts +157 -157
- package/project/project.js +172 -193
- package/project/project.js.map +1 -1
- package/src/accounting/accounting.ts +767 -461
- package/src/admin/admin.ts +1187 -787
- package/src/application/application.ts +377 -231
- package/src/configuration/configuration.ts +348 -237
- package/src/custom-instance.ts +3 -3
- package/src/data-manager-api.schemas.ts +2538 -2492
- package/src/dataset/dataset.ts +1199 -792
- package/src/digest/digest.ts +198 -122
- package/src/exchange-rate/exchange-rate.ts +1088 -612
- package/src/file-and-path/file-and-path.ts +869 -616
- package/src/index.ts +2 -2
- package/src/instance/instance.ts +804 -539
- package/src/inventory/inventory.ts +200 -122
- package/src/job/job.ts +556 -348
- package/src/metadata/metadata.ts +587 -371
- package/src/options-mutator.ts +27 -0
- package/src/project/project.ts +1576 -1034
- package/src/task/task.ts +434 -295
- package/src/type/type.ts +180 -126
- package/src/user/user.ts +846 -398
- package/src/workflow/workflow.ts +1750 -1089
- package/task/task.cjs +45 -59
- package/task/task.cjs.map +1 -1
- package/task/task.d.cts +33 -33
- package/task/task.d.ts +33 -33
- package/task/task.js +51 -65
- package/task/task.js.map +1 -1
- package/type/type.cjs +21 -26
- package/type/type.cjs.map +1 -1
- package/type/type.d.cts +14 -14
- package/type/type.d.ts +14 -14
- package/type/type.js +24 -29
- package/type/type.js.map +1 -1
- package/user/user.cjs +114 -80
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +107 -48
- package/user/user.d.ts +107 -48
- package/user/user.js +120 -86
- package/user/user.js.map +1 -1
- package/workflow/workflow.cjs +179 -193
- package/workflow/workflow.cjs.map +1 -1
- package/workflow/workflow.d.cts +146 -146
- package/workflow/workflow.d.ts +146 -146
- package/workflow/workflow.js +187 -201
- package/workflow/workflow.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
package/src/user/user.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.10.0 🍺
|
|
4
3
|
* Do not edit manually.
|
|
5
4
|
* Dataset Manager API
|
|
6
5
|
* The Dataset Manager API service.
|
|
@@ -9,16 +8,13 @@ A service that allows *registered* users to make **Datasets** and associated **M
|
|
|
9
8
|
|
|
10
9
|
* OpenAPI spec version: 4.1
|
|
11
10
|
*/
|
|
12
|
-
import {
|
|
13
|
-
useMutation,
|
|
14
|
-
useQuery,
|
|
15
|
-
useSuspenseQuery
|
|
16
|
-
} from '@tanstack/react-query'
|
|
11
|
+
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
17
12
|
import type {
|
|
18
13
|
DataTag,
|
|
19
14
|
DefinedInitialDataOptions,
|
|
20
15
|
DefinedUseQueryResult,
|
|
21
16
|
MutationFunction,
|
|
17
|
+
QueryClient,
|
|
22
18
|
QueryFunction,
|
|
23
19
|
QueryKey,
|
|
24
20
|
UndefinedInitialDataOptions,
|
|
@@ -27,8 +23,9 @@ import type {
|
|
|
27
23
|
UseQueryOptions,
|
|
28
24
|
UseQueryResult,
|
|
29
25
|
UseSuspenseQueryOptions,
|
|
30
|
-
UseSuspenseQueryResult
|
|
31
|
-
} from
|
|
26
|
+
UseSuspenseQueryResult,
|
|
27
|
+
} from "@tanstack/react-query";
|
|
28
|
+
|
|
32
29
|
import type {
|
|
33
30
|
DmError,
|
|
34
31
|
GetUserAccountParams,
|
|
@@ -36,14 +33,16 @@ import type {
|
|
|
36
33
|
UserAccountDetail,
|
|
37
34
|
UserAccountPatchBodyBody,
|
|
38
35
|
UserApiLogGetResponse,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
import type { ErrorType } from '.././custom-instance';
|
|
43
|
-
|
|
36
|
+
UserApiTokenGetResponse,
|
|
37
|
+
UsersGetResponse,
|
|
38
|
+
} from "../data-manager-api.schemas";
|
|
44
39
|
|
|
45
|
-
|
|
40
|
+
import { customInstance } from ".././custom-instance";
|
|
41
|
+
import type { ErrorType } from ".././custom-instance";
|
|
42
|
+
import { queryMutator } from ".././options-mutator";
|
|
43
|
+
import { mutationMutator } from ".././options-mutator";
|
|
46
44
|
|
|
45
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
47
46
|
|
|
48
47
|
/**
|
|
49
48
|
* Returns a summary of all users that have accessed the Data Manager API and where the account is not `private`. Users can set their accounts to be private and therefore will not show up in methods like this
|
|
@@ -51,501 +50,950 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
|
51
50
|
* @summary Get information about all known Users
|
|
52
51
|
*/
|
|
53
52
|
export const getUsers = (
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
options?: SecondParameter<typeof customInstance>,
|
|
54
|
+
signal?: AbortSignal,
|
|
56
55
|
) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return customInstance<UsersGetResponse>(
|
|
60
|
-
{url: `/user`, method: 'GET', signal
|
|
61
|
-
},
|
|
62
|
-
options);
|
|
63
|
-
}
|
|
64
|
-
|
|
56
|
+
return customInstance<UsersGetResponse>({ url: `/user`, method: "GET", signal }, options);
|
|
57
|
+
};
|
|
65
58
|
|
|
66
59
|
export const getGetUsersQueryKey = () => {
|
|
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
|
-
|
|
60
|
+
return [`/user`] as const;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const useGetUsersQueryOptions = <
|
|
64
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
65
|
+
TError = ErrorType<void | DmError>,
|
|
66
|
+
>(options?: {
|
|
67
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
68
|
+
request?: SecondParameter<typeof customInstance>;
|
|
69
|
+
}) => {
|
|
70
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
71
|
+
|
|
72
|
+
const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();
|
|
73
|
+
|
|
74
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({ signal }) =>
|
|
75
|
+
getUsers(requestOptions, signal);
|
|
76
|
+
|
|
77
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
78
|
+
|
|
79
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData> & {
|
|
80
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type GetUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
|
|
85
|
+
export type GetUsersQueryError = ErrorType<void | DmError>;
|
|
86
|
+
|
|
87
|
+
export function useGetUsers<
|
|
88
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
89
|
+
TError = ErrorType<void | DmError>,
|
|
90
|
+
>(
|
|
91
|
+
options: {
|
|
92
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>> &
|
|
93
|
+
Pick<
|
|
95
94
|
DefinedInitialDataOptions<
|
|
96
95
|
Awaited<ReturnType<typeof getUsers>>,
|
|
97
96
|
TError,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
97
|
+
Awaited<ReturnType<typeof getUsers>>
|
|
98
|
+
>,
|
|
99
|
+
"initialData"
|
|
100
|
+
>;
|
|
101
|
+
request?: SecondParameter<typeof customInstance>;
|
|
102
|
+
},
|
|
103
|
+
queryClient?: QueryClient,
|
|
104
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
105
|
+
export function useGetUsers<
|
|
106
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
107
|
+
TError = ErrorType<void | DmError>,
|
|
108
|
+
>(
|
|
109
|
+
options?: {
|
|
110
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>> &
|
|
111
|
+
Pick<
|
|
105
112
|
UndefinedInitialDataOptions<
|
|
106
113
|
Awaited<ReturnType<typeof getUsers>>,
|
|
107
114
|
TError,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
Awaited<ReturnType<typeof getUsers>>
|
|
116
|
+
>,
|
|
117
|
+
"initialData"
|
|
118
|
+
>;
|
|
119
|
+
request?: SecondParameter<typeof customInstance>;
|
|
120
|
+
},
|
|
121
|
+
queryClient?: QueryClient,
|
|
122
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
123
|
+
export function useGetUsers<
|
|
124
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
125
|
+
TError = ErrorType<void | DmError>,
|
|
126
|
+
>(
|
|
127
|
+
options?: {
|
|
128
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
129
|
+
request?: SecondParameter<typeof customInstance>;
|
|
130
|
+
},
|
|
131
|
+
queryClient?: QueryClient,
|
|
132
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
117
133
|
/**
|
|
118
134
|
* @summary Get information about all known Users
|
|
119
135
|
*/
|
|
120
136
|
|
|
121
|
-
export function useGetUsers<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
137
|
+
export function useGetUsers<
|
|
138
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
139
|
+
TError = ErrorType<void | DmError>,
|
|
140
|
+
>(
|
|
141
|
+
options?: {
|
|
142
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
143
|
+
request?: SecondParameter<typeof customInstance>;
|
|
144
|
+
},
|
|
145
|
+
queryClient?: QueryClient,
|
|
146
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
147
|
+
const queryOptions = useGetUsersQueryOptions(options);
|
|
127
148
|
|
|
128
|
-
const query = useQuery(queryOptions) as
|
|
149
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
150
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
151
|
+
};
|
|
129
152
|
|
|
130
|
-
query.queryKey = queryOptions.queryKey
|
|
153
|
+
query.queryKey = queryOptions.queryKey;
|
|
131
154
|
|
|
132
155
|
return query;
|
|
133
156
|
}
|
|
134
157
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
export
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
158
|
+
export const useGetUsersSuspenseQueryOptions = <
|
|
159
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
160
|
+
TError = ErrorType<void | DmError>,
|
|
161
|
+
>(options?: {
|
|
162
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
163
|
+
request?: SecondParameter<typeof customInstance>;
|
|
164
|
+
}) => {
|
|
165
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
166
|
+
|
|
167
|
+
const queryKey = queryOptions?.queryKey ?? getGetUsersQueryKey();
|
|
168
|
+
|
|
169
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUsers>>> = ({ signal }) =>
|
|
170
|
+
getUsers(requestOptions, signal);
|
|
171
|
+
|
|
172
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
173
|
+
|
|
174
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
175
|
+
Awaited<ReturnType<typeof getUsers>>,
|
|
176
|
+
TError,
|
|
177
|
+
TData
|
|
178
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type GetUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUsers>>>;
|
|
182
|
+
export type GetUsersSuspenseQueryError = ErrorType<void | DmError>;
|
|
183
|
+
|
|
184
|
+
export function useGetUsersSuspense<
|
|
185
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
186
|
+
TError = ErrorType<void | DmError>,
|
|
187
|
+
>(
|
|
188
|
+
options: {
|
|
189
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
190
|
+
request?: SecondParameter<typeof customInstance>;
|
|
191
|
+
},
|
|
192
|
+
queryClient?: QueryClient,
|
|
193
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
194
|
+
export function useGetUsersSuspense<
|
|
195
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
196
|
+
TError = ErrorType<void | DmError>,
|
|
197
|
+
>(
|
|
198
|
+
options?: {
|
|
199
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
200
|
+
request?: SecondParameter<typeof customInstance>;
|
|
201
|
+
},
|
|
202
|
+
queryClient?: QueryClient,
|
|
203
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
204
|
+
export function useGetUsersSuspense<
|
|
205
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
206
|
+
TError = ErrorType<void | DmError>,
|
|
207
|
+
>(
|
|
208
|
+
options?: {
|
|
209
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
210
|
+
request?: SecondParameter<typeof customInstance>;
|
|
211
|
+
},
|
|
212
|
+
queryClient?: QueryClient,
|
|
213
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
171
214
|
/**
|
|
172
215
|
* @summary Get information about all known Users
|
|
173
216
|
*/
|
|
174
217
|
|
|
175
|
-
export function useGetUsersSuspense<
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
218
|
+
export function useGetUsersSuspense<
|
|
219
|
+
TData = Awaited<ReturnType<typeof getUsers>>,
|
|
220
|
+
TError = ErrorType<void | DmError>,
|
|
221
|
+
>(
|
|
222
|
+
options?: {
|
|
223
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUsers>>, TError, TData>>;
|
|
224
|
+
request?: SecondParameter<typeof customInstance>;
|
|
225
|
+
},
|
|
226
|
+
queryClient?: QueryClient,
|
|
227
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
228
|
+
const queryOptions = useGetUsersSuspenseQueryOptions(options);
|
|
229
|
+
|
|
230
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
231
|
+
TData,
|
|
232
|
+
TError
|
|
233
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
234
|
+
|
|
235
|
+
query.queryKey = queryOptions.queryKey;
|
|
185
236
|
|
|
186
237
|
return query;
|
|
187
238
|
}
|
|
188
239
|
|
|
189
|
-
|
|
190
|
-
|
|
191
240
|
/**
|
|
192
241
|
* @summary Get information about your account
|
|
193
242
|
*/
|
|
194
243
|
export const getUserAccount = (
|
|
195
|
-
|
|
196
|
-
|
|
244
|
+
params?: GetUserAccountParams,
|
|
245
|
+
options?: SecondParameter<typeof customInstance>,
|
|
246
|
+
signal?: AbortSignal,
|
|
197
247
|
) => {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
export const
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
248
|
+
return customInstance<UserAccountDetail>(
|
|
249
|
+
{ url: `/user/account`, method: "GET", params, signal },
|
|
250
|
+
options,
|
|
251
|
+
);
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
export const getGetUserAccountQueryKey = (params?: GetUserAccountParams) => {
|
|
255
|
+
return [`/user/account`, ...(params ? [params] : [])] as const;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export const useGetUserAccountQueryOptions = <
|
|
259
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
260
|
+
TError = ErrorType<void | DmError>,
|
|
261
|
+
>(
|
|
262
|
+
params?: GetUserAccountParams,
|
|
263
|
+
options?: {
|
|
264
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
|
|
265
|
+
request?: SecondParameter<typeof customInstance>;
|
|
266
|
+
},
|
|
214
267
|
) => {
|
|
268
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
215
269
|
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);
|
|
270
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);
|
|
219
271
|
|
|
220
|
-
|
|
272
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) =>
|
|
273
|
+
getUserAccount(params, requestOptions, signal);
|
|
221
274
|
|
|
222
|
-
|
|
275
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
223
276
|
|
|
224
|
-
|
|
277
|
+
return customOptions as UseQueryOptions<
|
|
278
|
+
Awaited<ReturnType<typeof getUserAccount>>,
|
|
279
|
+
TError,
|
|
280
|
+
TData
|
|
281
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
282
|
+
};
|
|
225
283
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
229
|
-
}
|
|
284
|
+
export type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
|
|
285
|
+
export type GetUserAccountQueryError = ErrorType<void | DmError>;
|
|
230
286
|
|
|
231
|
-
export
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
287
|
+
export function useGetUserAccount<
|
|
288
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
289
|
+
TError = ErrorType<void | DmError>,
|
|
290
|
+
>(
|
|
291
|
+
params: undefined | GetUserAccountParams,
|
|
292
|
+
options: {
|
|
293
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
|
|
294
|
+
Pick<
|
|
237
295
|
DefinedInitialDataOptions<
|
|
238
296
|
Awaited<ReturnType<typeof getUserAccount>>,
|
|
239
297
|
TError,
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
298
|
+
Awaited<ReturnType<typeof getUserAccount>>
|
|
299
|
+
>,
|
|
300
|
+
"initialData"
|
|
301
|
+
>;
|
|
302
|
+
request?: SecondParameter<typeof customInstance>;
|
|
303
|
+
},
|
|
304
|
+
queryClient?: QueryClient,
|
|
305
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
306
|
+
export function useGetUserAccount<
|
|
307
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
308
|
+
TError = ErrorType<void | DmError>,
|
|
309
|
+
>(
|
|
310
|
+
params?: GetUserAccountParams,
|
|
311
|
+
options?: {
|
|
312
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
|
|
313
|
+
Pick<
|
|
247
314
|
UndefinedInitialDataOptions<
|
|
248
315
|
Awaited<ReturnType<typeof getUserAccount>>,
|
|
249
316
|
TError,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
317
|
+
Awaited<ReturnType<typeof getUserAccount>>
|
|
318
|
+
>,
|
|
319
|
+
"initialData"
|
|
320
|
+
>;
|
|
321
|
+
request?: SecondParameter<typeof customInstance>;
|
|
322
|
+
},
|
|
323
|
+
queryClient?: QueryClient,
|
|
324
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
325
|
+
export function useGetUserAccount<
|
|
326
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
327
|
+
TError = ErrorType<void | DmError>,
|
|
328
|
+
>(
|
|
329
|
+
params?: GetUserAccountParams,
|
|
330
|
+
options?: {
|
|
331
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
|
|
332
|
+
request?: SecondParameter<typeof customInstance>;
|
|
333
|
+
},
|
|
334
|
+
queryClient?: QueryClient,
|
|
335
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
259
336
|
/**
|
|
260
337
|
* @summary Get information about your account
|
|
261
338
|
*/
|
|
262
339
|
|
|
263
|
-
export function useGetUserAccount<
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
340
|
+
export function useGetUserAccount<
|
|
341
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
342
|
+
TError = ErrorType<void | DmError>,
|
|
343
|
+
>(
|
|
344
|
+
params?: GetUserAccountParams,
|
|
345
|
+
options?: {
|
|
346
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
|
|
347
|
+
request?: SecondParameter<typeof customInstance>;
|
|
348
|
+
},
|
|
349
|
+
queryClient?: QueryClient,
|
|
350
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
351
|
+
const queryOptions = useGetUserAccountQueryOptions(params, options);
|
|
352
|
+
|
|
353
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
354
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
query.queryKey = queryOptions.queryKey;
|
|
273
358
|
|
|
274
359
|
return query;
|
|
275
360
|
}
|
|
276
361
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
362
|
+
export const useGetUserAccountSuspenseQueryOptions = <
|
|
363
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
364
|
+
TError = ErrorType<void | DmError>,
|
|
365
|
+
>(
|
|
366
|
+
params?: GetUserAccountParams,
|
|
367
|
+
options?: {
|
|
368
|
+
query?: Partial<
|
|
369
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
370
|
+
>;
|
|
371
|
+
request?: SecondParameter<typeof customInstance>;
|
|
372
|
+
},
|
|
280
373
|
) => {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
export type GetUserAccountSuspenseQueryResult = NonNullable<
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
374
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
375
|
+
|
|
376
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey(params);
|
|
377
|
+
|
|
378
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) =>
|
|
379
|
+
getUserAccount(params, requestOptions, signal);
|
|
380
|
+
|
|
381
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
382
|
+
|
|
383
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
384
|
+
Awaited<ReturnType<typeof getUserAccount>>,
|
|
385
|
+
TError,
|
|
386
|
+
TData
|
|
387
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
export type GetUserAccountSuspenseQueryResult = NonNullable<
|
|
391
|
+
Awaited<ReturnType<typeof getUserAccount>>
|
|
392
|
+
>;
|
|
393
|
+
export type GetUserAccountSuspenseQueryError = ErrorType<void | DmError>;
|
|
394
|
+
|
|
395
|
+
export function useGetUserAccountSuspense<
|
|
396
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
397
|
+
TError = ErrorType<void | DmError>,
|
|
398
|
+
>(
|
|
399
|
+
params: undefined | GetUserAccountParams,
|
|
400
|
+
options: {
|
|
401
|
+
query: Partial<
|
|
402
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
403
|
+
>;
|
|
404
|
+
request?: SecondParameter<typeof customInstance>;
|
|
405
|
+
},
|
|
406
|
+
queryClient?: QueryClient,
|
|
407
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
408
|
+
export function useGetUserAccountSuspense<
|
|
409
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
410
|
+
TError = ErrorType<void | DmError>,
|
|
411
|
+
>(
|
|
412
|
+
params?: GetUserAccountParams,
|
|
413
|
+
options?: {
|
|
414
|
+
query?: Partial<
|
|
415
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
416
|
+
>;
|
|
417
|
+
request?: SecondParameter<typeof customInstance>;
|
|
418
|
+
},
|
|
419
|
+
queryClient?: QueryClient,
|
|
420
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
421
|
+
export function useGetUserAccountSuspense<
|
|
422
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
423
|
+
TError = ErrorType<void | DmError>,
|
|
424
|
+
>(
|
|
425
|
+
params?: GetUserAccountParams,
|
|
426
|
+
options?: {
|
|
427
|
+
query?: Partial<
|
|
428
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
429
|
+
>;
|
|
430
|
+
request?: SecondParameter<typeof customInstance>;
|
|
431
|
+
},
|
|
432
|
+
queryClient?: QueryClient,
|
|
433
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
313
434
|
/**
|
|
314
435
|
* @summary Get information about your account
|
|
315
436
|
*/
|
|
316
437
|
|
|
317
|
-
export function useGetUserAccountSuspense<
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
438
|
+
export function useGetUserAccountSuspense<
|
|
439
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
440
|
+
TError = ErrorType<void | DmError>,
|
|
441
|
+
>(
|
|
442
|
+
params?: GetUserAccountParams,
|
|
443
|
+
options?: {
|
|
444
|
+
query?: Partial<
|
|
445
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
446
|
+
>;
|
|
447
|
+
request?: SecondParameter<typeof customInstance>;
|
|
448
|
+
},
|
|
449
|
+
queryClient?: QueryClient,
|
|
450
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
451
|
+
const queryOptions = useGetUserAccountSuspenseQueryOptions(params, options);
|
|
452
|
+
|
|
453
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
454
|
+
TData,
|
|
455
|
+
TError
|
|
456
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
457
|
+
|
|
458
|
+
query.queryKey = queryOptions.queryKey;
|
|
327
459
|
|
|
328
460
|
return query;
|
|
329
461
|
}
|
|
330
462
|
|
|
331
|
-
|
|
332
|
-
|
|
333
463
|
/**
|
|
334
464
|
* @summary Patch your account
|
|
335
465
|
*/
|
|
336
466
|
export const patchUserAccount = (
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const formUrlEncoded = new URLSearchParams();
|
|
341
|
-
if(userAccountPatchBodyBody?.private !== undefined) {
|
|
342
|
-
formUrlEncoded.append('private', userAccountPatchBodyBody.private.toString())
|
|
343
|
-
}
|
|
344
|
-
if(userAccountPatchBodyBody?.become_admin !== undefined) {
|
|
345
|
-
formUrlEncoded.append('become_admin', userAccountPatchBodyBody.become_admin.toString())
|
|
346
|
-
}
|
|
347
|
-
if(userAccountPatchBodyBody?.impersonate !== undefined) {
|
|
348
|
-
formUrlEncoded.append('impersonate', userAccountPatchBodyBody.impersonate)
|
|
349
|
-
}
|
|
350
|
-
if(userAccountPatchBodyBody?.use_impersonation !== undefined) {
|
|
351
|
-
formUrlEncoded.append('use_impersonation', userAccountPatchBodyBody.use_impersonation.toString())
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
return customInstance<void>(
|
|
355
|
-
{url: `/user/account`, method: 'PATCH',
|
|
356
|
-
headers: {'Content-Type': 'application/x-www-form-urlencoded', },
|
|
357
|
-
data: formUrlEncoded
|
|
358
|
-
},
|
|
359
|
-
options);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
export const getPatchUserAccountMutationOptions = <TData = Awaited<ReturnType<typeof patchUserAccount>>, TError = ErrorType<void | DmError>,
|
|
365
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: UserAccountPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
467
|
+
userAccountPatchBodyBody?: UserAccountPatchBodyBody,
|
|
468
|
+
options?: SecondParameter<typeof customInstance>,
|
|
366
469
|
) => {
|
|
367
|
-
const
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
470
|
+
const formUrlEncoded = new URLSearchParams();
|
|
471
|
+
if (userAccountPatchBodyBody?.private !== undefined) {
|
|
472
|
+
formUrlEncoded.append(`private`, userAccountPatchBodyBody.private.toString());
|
|
473
|
+
}
|
|
474
|
+
if (userAccountPatchBodyBody?.become_admin !== undefined) {
|
|
475
|
+
formUrlEncoded.append(`become_admin`, userAccountPatchBodyBody.become_admin.toString());
|
|
476
|
+
}
|
|
477
|
+
if (userAccountPatchBodyBody?.impersonate !== undefined) {
|
|
478
|
+
formUrlEncoded.append(`impersonate`, userAccountPatchBodyBody.impersonate);
|
|
479
|
+
}
|
|
480
|
+
if (userAccountPatchBodyBody?.use_impersonation !== undefined) {
|
|
481
|
+
formUrlEncoded.append(
|
|
482
|
+
`use_impersonation`,
|
|
483
|
+
userAccountPatchBodyBody.use_impersonation.toString(),
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return customInstance<void>(
|
|
488
|
+
{
|
|
489
|
+
url: `/user/account`,
|
|
490
|
+
method: "PATCH",
|
|
491
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
492
|
+
data: formUrlEncoded,
|
|
493
|
+
},
|
|
494
|
+
options,
|
|
495
|
+
);
|
|
496
|
+
};
|
|
497
|
+
|
|
498
|
+
export const usePatchUserAccountMutationOptions = <
|
|
499
|
+
TError = ErrorType<void | DmError>,
|
|
500
|
+
TContext = unknown,
|
|
501
|
+
>(options?: {
|
|
502
|
+
mutation?: UseMutationOptions<
|
|
503
|
+
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
504
|
+
TError,
|
|
505
|
+
{ data: UserAccountPatchBodyBody },
|
|
506
|
+
TContext
|
|
507
|
+
>;
|
|
508
|
+
request?: SecondParameter<typeof customInstance>;
|
|
509
|
+
}): UseMutationOptions<
|
|
510
|
+
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
511
|
+
TError,
|
|
512
|
+
{ data: UserAccountPatchBodyBody },
|
|
513
|
+
TContext
|
|
514
|
+
> => {
|
|
515
|
+
const mutationKey = ["patchUserAccount"];
|
|
516
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
517
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
518
|
+
? options
|
|
519
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
520
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
521
|
+
|
|
522
|
+
const mutationFn: MutationFunction<
|
|
523
|
+
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
524
|
+
{ data: UserAccountPatchBodyBody }
|
|
525
|
+
> = (props) => {
|
|
526
|
+
const { data } = props ?? {};
|
|
527
|
+
|
|
528
|
+
return patchUserAccount(data, requestOptions);
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
532
|
+
|
|
533
|
+
return customOptions;
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
export type PatchUserAccountMutationResult = NonNullable<
|
|
537
|
+
Awaited<ReturnType<typeof patchUserAccount>>
|
|
538
|
+
>;
|
|
539
|
+
export type PatchUserAccountMutationBody = UserAccountPatchBodyBody;
|
|
540
|
+
export type PatchUserAccountMutationError = ErrorType<void | DmError>;
|
|
391
541
|
|
|
392
|
-
|
|
542
|
+
/**
|
|
393
543
|
* @summary Patch your account
|
|
394
544
|
*/
|
|
395
|
-
export const usePatchUserAccount = <
|
|
396
|
-
|
|
545
|
+
export const usePatchUserAccount = <TError = ErrorType<void | DmError>, TContext = unknown>(
|
|
546
|
+
options?: {
|
|
547
|
+
mutation?: UseMutationOptions<
|
|
548
|
+
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
549
|
+
TError,
|
|
550
|
+
{ data: UserAccountPatchBodyBody },
|
|
551
|
+
TContext
|
|
552
|
+
>;
|
|
553
|
+
request?: SecondParameter<typeof customInstance>;
|
|
554
|
+
},
|
|
555
|
+
queryClient?: QueryClient,
|
|
397
556
|
): UseMutationResult<
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
/**
|
|
557
|
+
Awaited<ReturnType<typeof patchUserAccount>>,
|
|
558
|
+
TError,
|
|
559
|
+
{ data: UserAccountPatchBodyBody },
|
|
560
|
+
TContext
|
|
561
|
+
> => {
|
|
562
|
+
const mutationOptions = usePatchUserAccountMutationOptions(options);
|
|
563
|
+
|
|
564
|
+
return useMutation(mutationOptions, queryClient);
|
|
565
|
+
};
|
|
566
|
+
/**
|
|
409
567
|
* Returns a summary of your API activity optionally filtered by date. The API log does not include the use of GET methods, and only contains records of potential state-changing calls made against the Data Manager using your account
|
|
410
568
|
|
|
411
569
|
* @summary Get the API call log recorded against your account
|
|
412
570
|
*/
|
|
413
571
|
export const getUserApiLog = (
|
|
414
|
-
|
|
415
|
-
|
|
572
|
+
params?: GetUserApiLogParams,
|
|
573
|
+
options?: SecondParameter<typeof customInstance>,
|
|
574
|
+
signal?: AbortSignal,
|
|
416
575
|
) => {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
export const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
576
|
+
return customInstance<UserApiLogGetResponse>(
|
|
577
|
+
{ url: `/user/api-log`, method: "GET", params, signal },
|
|
578
|
+
options,
|
|
579
|
+
);
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
export const getGetUserApiLogQueryKey = (params?: GetUserApiLogParams) => {
|
|
583
|
+
return [`/user/api-log`, ...(params ? [params] : [])] as const;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
export const useGetUserApiLogQueryOptions = <
|
|
587
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
588
|
+
TError = ErrorType<void>,
|
|
589
|
+
>(
|
|
590
|
+
params?: GetUserApiLogParams,
|
|
591
|
+
options?: {
|
|
592
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>>;
|
|
593
|
+
request?: SecondParameter<typeof customInstance>;
|
|
594
|
+
},
|
|
433
595
|
) => {
|
|
596
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
434
597
|
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);
|
|
438
|
-
|
|
439
|
-
|
|
598
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);
|
|
440
599
|
|
|
441
|
-
|
|
600
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({ signal }) =>
|
|
601
|
+
getUserApiLog(params, requestOptions, signal);
|
|
442
602
|
|
|
443
|
-
|
|
603
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
444
604
|
|
|
445
|
-
|
|
605
|
+
return customOptions as UseQueryOptions<
|
|
606
|
+
Awaited<ReturnType<typeof getUserApiLog>>,
|
|
607
|
+
TError,
|
|
608
|
+
TData
|
|
609
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
610
|
+
};
|
|
446
611
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
export type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>
|
|
451
|
-
export type GetUserApiLogQueryError = ErrorType<void>
|
|
612
|
+
export type GetUserApiLogQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiLog>>>;
|
|
613
|
+
export type GetUserApiLogQueryError = ErrorType<void>;
|
|
452
614
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
615
|
+
export function useGetUserApiLog<
|
|
616
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
617
|
+
TError = ErrorType<void>,
|
|
618
|
+
>(
|
|
619
|
+
params: undefined | GetUserApiLogParams,
|
|
620
|
+
options: {
|
|
621
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>> &
|
|
622
|
+
Pick<
|
|
456
623
|
DefinedInitialDataOptions<
|
|
457
624
|
Awaited<ReturnType<typeof getUserApiLog>>,
|
|
458
625
|
TError,
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
626
|
+
Awaited<ReturnType<typeof getUserApiLog>>
|
|
627
|
+
>,
|
|
628
|
+
"initialData"
|
|
629
|
+
>;
|
|
630
|
+
request?: SecondParameter<typeof customInstance>;
|
|
631
|
+
},
|
|
632
|
+
queryClient?: QueryClient,
|
|
633
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
634
|
+
export function useGetUserApiLog<
|
|
635
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
636
|
+
TError = ErrorType<void>,
|
|
637
|
+
>(
|
|
638
|
+
params?: GetUserApiLogParams,
|
|
639
|
+
options?: {
|
|
640
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>> &
|
|
641
|
+
Pick<
|
|
466
642
|
UndefinedInitialDataOptions<
|
|
467
643
|
Awaited<ReturnType<typeof getUserApiLog>>,
|
|
468
644
|
TError,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
645
|
+
Awaited<ReturnType<typeof getUserApiLog>>
|
|
646
|
+
>,
|
|
647
|
+
"initialData"
|
|
648
|
+
>;
|
|
649
|
+
request?: SecondParameter<typeof customInstance>;
|
|
650
|
+
},
|
|
651
|
+
queryClient?: QueryClient,
|
|
652
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
653
|
+
export function useGetUserApiLog<
|
|
654
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
655
|
+
TError = ErrorType<void>,
|
|
656
|
+
>(
|
|
657
|
+
params?: GetUserApiLogParams,
|
|
658
|
+
options?: {
|
|
659
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>>;
|
|
660
|
+
request?: SecondParameter<typeof customInstance>;
|
|
661
|
+
},
|
|
662
|
+
queryClient?: QueryClient,
|
|
663
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
478
664
|
/**
|
|
479
665
|
* @summary Get the API call log recorded against your account
|
|
480
666
|
*/
|
|
481
667
|
|
|
482
|
-
export function useGetUserApiLog<
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
668
|
+
export function useGetUserApiLog<
|
|
669
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
670
|
+
TError = ErrorType<void>,
|
|
671
|
+
>(
|
|
672
|
+
params?: GetUserApiLogParams,
|
|
673
|
+
options?: {
|
|
674
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>>;
|
|
675
|
+
request?: SecondParameter<typeof customInstance>;
|
|
676
|
+
},
|
|
677
|
+
queryClient?: QueryClient,
|
|
678
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
679
|
+
const queryOptions = useGetUserApiLogQueryOptions(params, options);
|
|
680
|
+
|
|
681
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
682
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
query.queryKey = queryOptions.queryKey;
|
|
492
686
|
|
|
493
687
|
return query;
|
|
494
688
|
}
|
|
495
689
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
690
|
+
export const useGetUserApiLogSuspenseQueryOptions = <
|
|
691
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
692
|
+
TError = ErrorType<void>,
|
|
693
|
+
>(
|
|
694
|
+
params?: GetUserApiLogParams,
|
|
695
|
+
options?: {
|
|
696
|
+
query?: Partial<
|
|
697
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>
|
|
698
|
+
>;
|
|
699
|
+
request?: SecondParameter<typeof customInstance>;
|
|
700
|
+
},
|
|
499
701
|
) => {
|
|
702
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
703
|
+
|
|
704
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserApiLogQueryKey(params);
|
|
705
|
+
|
|
706
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiLog>>> = ({ signal }) =>
|
|
707
|
+
getUserApiLog(params, requestOptions, signal);
|
|
708
|
+
|
|
709
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
710
|
+
|
|
711
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
712
|
+
Awaited<ReturnType<typeof getUserApiLog>>,
|
|
713
|
+
TError,
|
|
714
|
+
TData
|
|
715
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
export type GetUserApiLogSuspenseQueryResult = NonNullable<
|
|
719
|
+
Awaited<ReturnType<typeof getUserApiLog>>
|
|
720
|
+
>;
|
|
721
|
+
export type GetUserApiLogSuspenseQueryError = ErrorType<void>;
|
|
722
|
+
|
|
723
|
+
export function useGetUserApiLogSuspense<
|
|
724
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
725
|
+
TError = ErrorType<void>,
|
|
726
|
+
>(
|
|
727
|
+
params: undefined | GetUserApiLogParams,
|
|
728
|
+
options: {
|
|
729
|
+
query: Partial<
|
|
730
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>
|
|
731
|
+
>;
|
|
732
|
+
request?: SecondParameter<typeof customInstance>;
|
|
733
|
+
},
|
|
734
|
+
queryClient?: QueryClient,
|
|
735
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
736
|
+
export function useGetUserApiLogSuspense<
|
|
737
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
738
|
+
TError = ErrorType<void>,
|
|
739
|
+
>(
|
|
740
|
+
params?: GetUserApiLogParams,
|
|
741
|
+
options?: {
|
|
742
|
+
query?: Partial<
|
|
743
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>
|
|
744
|
+
>;
|
|
745
|
+
request?: SecondParameter<typeof customInstance>;
|
|
746
|
+
},
|
|
747
|
+
queryClient?: QueryClient,
|
|
748
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
749
|
+
export function useGetUserApiLogSuspense<
|
|
750
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
751
|
+
TError = ErrorType<void>,
|
|
752
|
+
>(
|
|
753
|
+
params?: GetUserApiLogParams,
|
|
754
|
+
options?: {
|
|
755
|
+
query?: Partial<
|
|
756
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>
|
|
757
|
+
>;
|
|
758
|
+
request?: SecondParameter<typeof customInstance>;
|
|
759
|
+
},
|
|
760
|
+
queryClient?: QueryClient,
|
|
761
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
762
|
+
/**
|
|
763
|
+
* @summary Get the API call log recorded against your account
|
|
764
|
+
*/
|
|
500
765
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
766
|
+
export function useGetUserApiLogSuspense<
|
|
767
|
+
TData = Awaited<ReturnType<typeof getUserApiLog>>,
|
|
768
|
+
TError = ErrorType<void>,
|
|
769
|
+
>(
|
|
770
|
+
params?: GetUserApiLogParams,
|
|
771
|
+
options?: {
|
|
772
|
+
query?: Partial<
|
|
773
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>
|
|
774
|
+
>;
|
|
775
|
+
request?: SecondParameter<typeof customInstance>;
|
|
776
|
+
},
|
|
777
|
+
queryClient?: QueryClient,
|
|
778
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
779
|
+
const queryOptions = useGetUserApiLogSuspenseQueryOptions(params, options);
|
|
780
|
+
|
|
781
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
782
|
+
TData,
|
|
783
|
+
TError
|
|
784
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
785
|
+
|
|
786
|
+
query.queryKey = queryOptions.queryKey;
|
|
512
787
|
|
|
513
|
-
|
|
788
|
+
return query;
|
|
514
789
|
}
|
|
515
790
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
export function useGetUserApiLogSuspense<TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(
|
|
521
|
-
params: undefined | GetUserApiLogParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
522
|
-
|
|
523
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
524
|
-
export function useGetUserApiLogSuspense<TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(
|
|
525
|
-
params?: GetUserApiLogParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
526
|
-
|
|
527
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
528
|
-
export function useGetUserApiLogSuspense<TData = Awaited<ReturnType<typeof getUserApiLog>>, TError = ErrorType<void>>(
|
|
529
|
-
params?: GetUserApiLogParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiLog>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
791
|
+
/**
|
|
792
|
+
* Returns the API token assigned to your login
|
|
530
793
|
|
|
531
|
-
|
|
794
|
+
* @summary Get your API token
|
|
795
|
+
*/
|
|
796
|
+
export const getUserApiToken = (
|
|
797
|
+
options?: SecondParameter<typeof customInstance>,
|
|
798
|
+
signal?: AbortSignal,
|
|
799
|
+
) => {
|
|
800
|
+
return customInstance<UserApiTokenGetResponse>(
|
|
801
|
+
{ url: `/user/token`, method: "GET", signal },
|
|
802
|
+
options,
|
|
803
|
+
);
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
export const getGetUserApiTokenQueryKey = () => {
|
|
807
|
+
return [`/user/token`] as const;
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
export const useGetUserApiTokenQueryOptions = <
|
|
811
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
812
|
+
TError = ErrorType<void>,
|
|
813
|
+
>(options?: {
|
|
814
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>>;
|
|
815
|
+
request?: SecondParameter<typeof customInstance>;
|
|
816
|
+
}) => {
|
|
817
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
818
|
+
|
|
819
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserApiTokenQueryKey();
|
|
820
|
+
|
|
821
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiToken>>> = ({ signal }) =>
|
|
822
|
+
getUserApiToken(requestOptions, signal);
|
|
823
|
+
|
|
824
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
825
|
+
|
|
826
|
+
return customOptions as UseQueryOptions<
|
|
827
|
+
Awaited<ReturnType<typeof getUserApiToken>>,
|
|
828
|
+
TError,
|
|
829
|
+
TData
|
|
830
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
831
|
+
};
|
|
832
|
+
|
|
833
|
+
export type GetUserApiTokenQueryResult = NonNullable<Awaited<ReturnType<typeof getUserApiToken>>>;
|
|
834
|
+
export type GetUserApiTokenQueryError = ErrorType<void>;
|
|
835
|
+
|
|
836
|
+
export function useGetUserApiToken<
|
|
837
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
838
|
+
TError = ErrorType<void>,
|
|
839
|
+
>(
|
|
840
|
+
options: {
|
|
841
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>> &
|
|
842
|
+
Pick<
|
|
843
|
+
DefinedInitialDataOptions<
|
|
844
|
+
Awaited<ReturnType<typeof getUserApiToken>>,
|
|
845
|
+
TError,
|
|
846
|
+
Awaited<ReturnType<typeof getUserApiToken>>
|
|
847
|
+
>,
|
|
848
|
+
"initialData"
|
|
849
|
+
>;
|
|
850
|
+
request?: SecondParameter<typeof customInstance>;
|
|
851
|
+
},
|
|
852
|
+
queryClient?: QueryClient,
|
|
853
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
854
|
+
export function useGetUserApiToken<
|
|
855
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
856
|
+
TError = ErrorType<void>,
|
|
857
|
+
>(
|
|
858
|
+
options?: {
|
|
859
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>> &
|
|
860
|
+
Pick<
|
|
861
|
+
UndefinedInitialDataOptions<
|
|
862
|
+
Awaited<ReturnType<typeof getUserApiToken>>,
|
|
863
|
+
TError,
|
|
864
|
+
Awaited<ReturnType<typeof getUserApiToken>>
|
|
865
|
+
>,
|
|
866
|
+
"initialData"
|
|
867
|
+
>;
|
|
868
|
+
request?: SecondParameter<typeof customInstance>;
|
|
869
|
+
},
|
|
870
|
+
queryClient?: QueryClient,
|
|
871
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
872
|
+
export function useGetUserApiToken<
|
|
873
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
874
|
+
TError = ErrorType<void>,
|
|
875
|
+
>(
|
|
876
|
+
options?: {
|
|
877
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>>;
|
|
878
|
+
request?: SecondParameter<typeof customInstance>;
|
|
879
|
+
},
|
|
880
|
+
queryClient?: QueryClient,
|
|
881
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
532
882
|
/**
|
|
533
|
-
* @summary Get
|
|
883
|
+
* @summary Get your API token
|
|
534
884
|
*/
|
|
535
885
|
|
|
536
|
-
export function
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
886
|
+
export function useGetUserApiToken<
|
|
887
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
888
|
+
TError = ErrorType<void>,
|
|
889
|
+
>(
|
|
890
|
+
options?: {
|
|
891
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>>;
|
|
892
|
+
request?: SecondParameter<typeof customInstance>;
|
|
893
|
+
},
|
|
894
|
+
queryClient?: QueryClient,
|
|
895
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
896
|
+
const queryOptions = useGetUserApiTokenQueryOptions(options);
|
|
542
897
|
|
|
543
|
-
const query =
|
|
898
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
899
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
900
|
+
};
|
|
544
901
|
|
|
545
|
-
query.queryKey = queryOptions.queryKey
|
|
902
|
+
query.queryKey = queryOptions.queryKey;
|
|
546
903
|
|
|
547
904
|
return query;
|
|
548
905
|
}
|
|
549
906
|
|
|
907
|
+
export const useGetUserApiTokenSuspenseQueryOptions = <
|
|
908
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
909
|
+
TError = ErrorType<void>,
|
|
910
|
+
>(options?: {
|
|
911
|
+
query?: Partial<
|
|
912
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>
|
|
913
|
+
>;
|
|
914
|
+
request?: SecondParameter<typeof customInstance>;
|
|
915
|
+
}) => {
|
|
916
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
917
|
+
|
|
918
|
+
const queryKey = queryOptions?.queryKey ?? getGetUserApiTokenQueryKey();
|
|
919
|
+
|
|
920
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserApiToken>>> = ({ signal }) =>
|
|
921
|
+
getUserApiToken(requestOptions, signal);
|
|
922
|
+
|
|
923
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
924
|
+
|
|
925
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
926
|
+
Awaited<ReturnType<typeof getUserApiToken>>,
|
|
927
|
+
TError,
|
|
928
|
+
TData
|
|
929
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
export type GetUserApiTokenSuspenseQueryResult = NonNullable<
|
|
933
|
+
Awaited<ReturnType<typeof getUserApiToken>>
|
|
934
|
+
>;
|
|
935
|
+
export type GetUserApiTokenSuspenseQueryError = ErrorType<void>;
|
|
936
|
+
|
|
937
|
+
export function useGetUserApiTokenSuspense<
|
|
938
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
939
|
+
TError = ErrorType<void>,
|
|
940
|
+
>(
|
|
941
|
+
options: {
|
|
942
|
+
query: Partial<
|
|
943
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>
|
|
944
|
+
>;
|
|
945
|
+
request?: SecondParameter<typeof customInstance>;
|
|
946
|
+
},
|
|
947
|
+
queryClient?: QueryClient,
|
|
948
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
949
|
+
export function useGetUserApiTokenSuspense<
|
|
950
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
951
|
+
TError = ErrorType<void>,
|
|
952
|
+
>(
|
|
953
|
+
options?: {
|
|
954
|
+
query?: Partial<
|
|
955
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>
|
|
956
|
+
>;
|
|
957
|
+
request?: SecondParameter<typeof customInstance>;
|
|
958
|
+
},
|
|
959
|
+
queryClient?: QueryClient,
|
|
960
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
961
|
+
export function useGetUserApiTokenSuspense<
|
|
962
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
963
|
+
TError = ErrorType<void>,
|
|
964
|
+
>(
|
|
965
|
+
options?: {
|
|
966
|
+
query?: Partial<
|
|
967
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>
|
|
968
|
+
>;
|
|
969
|
+
request?: SecondParameter<typeof customInstance>;
|
|
970
|
+
},
|
|
971
|
+
queryClient?: QueryClient,
|
|
972
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
973
|
+
/**
|
|
974
|
+
* @summary Get your API token
|
|
975
|
+
*/
|
|
550
976
|
|
|
977
|
+
export function useGetUserApiTokenSuspense<
|
|
978
|
+
TData = Awaited<ReturnType<typeof getUserApiToken>>,
|
|
979
|
+
TError = ErrorType<void>,
|
|
980
|
+
>(
|
|
981
|
+
options?: {
|
|
982
|
+
query?: Partial<
|
|
983
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserApiToken>>, TError, TData>
|
|
984
|
+
>;
|
|
985
|
+
request?: SecondParameter<typeof customInstance>;
|
|
986
|
+
},
|
|
987
|
+
queryClient?: QueryClient,
|
|
988
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
989
|
+
const queryOptions = useGetUserApiTokenSuspenseQueryOptions(options);
|
|
990
|
+
|
|
991
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
992
|
+
TData,
|
|
993
|
+
TError
|
|
994
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
995
|
+
|
|
996
|
+
query.queryKey = queryOptions.queryKey;
|
|
551
997
|
|
|
998
|
+
return query;
|
|
999
|
+
}
|