@squonk/account-server-client 4.4.0-4-4.2197069952 → 4.4.0-4-4.2199390673
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
package/src/api/asset/asset.ts
CHANGED
|
@@ -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,
|
|
@@ -66,7 +70,7 @@ export const getGetAssetQueryOptions = <
|
|
|
66
70
|
>(
|
|
67
71
|
params?: GetAssetParams,
|
|
68
72
|
options?: {
|
|
69
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
73
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
70
74
|
request?: SecondParameter<typeof customInstance>;
|
|
71
75
|
},
|
|
72
76
|
) => {
|
|
@@ -81,12 +85,61 @@ export const getGetAssetQueryOptions = <
|
|
|
81
85
|
Awaited<ReturnType<typeof getAsset>>,
|
|
82
86
|
TError,
|
|
83
87
|
TData
|
|
84
|
-
> & { queryKey: QueryKey };
|
|
88
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
85
89
|
};
|
|
86
90
|
|
|
87
91
|
export type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
88
92
|
export type GetAssetQueryError = ErrorType<AsError | void>;
|
|
89
93
|
|
|
94
|
+
export function useGetAsset<
|
|
95
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
96
|
+
TError = ErrorType<AsError | void>,
|
|
97
|
+
>(
|
|
98
|
+
params: undefined | GetAssetParams,
|
|
99
|
+
options: {
|
|
100
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &
|
|
101
|
+
Pick<
|
|
102
|
+
DefinedInitialDataOptions<
|
|
103
|
+
Awaited<ReturnType<typeof getAsset>>,
|
|
104
|
+
TError,
|
|
105
|
+
Awaited<ReturnType<typeof getAsset>>
|
|
106
|
+
>,
|
|
107
|
+
"initialData"
|
|
108
|
+
>;
|
|
109
|
+
request?: SecondParameter<typeof customInstance>;
|
|
110
|
+
},
|
|
111
|
+
queryClient?: QueryClient,
|
|
112
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
113
|
+
export function useGetAsset<
|
|
114
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
115
|
+
TError = ErrorType<AsError | void>,
|
|
116
|
+
>(
|
|
117
|
+
params?: GetAssetParams,
|
|
118
|
+
options?: {
|
|
119
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &
|
|
120
|
+
Pick<
|
|
121
|
+
UndefinedInitialDataOptions<
|
|
122
|
+
Awaited<ReturnType<typeof getAsset>>,
|
|
123
|
+
TError,
|
|
124
|
+
Awaited<ReturnType<typeof getAsset>>
|
|
125
|
+
>,
|
|
126
|
+
"initialData"
|
|
127
|
+
>;
|
|
128
|
+
request?: SecondParameter<typeof customInstance>;
|
|
129
|
+
},
|
|
130
|
+
queryClient?: QueryClient,
|
|
131
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
132
|
+
export function useGetAsset<
|
|
133
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
134
|
+
TError = ErrorType<AsError | void>,
|
|
135
|
+
>(
|
|
136
|
+
params?: GetAssetParams,
|
|
137
|
+
options?: {
|
|
138
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
139
|
+
request?: SecondParameter<typeof customInstance>;
|
|
140
|
+
},
|
|
141
|
+
queryClient?: QueryClient,
|
|
142
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
90
143
|
/**
|
|
91
144
|
* @summary Gets Assets
|
|
92
145
|
*/
|
|
@@ -97,13 +150,16 @@ export function useGetAsset<
|
|
|
97
150
|
>(
|
|
98
151
|
params?: GetAssetParams,
|
|
99
152
|
options?: {
|
|
100
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
153
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
101
154
|
request?: SecondParameter<typeof customInstance>;
|
|
102
155
|
},
|
|
103
|
-
|
|
156
|
+
queryClient?: QueryClient,
|
|
157
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
104
158
|
const queryOptions = getGetAssetQueryOptions(params, options);
|
|
105
159
|
|
|
106
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
160
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
161
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
162
|
+
};
|
|
107
163
|
|
|
108
164
|
query.queryKey = queryOptions.queryKey;
|
|
109
165
|
|
|
@@ -129,7 +185,7 @@ export const getGetAssetSuspenseQueryOptions = <
|
|
|
129
185
|
>(
|
|
130
186
|
params?: GetAssetParams,
|
|
131
187
|
options?: {
|
|
132
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
188
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
133
189
|
request?: SecondParameter<typeof customInstance>;
|
|
134
190
|
},
|
|
135
191
|
) => {
|
|
@@ -144,12 +200,45 @@ export const getGetAssetSuspenseQueryOptions = <
|
|
|
144
200
|
Awaited<ReturnType<typeof getAsset>>,
|
|
145
201
|
TError,
|
|
146
202
|
TData
|
|
147
|
-
> & { queryKey: QueryKey };
|
|
203
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
148
204
|
};
|
|
149
205
|
|
|
150
206
|
export type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
151
207
|
export type GetAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
152
208
|
|
|
209
|
+
export function useGetAssetSuspense<
|
|
210
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
211
|
+
TError = ErrorType<AsError | void>,
|
|
212
|
+
>(
|
|
213
|
+
params: undefined | GetAssetParams,
|
|
214
|
+
options: {
|
|
215
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
216
|
+
request?: SecondParameter<typeof customInstance>;
|
|
217
|
+
},
|
|
218
|
+
queryClient?: QueryClient,
|
|
219
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
220
|
+
export function useGetAssetSuspense<
|
|
221
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
222
|
+
TError = ErrorType<AsError | void>,
|
|
223
|
+
>(
|
|
224
|
+
params?: GetAssetParams,
|
|
225
|
+
options?: {
|
|
226
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
227
|
+
request?: SecondParameter<typeof customInstance>;
|
|
228
|
+
},
|
|
229
|
+
queryClient?: QueryClient,
|
|
230
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
231
|
+
export function useGetAssetSuspense<
|
|
232
|
+
TData = Awaited<ReturnType<typeof getAsset>>,
|
|
233
|
+
TError = ErrorType<AsError | void>,
|
|
234
|
+
>(
|
|
235
|
+
params?: GetAssetParams,
|
|
236
|
+
options?: {
|
|
237
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
238
|
+
request?: SecondParameter<typeof customInstance>;
|
|
239
|
+
},
|
|
240
|
+
queryClient?: QueryClient,
|
|
241
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
153
242
|
/**
|
|
154
243
|
* @summary Gets Assets
|
|
155
244
|
*/
|
|
@@ -160,15 +249,17 @@ export function useGetAssetSuspense<
|
|
|
160
249
|
>(
|
|
161
250
|
params?: GetAssetParams,
|
|
162
251
|
options?: {
|
|
163
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
252
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
164
253
|
request?: SecondParameter<typeof customInstance>;
|
|
165
254
|
},
|
|
166
|
-
|
|
255
|
+
queryClient?: QueryClient,
|
|
256
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
167
257
|
const queryOptions = getGetAssetSuspenseQueryOptions(params, options);
|
|
168
258
|
|
|
169
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
170
|
-
|
|
171
|
-
|
|
259
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
260
|
+
TData,
|
|
261
|
+
TError
|
|
262
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
172
263
|
|
|
173
264
|
query.queryKey = queryOptions.queryKey;
|
|
174
265
|
|
|
@@ -263,15 +354,18 @@ export type CreateAssetMutationError = ErrorType<AsError | void>;
|
|
|
263
354
|
/**
|
|
264
355
|
* @summary Create an Asset
|
|
265
356
|
*/
|
|
266
|
-
export const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
357
|
+
export const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
358
|
+
options?: {
|
|
359
|
+
mutation?: UseMutationOptions<
|
|
360
|
+
Awaited<ReturnType<typeof createAsset>>,
|
|
361
|
+
TError,
|
|
362
|
+
{ data: AssetPostBodyBody },
|
|
363
|
+
TContext
|
|
364
|
+
>;
|
|
365
|
+
request?: SecondParameter<typeof customInstance>;
|
|
366
|
+
},
|
|
367
|
+
queryClient?: QueryClient,
|
|
368
|
+
): UseMutationResult<
|
|
275
369
|
Awaited<ReturnType<typeof createAsset>>,
|
|
276
370
|
TError,
|
|
277
371
|
{ data: AssetPostBodyBody },
|
|
@@ -279,7 +373,7 @@ export const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
279
373
|
> => {
|
|
280
374
|
const mutationOptions = getCreateAssetMutationOptions(options);
|
|
281
375
|
|
|
282
|
-
return useMutation(mutationOptions);
|
|
376
|
+
return useMutation(mutationOptions, queryClient);
|
|
283
377
|
};
|
|
284
378
|
/**
|
|
285
379
|
* Gets a known Asset
|
|
@@ -304,7 +398,7 @@ export const getGetSpecificAssetQueryOptions = <
|
|
|
304
398
|
>(
|
|
305
399
|
assetId: string,
|
|
306
400
|
options?: {
|
|
307
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
401
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
308
402
|
request?: SecondParameter<typeof customInstance>;
|
|
309
403
|
},
|
|
310
404
|
) => {
|
|
@@ -319,12 +413,61 @@ export const getGetSpecificAssetQueryOptions = <
|
|
|
319
413
|
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
320
414
|
TError,
|
|
321
415
|
TData
|
|
322
|
-
> & { queryKey: QueryKey };
|
|
416
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
323
417
|
};
|
|
324
418
|
|
|
325
419
|
export type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;
|
|
326
420
|
export type GetSpecificAssetQueryError = ErrorType<AsError | void>;
|
|
327
421
|
|
|
422
|
+
export function useGetSpecificAsset<
|
|
423
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
424
|
+
TError = ErrorType<AsError | void>,
|
|
425
|
+
>(
|
|
426
|
+
assetId: string,
|
|
427
|
+
options: {
|
|
428
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &
|
|
429
|
+
Pick<
|
|
430
|
+
DefinedInitialDataOptions<
|
|
431
|
+
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
432
|
+
TError,
|
|
433
|
+
Awaited<ReturnType<typeof getSpecificAsset>>
|
|
434
|
+
>,
|
|
435
|
+
"initialData"
|
|
436
|
+
>;
|
|
437
|
+
request?: SecondParameter<typeof customInstance>;
|
|
438
|
+
},
|
|
439
|
+
queryClient?: QueryClient,
|
|
440
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
441
|
+
export function useGetSpecificAsset<
|
|
442
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
443
|
+
TError = ErrorType<AsError | void>,
|
|
444
|
+
>(
|
|
445
|
+
assetId: string,
|
|
446
|
+
options?: {
|
|
447
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &
|
|
448
|
+
Pick<
|
|
449
|
+
UndefinedInitialDataOptions<
|
|
450
|
+
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
451
|
+
TError,
|
|
452
|
+
Awaited<ReturnType<typeof getSpecificAsset>>
|
|
453
|
+
>,
|
|
454
|
+
"initialData"
|
|
455
|
+
>;
|
|
456
|
+
request?: SecondParameter<typeof customInstance>;
|
|
457
|
+
},
|
|
458
|
+
queryClient?: QueryClient,
|
|
459
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
460
|
+
export function useGetSpecificAsset<
|
|
461
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
462
|
+
TError = ErrorType<AsError | void>,
|
|
463
|
+
>(
|
|
464
|
+
assetId: string,
|
|
465
|
+
options?: {
|
|
466
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
467
|
+
request?: SecondParameter<typeof customInstance>;
|
|
468
|
+
},
|
|
469
|
+
queryClient?: QueryClient,
|
|
470
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
328
471
|
/**
|
|
329
472
|
* @summary Gets an Asset
|
|
330
473
|
*/
|
|
@@ -335,13 +478,16 @@ export function useGetSpecificAsset<
|
|
|
335
478
|
>(
|
|
336
479
|
assetId: string,
|
|
337
480
|
options?: {
|
|
338
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
481
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
339
482
|
request?: SecondParameter<typeof customInstance>;
|
|
340
483
|
},
|
|
341
|
-
|
|
484
|
+
queryClient?: QueryClient,
|
|
485
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
342
486
|
const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);
|
|
343
487
|
|
|
344
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
488
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
489
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
490
|
+
};
|
|
345
491
|
|
|
346
492
|
query.queryKey = queryOptions.queryKey;
|
|
347
493
|
|
|
@@ -367,7 +513,9 @@ export const getGetSpecificAssetSuspenseQueryOptions = <
|
|
|
367
513
|
>(
|
|
368
514
|
assetId: string,
|
|
369
515
|
options?: {
|
|
370
|
-
query?:
|
|
516
|
+
query?: Partial<
|
|
517
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
518
|
+
>;
|
|
371
519
|
request?: SecondParameter<typeof customInstance>;
|
|
372
520
|
},
|
|
373
521
|
) => {
|
|
@@ -382,7 +530,7 @@ export const getGetSpecificAssetSuspenseQueryOptions = <
|
|
|
382
530
|
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
383
531
|
TError,
|
|
384
532
|
TData
|
|
385
|
-
> & { queryKey: QueryKey };
|
|
533
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
386
534
|
};
|
|
387
535
|
|
|
388
536
|
export type GetSpecificAssetSuspenseQueryResult = NonNullable<
|
|
@@ -390,6 +538,45 @@ export type GetSpecificAssetSuspenseQueryResult = NonNullable<
|
|
|
390
538
|
>;
|
|
391
539
|
export type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
392
540
|
|
|
541
|
+
export function useGetSpecificAssetSuspense<
|
|
542
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
543
|
+
TError = ErrorType<AsError | void>,
|
|
544
|
+
>(
|
|
545
|
+
assetId: string,
|
|
546
|
+
options: {
|
|
547
|
+
query: Partial<
|
|
548
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
549
|
+
>;
|
|
550
|
+
request?: SecondParameter<typeof customInstance>;
|
|
551
|
+
},
|
|
552
|
+
queryClient?: QueryClient,
|
|
553
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
554
|
+
export function useGetSpecificAssetSuspense<
|
|
555
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
556
|
+
TError = ErrorType<AsError | void>,
|
|
557
|
+
>(
|
|
558
|
+
assetId: string,
|
|
559
|
+
options?: {
|
|
560
|
+
query?: Partial<
|
|
561
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
562
|
+
>;
|
|
563
|
+
request?: SecondParameter<typeof customInstance>;
|
|
564
|
+
},
|
|
565
|
+
queryClient?: QueryClient,
|
|
566
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
567
|
+
export function useGetSpecificAssetSuspense<
|
|
568
|
+
TData = Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
569
|
+
TError = ErrorType<AsError | void>,
|
|
570
|
+
>(
|
|
571
|
+
assetId: string,
|
|
572
|
+
options?: {
|
|
573
|
+
query?: Partial<
|
|
574
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
575
|
+
>;
|
|
576
|
+
request?: SecondParameter<typeof customInstance>;
|
|
577
|
+
},
|
|
578
|
+
queryClient?: QueryClient,
|
|
579
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
393
580
|
/**
|
|
394
581
|
* @summary Gets an Asset
|
|
395
582
|
*/
|
|
@@ -400,15 +587,19 @@ export function useGetSpecificAssetSuspense<
|
|
|
400
587
|
>(
|
|
401
588
|
assetId: string,
|
|
402
589
|
options?: {
|
|
403
|
-
query?:
|
|
590
|
+
query?: Partial<
|
|
591
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>
|
|
592
|
+
>;
|
|
404
593
|
request?: SecondParameter<typeof customInstance>;
|
|
405
594
|
},
|
|
406
|
-
|
|
595
|
+
queryClient?: QueryClient,
|
|
596
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
407
597
|
const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);
|
|
408
598
|
|
|
409
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
410
|
-
|
|
411
|
-
|
|
599
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
600
|
+
TData,
|
|
601
|
+
TError
|
|
602
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
412
603
|
|
|
413
604
|
query.queryKey = queryOptions.queryKey;
|
|
414
605
|
|
|
@@ -494,15 +685,18 @@ export type PatchAssetMutationError = ErrorType<void | AsError>;
|
|
|
494
685
|
/**
|
|
495
686
|
* @summary Adjust an existing Asset
|
|
496
687
|
*/
|
|
497
|
-
export const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
688
|
+
export const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
689
|
+
options?: {
|
|
690
|
+
mutation?: UseMutationOptions<
|
|
691
|
+
Awaited<ReturnType<typeof patchAsset>>,
|
|
692
|
+
TError,
|
|
693
|
+
{ assetId: string; data: AssetPatchBodyBody },
|
|
694
|
+
TContext
|
|
695
|
+
>;
|
|
696
|
+
request?: SecondParameter<typeof customInstance>;
|
|
697
|
+
},
|
|
698
|
+
queryClient?: QueryClient,
|
|
699
|
+
): UseMutationResult<
|
|
506
700
|
Awaited<ReturnType<typeof patchAsset>>,
|
|
507
701
|
TError,
|
|
508
702
|
{ assetId: string; data: AssetPatchBodyBody },
|
|
@@ -510,7 +704,7 @@ export const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unk
|
|
|
510
704
|
> => {
|
|
511
705
|
const mutationOptions = getPatchAssetMutationOptions(options);
|
|
512
706
|
|
|
513
|
-
return useMutation(mutationOptions);
|
|
707
|
+
return useMutation(mutationOptions, queryClient);
|
|
514
708
|
};
|
|
515
709
|
/**
|
|
516
710
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
@@ -566,15 +760,18 @@ export type DeleteAssetMutationError = ErrorType<AsError | void>;
|
|
|
566
760
|
/**
|
|
567
761
|
* @summary Deletes an Asset
|
|
568
762
|
*/
|
|
569
|
-
export const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
763
|
+
export const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
764
|
+
options?: {
|
|
765
|
+
mutation?: UseMutationOptions<
|
|
766
|
+
Awaited<ReturnType<typeof deleteAsset>>,
|
|
767
|
+
TError,
|
|
768
|
+
{ assetId: string },
|
|
769
|
+
TContext
|
|
770
|
+
>;
|
|
771
|
+
request?: SecondParameter<typeof customInstance>;
|
|
772
|
+
},
|
|
773
|
+
queryClient?: QueryClient,
|
|
774
|
+
): UseMutationResult<
|
|
578
775
|
Awaited<ReturnType<typeof deleteAsset>>,
|
|
579
776
|
TError,
|
|
580
777
|
{ assetId: string },
|
|
@@ -582,7 +779,7 @@ export const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
582
779
|
> => {
|
|
583
780
|
const mutationOptions = getDeleteAssetMutationOptions(options);
|
|
584
781
|
|
|
585
|
-
return useMutation(mutationOptions);
|
|
782
|
+
return useMutation(mutationOptions, queryClient);
|
|
586
783
|
};
|
|
587
784
|
/**
|
|
588
785
|
* Disables a known Asset
|
|
@@ -638,15 +835,18 @@ export type DisableAssetMutationError = ErrorType<AsError | void>;
|
|
|
638
835
|
/**
|
|
639
836
|
* @summary Disables an Asset
|
|
640
837
|
*/
|
|
641
|
-
export const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
838
|
+
export const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
839
|
+
options?: {
|
|
840
|
+
mutation?: UseMutationOptions<
|
|
841
|
+
Awaited<ReturnType<typeof disableAsset>>,
|
|
842
|
+
TError,
|
|
843
|
+
{ assetId: string },
|
|
844
|
+
TContext
|
|
845
|
+
>;
|
|
846
|
+
request?: SecondParameter<typeof customInstance>;
|
|
847
|
+
},
|
|
848
|
+
queryClient?: QueryClient,
|
|
849
|
+
): UseMutationResult<
|
|
650
850
|
Awaited<ReturnType<typeof disableAsset>>,
|
|
651
851
|
TError,
|
|
652
852
|
{ assetId: string },
|
|
@@ -654,7 +854,7 @@ export const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = u
|
|
|
654
854
|
> => {
|
|
655
855
|
const mutationOptions = getDisableAssetMutationOptions(options);
|
|
656
856
|
|
|
657
|
-
return useMutation(mutationOptions);
|
|
857
|
+
return useMutation(mutationOptions, queryClient);
|
|
658
858
|
};
|
|
659
859
|
/**
|
|
660
860
|
* Enables a known Asset
|
|
@@ -710,15 +910,18 @@ export type EnableAssetMutationError = ErrorType<AsError | void>;
|
|
|
710
910
|
/**
|
|
711
911
|
* @summary Enables an Asset
|
|
712
912
|
*/
|
|
713
|
-
export const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
913
|
+
export const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
914
|
+
options?: {
|
|
915
|
+
mutation?: UseMutationOptions<
|
|
916
|
+
Awaited<ReturnType<typeof enableAsset>>,
|
|
917
|
+
TError,
|
|
918
|
+
{ assetId: string },
|
|
919
|
+
TContext
|
|
920
|
+
>;
|
|
921
|
+
request?: SecondParameter<typeof customInstance>;
|
|
922
|
+
},
|
|
923
|
+
queryClient?: QueryClient,
|
|
924
|
+
): UseMutationResult<
|
|
722
925
|
Awaited<ReturnType<typeof enableAsset>>,
|
|
723
926
|
TError,
|
|
724
927
|
{ assetId: string },
|
|
@@ -726,7 +929,7 @@ export const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
726
929
|
> => {
|
|
727
930
|
const mutationOptions = getEnableAssetMutationOptions(options);
|
|
728
931
|
|
|
729
|
-
return useMutation(mutationOptions);
|
|
932
|
+
return useMutation(mutationOptions, queryClient);
|
|
730
933
|
};
|
|
731
934
|
/**
|
|
732
935
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
@@ -789,15 +992,18 @@ export type AttachAssetMutationError = ErrorType<AsError | void>;
|
|
|
789
992
|
/**
|
|
790
993
|
* @summary Attaches an Asset to a Merchant
|
|
791
994
|
*/
|
|
792
|
-
export const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
995
|
+
export const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
996
|
+
options?: {
|
|
997
|
+
mutation?: UseMutationOptions<
|
|
998
|
+
Awaited<ReturnType<typeof attachAsset>>,
|
|
999
|
+
TError,
|
|
1000
|
+
{ assetId: string; params?: AttachAssetParams },
|
|
1001
|
+
TContext
|
|
1002
|
+
>;
|
|
1003
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1004
|
+
},
|
|
1005
|
+
queryClient?: QueryClient,
|
|
1006
|
+
): UseMutationResult<
|
|
801
1007
|
Awaited<ReturnType<typeof attachAsset>>,
|
|
802
1008
|
TError,
|
|
803
1009
|
{ assetId: string; params?: AttachAssetParams },
|
|
@@ -805,7 +1011,7 @@ export const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
805
1011
|
> => {
|
|
806
1012
|
const mutationOptions = getAttachAssetMutationOptions(options);
|
|
807
1013
|
|
|
808
|
-
return useMutation(mutationOptions);
|
|
1014
|
+
return useMutation(mutationOptions, queryClient);
|
|
809
1015
|
};
|
|
810
1016
|
/**
|
|
811
1017
|
* Detaches an Asset from a **Merchant**
|
|
@@ -868,15 +1074,18 @@ export type DetachAssetMutationError = ErrorType<AsError | void>;
|
|
|
868
1074
|
/**
|
|
869
1075
|
* @summary Detaches an Asset from a Merchant
|
|
870
1076
|
*/
|
|
871
|
-
export const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
1077
|
+
export const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1078
|
+
options?: {
|
|
1079
|
+
mutation?: UseMutationOptions<
|
|
1080
|
+
Awaited<ReturnType<typeof detachAsset>>,
|
|
1081
|
+
TError,
|
|
1082
|
+
{ assetId: string; params?: DetachAssetParams },
|
|
1083
|
+
TContext
|
|
1084
|
+
>;
|
|
1085
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1086
|
+
},
|
|
1087
|
+
queryClient?: QueryClient,
|
|
1088
|
+
): UseMutationResult<
|
|
880
1089
|
Awaited<ReturnType<typeof detachAsset>>,
|
|
881
1090
|
TError,
|
|
882
1091
|
{ assetId: string; params?: DetachAssetParams },
|
|
@@ -884,5 +1093,5 @@ export const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = un
|
|
|
884
1093
|
> => {
|
|
885
1094
|
const mutationOptions = getDetachAssetMutationOptions(options);
|
|
886
1095
|
|
|
887
|
-
return useMutation(mutationOptions);
|
|
1096
|
+
return useMutation(mutationOptions, queryClient);
|
|
888
1097
|
};
|