@squonk/account-server-client 4.4.0-4-4.2197467763 → 4.4.0-4-4.2200269934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/actions/actions.cjs +4 -4
- package/dist/api/actions/actions.cjs.map +1 -1
- package/dist/api/actions/actions.d.cts +35 -17
- package/dist/api/actions/actions.d.cts.map +1 -1
- package/dist/api/actions/actions.d.ts +35 -17
- package/dist/api/actions/actions.d.ts.map +1 -1
- package/dist/api/actions/actions.fetch.cjs +4 -4
- package/dist/api/actions/actions.fetch.cjs.map +1 -1
- package/dist/api/actions/actions.fetch.d.cts +35 -17
- package/dist/api/actions/actions.fetch.d.cts.map +1 -1
- package/dist/api/actions/actions.fetch.d.ts +35 -17
- package/dist/api/actions/actions.fetch.d.ts.map +1 -1
- package/dist/api/actions/actions.fetch.js +4 -4
- package/dist/api/actions/actions.fetch.js.map +1 -1
- package/dist/api/actions/actions.js +4 -4
- package/dist/api/actions/actions.js.map +1 -1
- package/dist/api/asset/asset.cjs +22 -22
- package/dist/api/asset/asset.cjs.map +1 -1
- package/dist/api/asset/asset.d.cts +76 -40
- package/dist/api/asset/asset.d.cts.map +1 -1
- package/dist/api/asset/asset.d.ts +76 -40
- package/dist/api/asset/asset.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.cjs +22 -22
- package/dist/api/asset/asset.fetch.cjs.map +1 -1
- package/dist/api/asset/asset.fetch.d.cts +76 -40
- package/dist/api/asset/asset.fetch.d.cts.map +1 -1
- package/dist/api/asset/asset.fetch.d.ts +76 -40
- package/dist/api/asset/asset.fetch.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.js +22 -22
- package/dist/api/asset/asset.fetch.js.map +1 -1
- package/dist/api/asset/asset.js +22 -22
- package/dist/api/asset/asset.js.map +1 -1
- package/dist/api/charges/charges.cjs +16 -16
- package/dist/api/charges/charges.cjs.map +1 -1
- package/dist/api/charges/charges.d.cts +137 -65
- package/dist/api/charges/charges.d.cts.map +1 -1
- package/dist/api/charges/charges.d.ts +137 -65
- package/dist/api/charges/charges.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.cjs +16 -16
- package/dist/api/charges/charges.fetch.cjs.map +1 -1
- package/dist/api/charges/charges.fetch.d.cts +137 -65
- package/dist/api/charges/charges.fetch.d.cts.map +1 -1
- package/dist/api/charges/charges.fetch.d.ts +137 -65
- package/dist/api/charges/charges.fetch.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.js +16 -16
- package/dist/api/charges/charges.fetch.js.map +1 -1
- package/dist/api/charges/charges.js +16 -16
- package/dist/api/charges/charges.js.map +1 -1
- package/dist/api/event-stream/event-stream.cjs +12 -12
- package/dist/api/event-stream/event-stream.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.d.cts +71 -35
- package/dist/api/event-stream/event-stream.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.d.ts +71 -35
- package/dist/api/event-stream/event-stream.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.cjs +12 -12
- package/dist/api/event-stream/event-stream.fetch.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.d.cts +71 -35
- package/dist/api/event-stream/event-stream.fetch.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.d.ts +71 -35
- package/dist/api/event-stream/event-stream.fetch.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.js +12 -12
- package/dist/api/event-stream/event-stream.fetch.js.map +1 -1
- package/dist/api/event-stream/event-stream.js +12 -12
- package/dist/api/event-stream/event-stream.js.map +1 -1
- package/dist/api/merchant/merchant.cjs +8 -8
- package/dist/api/merchant/merchant.cjs.map +1 -1
- package/dist/api/merchant/merchant.d.cts +69 -33
- package/dist/api/merchant/merchant.d.cts.map +1 -1
- package/dist/api/merchant/merchant.d.ts +69 -33
- package/dist/api/merchant/merchant.d.ts.map +1 -1
- package/dist/api/merchant/merchant.fetch.cjs +8 -8
- package/dist/api/merchant/merchant.fetch.cjs.map +1 -1
- package/dist/api/merchant/merchant.fetch.d.cts +69 -33
- package/dist/api/merchant/merchant.fetch.d.cts.map +1 -1
- package/dist/api/merchant/merchant.fetch.d.ts +69 -33
- package/dist/api/merchant/merchant.fetch.d.ts.map +1 -1
- package/dist/api/merchant/merchant.fetch.js +8 -8
- package/dist/api/merchant/merchant.fetch.js.map +1 -1
- package/dist/api/merchant/merchant.js +8 -8
- package/dist/api/merchant/merchant.js.map +1 -1
- package/dist/api/organisation/organisation.cjs +18 -18
- package/dist/api/organisation/organisation.cjs.map +1 -1
- package/dist/api/organisation/organisation.d.cts +106 -52
- package/dist/api/organisation/organisation.d.cts.map +1 -1
- package/dist/api/organisation/organisation.d.ts +106 -52
- package/dist/api/organisation/organisation.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.cjs +18 -18
- package/dist/api/organisation/organisation.fetch.cjs.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.cts +106 -52
- package/dist/api/organisation/organisation.fetch.d.cts.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.ts +106 -52
- package/dist/api/organisation/organisation.fetch.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.js +18 -18
- package/dist/api/organisation/organisation.fetch.js.map +1 -1
- package/dist/api/organisation/organisation.js +18 -18
- package/dist/api/organisation/organisation.js.map +1 -1
- package/dist/api/product/product.cjs +30 -30
- package/dist/api/product/product.cjs.map +1 -1
- package/dist/api/product/product.d.cts +208 -100
- package/dist/api/product/product.d.cts.map +1 -1
- package/dist/api/product/product.d.ts +208 -100
- package/dist/api/product/product.d.ts.map +1 -1
- package/dist/api/product/product.fetch.cjs +30 -30
- package/dist/api/product/product.fetch.cjs.map +1 -1
- package/dist/api/product/product.fetch.d.cts +208 -100
- package/dist/api/product/product.fetch.d.cts.map +1 -1
- package/dist/api/product/product.fetch.d.ts +208 -100
- package/dist/api/product/product.fetch.d.ts.map +1 -1
- package/dist/api/product/product.fetch.js +30 -30
- package/dist/api/product/product.fetch.js.map +1 -1
- package/dist/api/product/product.js +30 -30
- package/dist/api/product/product.js.map +1 -1
- package/dist/api/state/state.cjs +4 -4
- package/dist/api/state/state.cjs.map +1 -1
- package/dist/api/state/state.d.cts +35 -17
- package/dist/api/state/state.d.cts.map +1 -1
- package/dist/api/state/state.d.ts +35 -17
- package/dist/api/state/state.d.ts.map +1 -1
- package/dist/api/state/state.fetch.cjs +4 -4
- package/dist/api/state/state.fetch.cjs.map +1 -1
- package/dist/api/state/state.fetch.d.cts +35 -17
- package/dist/api/state/state.fetch.d.cts.map +1 -1
- package/dist/api/state/state.fetch.d.ts +35 -17
- package/dist/api/state/state.fetch.d.ts.map +1 -1
- package/dist/api/state/state.fetch.js +4 -4
- package/dist/api/state/state.fetch.js.map +1 -1
- package/dist/api/state/state.js +4 -4
- package/dist/api/state/state.js.map +1 -1
- package/dist/api/unit/unit.cjs +30 -30
- package/dist/api/unit/unit.cjs.map +1 -1
- package/dist/api/unit/unit.d.cts +144 -72
- package/dist/api/unit/unit.d.cts.map +1 -1
- package/dist/api/unit/unit.d.ts +144 -72
- package/dist/api/unit/unit.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.cjs +30 -30
- package/dist/api/unit/unit.fetch.cjs.map +1 -1
- package/dist/api/unit/unit.fetch.d.cts +144 -72
- package/dist/api/unit/unit.fetch.d.cts.map +1 -1
- package/dist/api/unit/unit.fetch.d.ts +144 -72
- package/dist/api/unit/unit.fetch.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.js +30 -30
- package/dist/api/unit/unit.fetch.js.map +1 -1
- package/dist/api/unit/unit.js +30 -30
- package/dist/api/unit/unit.js.map +1 -1
- package/dist/api/user/user.cjs +20 -20
- package/dist/api/user/user.cjs.map +1 -1
- package/dist/api/user/user.d.cts +107 -53
- package/dist/api/user/user.d.cts.map +1 -1
- package/dist/api/user/user.d.ts +107 -53
- package/dist/api/user/user.d.ts.map +1 -1
- package/dist/api/user/user.fetch.cjs +20 -20
- package/dist/api/user/user.fetch.cjs.map +1 -1
- package/dist/api/user/user.fetch.d.cts +107 -53
- package/dist/api/user/user.fetch.d.cts.map +1 -1
- package/dist/api/user/user.fetch.d.ts +107 -53
- package/dist/api/user/user.fetch.d.ts.map +1 -1
- package/dist/api/user/user.fetch.js +20 -20
- package/dist/api/user/user.fetch.js.map +1 -1
- package/dist/api/user/user.js +20 -20
- package/dist/api/user/user.js.map +1 -1
- package/package.json +7 -5
- package/src/api/actions/actions.fetch.ts +103 -12
- package/src/api/actions/actions.ts +103 -12
- package/src/api/asset/asset.fetch.ts +303 -94
- package/src/api/asset/asset.ts +303 -94
- package/src/api/charges/charges.fetch.ts +456 -54
- package/src/api/charges/charges.ts +456 -54
- package/src/api/event-stream/event-stream.fetch.ts +262 -58
- package/src/api/event-stream/event-stream.ts +262 -58
- package/src/api/merchant/merchant.fetch.ts +212 -28
- package/src/api/merchant/merchant.ts +212 -28
- package/src/api/organisation/organisation.fetch.ts +381 -86
- package/src/api/organisation/organisation.ts +381 -86
- package/src/api/product/product.fetch.ts +724 -130
- package/src/api/product/product.ts +724 -130
- package/src/api/state/state.fetch.ts +105 -16
- package/src/api/state/state.ts +105 -16
- package/src/api/unit/unit.fetch.ts +521 -146
- package/src/api/unit/unit.ts +521 -146
- package/src/api/user/user.fetch.ts +401 -101
- package/src/api/user/user.ts +401 -101
- package/tests/README.md +98 -0
- package/tests/component.test.tsx +191 -0
- package/tests/tsconfig.json +7 -0
- package/tests/type-tests.tsx +196 -0
|
@@ -10,11 +10,15 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
10
10
|
*/
|
|
11
11
|
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
13
|
+
DataTag,
|
|
14
|
+
DefinedInitialDataOptions,
|
|
15
|
+
DefinedUseQueryResult,
|
|
13
16
|
InvalidateOptions,
|
|
14
17
|
MutationFunction,
|
|
15
18
|
QueryClient,
|
|
16
19
|
QueryFunction,
|
|
17
20
|
QueryKey,
|
|
21
|
+
UndefinedInitialDataOptions,
|
|
18
22
|
UseMutationOptions,
|
|
19
23
|
UseMutationResult,
|
|
20
24
|
UseQueryOptions,
|
|
@@ -93,7 +97,7 @@ export const getGetAssetQueryOptions = <
|
|
|
93
97
|
>(
|
|
94
98
|
params?: GetAssetParams,
|
|
95
99
|
options?: {
|
|
96
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
100
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
97
101
|
request?: SecondParameter<typeof customFetch>;
|
|
98
102
|
},
|
|
99
103
|
) => {
|
|
@@ -108,12 +112,61 @@ export const getGetAssetQueryOptions = <
|
|
|
108
112
|
Awaited<ReturnType<typeof getAsset>>,
|
|
109
113
|
TError,
|
|
110
114
|
TData
|
|
111
|
-
> & { queryKey: QueryKey };
|
|
115
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
112
116
|
};
|
|
113
117
|
|
|
114
118
|
export type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
115
119
|
export type GetAssetQueryError = ErrorType<AsError | void>;
|
|
116
120
|
|
|
121
|
+
export function useGetAsset<
|
|
122
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
123
|
+
TError = ErrorType<AsError | void>,
|
|
124
|
+
>(
|
|
125
|
+
params: undefined | GetAssetParams,
|
|
126
|
+
options: {
|
|
127
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &
|
|
128
|
+
Pick<
|
|
129
|
+
DefinedInitialDataOptions<
|
|
130
|
+
Awaited<ReturnType<typeof getAsset>>,
|
|
131
|
+
TError,
|
|
132
|
+
Awaited<ReturnType<typeof getAsset>>
|
|
133
|
+
>,
|
|
134
|
+
"initialData"
|
|
135
|
+
>;
|
|
136
|
+
request?: SecondParameter<typeof customFetch>;
|
|
137
|
+
},
|
|
138
|
+
queryClient?: QueryClient,
|
|
139
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
140
|
+
export function useGetAsset<
|
|
141
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
142
|
+
TError = ErrorType<AsError | void>,
|
|
143
|
+
>(
|
|
144
|
+
params?: GetAssetParams,
|
|
145
|
+
options?: {
|
|
146
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &
|
|
147
|
+
Pick<
|
|
148
|
+
UndefinedInitialDataOptions<
|
|
149
|
+
Awaited<ReturnType<typeof getAsset>>,
|
|
150
|
+
TError,
|
|
151
|
+
Awaited<ReturnType<typeof getAsset>>
|
|
152
|
+
>,
|
|
153
|
+
"initialData"
|
|
154
|
+
>;
|
|
155
|
+
request?: SecondParameter<typeof customFetch>;
|
|
156
|
+
},
|
|
157
|
+
queryClient?: QueryClient,
|
|
158
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
159
|
+
export function useGetAsset<
|
|
160
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
161
|
+
TError = ErrorType<AsError | void>,
|
|
162
|
+
>(
|
|
163
|
+
params?: GetAssetParams,
|
|
164
|
+
options?: {
|
|
165
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
166
|
+
request?: SecondParameter<typeof customFetch>;
|
|
167
|
+
},
|
|
168
|
+
queryClient?: QueryClient,
|
|
169
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
117
170
|
/**
|
|
118
171
|
* @summary Gets Assets
|
|
119
172
|
*/
|
|
@@ -124,13 +177,16 @@ export function useGetAsset<
|
|
|
124
177
|
>(
|
|
125
178
|
params?: GetAssetParams,
|
|
126
179
|
options?: {
|
|
127
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
180
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
128
181
|
request?: SecondParameter<typeof customFetch>;
|
|
129
182
|
},
|
|
130
|
-
|
|
183
|
+
queryClient?: QueryClient,
|
|
184
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
131
185
|
const queryOptions = getGetAssetQueryOptions(params, options);
|
|
132
186
|
|
|
133
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
187
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
188
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
189
|
+
};
|
|
134
190
|
|
|
135
191
|
query.queryKey = queryOptions.queryKey;
|
|
136
192
|
|
|
@@ -156,7 +212,7 @@ export const getGetAssetSuspenseQueryOptions = <
|
|
|
156
212
|
>(
|
|
157
213
|
params?: GetAssetParams,
|
|
158
214
|
options?: {
|
|
159
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
215
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
160
216
|
request?: SecondParameter<typeof customFetch>;
|
|
161
217
|
},
|
|
162
218
|
) => {
|
|
@@ -171,12 +227,45 @@ export const getGetAssetSuspenseQueryOptions = <
|
|
|
171
227
|
Awaited<ReturnType<typeof getAsset>>,
|
|
172
228
|
TError,
|
|
173
229
|
TData
|
|
174
|
-
> & { queryKey: QueryKey };
|
|
230
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
175
231
|
};
|
|
176
232
|
|
|
177
233
|
export type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
178
234
|
export type GetAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
179
235
|
|
|
236
|
+
export function useGetAssetSuspense<
|
|
237
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
238
|
+
TError = ErrorType<AsError | void>,
|
|
239
|
+
>(
|
|
240
|
+
params: undefined | GetAssetParams,
|
|
241
|
+
options: {
|
|
242
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
243
|
+
request?: SecondParameter<typeof customFetch>;
|
|
244
|
+
},
|
|
245
|
+
queryClient?: QueryClient,
|
|
246
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
247
|
+
export function useGetAssetSuspense<
|
|
248
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
249
|
+
TError = ErrorType<AsError | void>,
|
|
250
|
+
>(
|
|
251
|
+
params?: GetAssetParams,
|
|
252
|
+
options?: {
|
|
253
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
254
|
+
request?: SecondParameter<typeof customFetch>;
|
|
255
|
+
},
|
|
256
|
+
queryClient?: QueryClient,
|
|
257
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
258
|
+
export function useGetAssetSuspense<
|
|
259
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
260
|
+
TError = ErrorType<AsError | void>,
|
|
261
|
+
>(
|
|
262
|
+
params?: GetAssetParams,
|
|
263
|
+
options?: {
|
|
264
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
265
|
+
request?: SecondParameter<typeof customFetch>;
|
|
266
|
+
},
|
|
267
|
+
queryClient?: QueryClient,
|
|
268
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
180
269
|
/**
|
|
181
270
|
* @summary Gets Assets
|
|
182
271
|
*/
|
|
@@ -187,15 +276,17 @@ export function useGetAssetSuspense<
|
|
|
187
276
|
>(
|
|
188
277
|
params?: GetAssetParams,
|
|
189
278
|
options?: {
|
|
190
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
279
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
191
280
|
request?: SecondParameter<typeof customFetch>;
|
|
192
281
|
},
|
|
193
|
-
|
|
282
|
+
queryClient?: QueryClient,
|
|
283
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
194
284
|
const queryOptions = getGetAssetSuspenseQueryOptions(params, options);
|
|
195
285
|
|
|
196
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
197
|
-
|
|
198
|
-
|
|
286
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
287
|
+
TData,
|
|
288
|
+
TError
|
|
289
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
199
290
|
|
|
200
291
|
query.queryKey = queryOptions.queryKey;
|
|
201
292
|
|
|
@@ -305,15 +396,18 @@ export type CreateAssetMutationError = ErrorType<AsError | void>;
|
|
|
305
396
|
/**
|
|
306
397
|
* @summary Create an Asset
|
|
307
398
|
*/
|
|
308
|
-
export const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
399
|
+
export const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
400
|
+
options?: {
|
|
401
|
+
mutation?: UseMutationOptions<
|
|
402
|
+
Awaited<ReturnType<typeof createAsset>>,
|
|
403
|
+
TError,
|
|
404
|
+
{ data: AssetPostBodyBody },
|
|
405
|
+
TContext
|
|
406
|
+
>;
|
|
407
|
+
request?: SecondParameter<typeof customFetch>;
|
|
408
|
+
},
|
|
409
|
+
queryClient?: QueryClient,
|
|
410
|
+
): UseMutationResult<
|
|
317
411
|
Awaited<ReturnType<typeof createAsset>>,
|
|
318
412
|
TError,
|
|
319
413
|
{ data: AssetPostBodyBody },
|
|
@@ -321,7 +415,7 @@ export const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
321
415
|
> => {
|
|
322
416
|
const mutationOptions = getCreateAssetMutationOptions(options);
|
|
323
417
|
|
|
324
|
-
return useMutation(mutationOptions);
|
|
418
|
+
return useMutation(mutationOptions, queryClient);
|
|
325
419
|
};
|
|
326
420
|
/**
|
|
327
421
|
* Gets a known Asset
|
|
@@ -371,7 +465,7 @@ export const getGetSpecificAssetQueryOptions = <
|
|
|
371
465
|
>(
|
|
372
466
|
assetId: string,
|
|
373
467
|
options?: {
|
|
374
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
468
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
375
469
|
request?: SecondParameter<typeof customFetch>;
|
|
376
470
|
},
|
|
377
471
|
) => {
|
|
@@ -386,12 +480,61 @@ export const getGetSpecificAssetQueryOptions = <
|
|
|
386
480
|
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
387
481
|
TError,
|
|
388
482
|
TData
|
|
389
|
-
> & { queryKey: QueryKey };
|
|
483
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
390
484
|
};
|
|
391
485
|
|
|
392
486
|
export type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;
|
|
393
487
|
export type GetSpecificAssetQueryError = ErrorType<AsError | void>;
|
|
394
488
|
|
|
489
|
+
export function useGetSpecificAsset<
|
|
490
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
491
|
+
TError = ErrorType<AsError | void>,
|
|
492
|
+
>(
|
|
493
|
+
assetId: string,
|
|
494
|
+
options: {
|
|
495
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &
|
|
496
|
+
Pick<
|
|
497
|
+
DefinedInitialDataOptions<
|
|
498
|
+
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
499
|
+
TError,
|
|
500
|
+
Awaited<ReturnType<typeof getSpecificAsset>>
|
|
501
|
+
>,
|
|
502
|
+
"initialData"
|
|
503
|
+
>;
|
|
504
|
+
request?: SecondParameter<typeof customFetch>;
|
|
505
|
+
},
|
|
506
|
+
queryClient?: QueryClient,
|
|
507
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
508
|
+
export function useGetSpecificAsset<
|
|
509
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
510
|
+
TError = ErrorType<AsError | void>,
|
|
511
|
+
>(
|
|
512
|
+
assetId: string,
|
|
513
|
+
options?: {
|
|
514
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &
|
|
515
|
+
Pick<
|
|
516
|
+
UndefinedInitialDataOptions<
|
|
517
|
+
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
518
|
+
TError,
|
|
519
|
+
Awaited<ReturnType<typeof getSpecificAsset>>
|
|
520
|
+
>,
|
|
521
|
+
"initialData"
|
|
522
|
+
>;
|
|
523
|
+
request?: SecondParameter<typeof customFetch>;
|
|
524
|
+
},
|
|
525
|
+
queryClient?: QueryClient,
|
|
526
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
527
|
+
export function useGetSpecificAsset<
|
|
528
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
529
|
+
TError = ErrorType<AsError | void>,
|
|
530
|
+
>(
|
|
531
|
+
assetId: string,
|
|
532
|
+
options?: {
|
|
533
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
534
|
+
request?: SecondParameter<typeof customFetch>;
|
|
535
|
+
},
|
|
536
|
+
queryClient?: QueryClient,
|
|
537
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
395
538
|
/**
|
|
396
539
|
* @summary Gets an Asset
|
|
397
540
|
*/
|
|
@@ -402,13 +545,16 @@ export function useGetSpecificAsset<
|
|
|
402
545
|
>(
|
|
403
546
|
assetId: string,
|
|
404
547
|
options?: {
|
|
405
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
548
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
406
549
|
request?: SecondParameter<typeof customFetch>;
|
|
407
550
|
},
|
|
408
|
-
|
|
551
|
+
queryClient?: QueryClient,
|
|
552
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
409
553
|
const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);
|
|
410
554
|
|
|
411
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
555
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
556
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
557
|
+
};
|
|
412
558
|
|
|
413
559
|
query.queryKey = queryOptions.queryKey;
|
|
414
560
|
|
|
@@ -434,7 +580,9 @@ export const getGetSpecificAssetSuspenseQueryOptions = <
|
|
|
434
580
|
>(
|
|
435
581
|
assetId: string,
|
|
436
582
|
options?: {
|
|
437
|
-
query?:
|
|
583
|
+
query?: Partial<
|
|
584
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
585
|
+
>;
|
|
438
586
|
request?: SecondParameter<typeof customFetch>;
|
|
439
587
|
},
|
|
440
588
|
) => {
|
|
@@ -449,7 +597,7 @@ export const getGetSpecificAssetSuspenseQueryOptions = <
|
|
|
449
597
|
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
450
598
|
TError,
|
|
451
599
|
TData
|
|
452
|
-
> & { queryKey: QueryKey };
|
|
600
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
453
601
|
};
|
|
454
602
|
|
|
455
603
|
export type GetSpecificAssetSuspenseQueryResult = NonNullable<
|
|
@@ -457,6 +605,45 @@ export type GetSpecificAssetSuspenseQueryResult = NonNullable<
|
|
|
457
605
|
>;
|
|
458
606
|
export type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
459
607
|
|
|
608
|
+
export function useGetSpecificAssetSuspense<
|
|
609
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
610
|
+
TError = ErrorType<AsError | void>,
|
|
611
|
+
>(
|
|
612
|
+
assetId: string,
|
|
613
|
+
options: {
|
|
614
|
+
query: Partial<
|
|
615
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
616
|
+
>;
|
|
617
|
+
request?: SecondParameter<typeof customFetch>;
|
|
618
|
+
},
|
|
619
|
+
queryClient?: QueryClient,
|
|
620
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
621
|
+
export function useGetSpecificAssetSuspense<
|
|
622
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
623
|
+
TError = ErrorType<AsError | void>,
|
|
624
|
+
>(
|
|
625
|
+
assetId: string,
|
|
626
|
+
options?: {
|
|
627
|
+
query?: Partial<
|
|
628
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
629
|
+
>;
|
|
630
|
+
request?: SecondParameter<typeof customFetch>;
|
|
631
|
+
},
|
|
632
|
+
queryClient?: QueryClient,
|
|
633
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
634
|
+
export function useGetSpecificAssetSuspense<
|
|
635
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
636
|
+
TError = ErrorType<AsError | void>,
|
|
637
|
+
>(
|
|
638
|
+
assetId: string,
|
|
639
|
+
options?: {
|
|
640
|
+
query?: Partial<
|
|
641
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
642
|
+
>;
|
|
643
|
+
request?: SecondParameter<typeof customFetch>;
|
|
644
|
+
},
|
|
645
|
+
queryClient?: QueryClient,
|
|
646
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
460
647
|
/**
|
|
461
648
|
* @summary Gets an Asset
|
|
462
649
|
*/
|
|
@@ -467,15 +654,19 @@ export function useGetSpecificAssetSuspense<
|
|
|
467
654
|
>(
|
|
468
655
|
assetId: string,
|
|
469
656
|
options?: {
|
|
470
|
-
query?:
|
|
657
|
+
query?: Partial<
|
|
658
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
659
|
+
>;
|
|
471
660
|
request?: SecondParameter<typeof customFetch>;
|
|
472
661
|
},
|
|
473
|
-
|
|
662
|
+
queryClient?: QueryClient,
|
|
663
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
474
664
|
const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);
|
|
475
665
|
|
|
476
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
477
|
-
|
|
478
|
-
|
|
666
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
667
|
+
TData,
|
|
668
|
+
TError
|
|
669
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
479
670
|
|
|
480
671
|
query.queryKey = queryOptions.queryKey;
|
|
481
672
|
|
|
@@ -578,15 +769,18 @@ export type PatchAssetMutationError = ErrorType<void | AsError>;
|
|
|
578
769
|
/**
|
|
579
770
|
* @summary Adjust an existing Asset
|
|
580
771
|
*/
|
|
581
|
-
export const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
772
|
+
export const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
773
|
+
options?: {
|
|
774
|
+
mutation?: UseMutationOptions<
|
|
775
|
+
Awaited<ReturnType<typeof patchAsset>>,
|
|
776
|
+
TError,
|
|
777
|
+
{ assetId: string; data: AssetPatchBodyBody },
|
|
778
|
+
TContext
|
|
779
|
+
>;
|
|
780
|
+
request?: SecondParameter<typeof customFetch>;
|
|
781
|
+
},
|
|
782
|
+
queryClient?: QueryClient,
|
|
783
|
+
): UseMutationResult<
|
|
590
784
|
Awaited<ReturnType<typeof patchAsset>>,
|
|
591
785
|
TError,
|
|
592
786
|
{ assetId: string; data: AssetPatchBodyBody },
|
|
@@ -594,7 +788,7 @@ export const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unk
|
|
|
594
788
|
> => {
|
|
595
789
|
const mutationOptions = getPatchAssetMutationOptions(options);
|
|
596
790
|
|
|
597
|
-
return useMutation(mutationOptions);
|
|
791
|
+
return useMutation(mutationOptions, queryClient);
|
|
598
792
|
};
|
|
599
793
|
/**
|
|
600
794
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
@@ -677,15 +871,18 @@ export type DeleteAssetMutationError = ErrorType<AsError | void>;
|
|
|
677
871
|
/**
|
|
678
872
|
* @summary Deletes an Asset
|
|
679
873
|
*/
|
|
680
|
-
export const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
874
|
+
export const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
875
|
+
options?: {
|
|
876
|
+
mutation?: UseMutationOptions<
|
|
877
|
+
Awaited<ReturnType<typeof deleteAsset>>,
|
|
878
|
+
TError,
|
|
879
|
+
{ assetId: string },
|
|
880
|
+
TContext
|
|
881
|
+
>;
|
|
882
|
+
request?: SecondParameter<typeof customFetch>;
|
|
883
|
+
},
|
|
884
|
+
queryClient?: QueryClient,
|
|
885
|
+
): UseMutationResult<
|
|
689
886
|
Awaited<ReturnType<typeof deleteAsset>>,
|
|
690
887
|
TError,
|
|
691
888
|
{ assetId: string },
|
|
@@ -693,7 +890,7 @@ export const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
693
890
|
> => {
|
|
694
891
|
const mutationOptions = getDeleteAssetMutationOptions(options);
|
|
695
892
|
|
|
696
|
-
return useMutation(mutationOptions);
|
|
893
|
+
return useMutation(mutationOptions, queryClient);
|
|
697
894
|
};
|
|
698
895
|
/**
|
|
699
896
|
* Disables a known Asset
|
|
@@ -776,15 +973,18 @@ export type DisableAssetMutationError = ErrorType<AsError | void>;
|
|
|
776
973
|
/**
|
|
777
974
|
* @summary Disables an Asset
|
|
778
975
|
*/
|
|
779
|
-
export const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
976
|
+
export const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
977
|
+
options?: {
|
|
978
|
+
mutation?: UseMutationOptions<
|
|
979
|
+
Awaited<ReturnType<typeof disableAsset>>,
|
|
980
|
+
TError,
|
|
981
|
+
{ assetId: string },
|
|
982
|
+
TContext
|
|
983
|
+
>;
|
|
984
|
+
request?: SecondParameter<typeof customFetch>;
|
|
985
|
+
},
|
|
986
|
+
queryClient?: QueryClient,
|
|
987
|
+
): UseMutationResult<
|
|
788
988
|
Awaited<ReturnType<typeof disableAsset>>,
|
|
789
989
|
TError,
|
|
790
990
|
{ assetId: string },
|
|
@@ -792,7 +992,7 @@ export const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = u
|
|
|
792
992
|
> => {
|
|
793
993
|
const mutationOptions = getDisableAssetMutationOptions(options);
|
|
794
994
|
|
|
795
|
-
return useMutation(mutationOptions);
|
|
995
|
+
return useMutation(mutationOptions, queryClient);
|
|
796
996
|
};
|
|
797
997
|
/**
|
|
798
998
|
* Enables a known Asset
|
|
@@ -875,15 +1075,18 @@ export type EnableAssetMutationError = ErrorType<AsError | void>;
|
|
|
875
1075
|
/**
|
|
876
1076
|
* @summary Enables an Asset
|
|
877
1077
|
*/
|
|
878
|
-
export const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1078
|
+
export const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1079
|
+
options?: {
|
|
1080
|
+
mutation?: UseMutationOptions<
|
|
1081
|
+
Awaited<ReturnType<typeof enableAsset>>,
|
|
1082
|
+
TError,
|
|
1083
|
+
{ assetId: string },
|
|
1084
|
+
TContext
|
|
1085
|
+
>;
|
|
1086
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1087
|
+
},
|
|
1088
|
+
queryClient?: QueryClient,
|
|
1089
|
+
): UseMutationResult<
|
|
887
1090
|
Awaited<ReturnType<typeof enableAsset>>,
|
|
888
1091
|
TError,
|
|
889
1092
|
{ assetId: string },
|
|
@@ -891,7 +1094,7 @@ export const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
891
1094
|
> => {
|
|
892
1095
|
const mutationOptions = getEnableAssetMutationOptions(options);
|
|
893
1096
|
|
|
894
|
-
return useMutation(mutationOptions);
|
|
1097
|
+
return useMutation(mutationOptions, queryClient);
|
|
895
1098
|
};
|
|
896
1099
|
/**
|
|
897
1100
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
@@ -987,15 +1190,18 @@ export type AttachAssetMutationError = ErrorType<AsError | void>;
|
|
|
987
1190
|
/**
|
|
988
1191
|
* @summary Attaches an Asset to a Merchant
|
|
989
1192
|
*/
|
|
990
|
-
export const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
1193
|
+
export const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1194
|
+
options?: {
|
|
1195
|
+
mutation?: UseMutationOptions<
|
|
1196
|
+
Awaited<ReturnType<typeof attachAsset>>,
|
|
1197
|
+
TError,
|
|
1198
|
+
{ assetId: string; params?: AttachAssetParams },
|
|
1199
|
+
TContext
|
|
1200
|
+
>;
|
|
1201
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1202
|
+
},
|
|
1203
|
+
queryClient?: QueryClient,
|
|
1204
|
+
): UseMutationResult<
|
|
999
1205
|
Awaited<ReturnType<typeof attachAsset>>,
|
|
1000
1206
|
TError,
|
|
1001
1207
|
{ assetId: string; params?: AttachAssetParams },
|
|
@@ -1003,7 +1209,7 @@ export const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
1003
1209
|
> => {
|
|
1004
1210
|
const mutationOptions = getAttachAssetMutationOptions(options);
|
|
1005
1211
|
|
|
1006
|
-
return useMutation(mutationOptions);
|
|
1212
|
+
return useMutation(mutationOptions, queryClient);
|
|
1007
1213
|
};
|
|
1008
1214
|
/**
|
|
1009
1215
|
* Detaches an Asset from a **Merchant**
|
|
@@ -1099,15 +1305,18 @@ export type DetachAssetMutationError = ErrorType<AsError | void>;
|
|
|
1099
1305
|
/**
|
|
1100
1306
|
* @summary Detaches an Asset from a Merchant
|
|
1101
1307
|
*/
|
|
1102
|
-
export const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1308
|
+
export const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1309
|
+
options?: {
|
|
1310
|
+
mutation?: UseMutationOptions<
|
|
1311
|
+
Awaited<ReturnType<typeof detachAsset>>,
|
|
1312
|
+
TError,
|
|
1313
|
+
{ assetId: string; params?: DetachAssetParams },
|
|
1314
|
+
TContext
|
|
1315
|
+
>;
|
|
1316
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1317
|
+
},
|
|
1318
|
+
queryClient?: QueryClient,
|
|
1319
|
+
): UseMutationResult<
|
|
1111
1320
|
Awaited<ReturnType<typeof detachAsset>>,
|
|
1112
1321
|
TError,
|
|
1113
1322
|
{ assetId: string; params?: DetachAssetParams },
|
|
@@ -1115,5 +1324,5 @@ export const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
1115
1324
|
> => {
|
|
1116
1325
|
const mutationOptions = getDetachAssetMutationOptions(options);
|
|
1117
1326
|
|
|
1118
|
-
return useMutation(mutationOptions);
|
|
1327
|
+
return useMutation(mutationOptions, queryClient);
|
|
1119
1328
|
};
|