@squonk/account-server-client 3.1.0-alpha.3 → 4.0.0-beta.3
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/asset/asset.cjs +24 -24
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +137 -102
- package/asset/asset.d.ts +137 -102
- package/asset/asset.js +24 -24
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +16 -16
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +137 -65
- package/charges/charges.d.ts +137 -65
- package/charges/charges.js +16 -16
- package/charges/charges.js.map +1 -1
- package/chunk-TKLTUR4R.cjs.map +1 -1
- package/event-stream/event-stream.cjs +8 -8
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +82 -47
- package/event-stream/event-stream.d.ts +82 -47
- package/event-stream/event-stream.js +8 -8
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs.map +1 -1
- package/index.d.cts +62 -14
- package/index.d.ts +62 -14
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +8 -8
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +69 -33
- package/merchant/merchant.d.ts +69 -33
- package/merchant/merchant.js +8 -8
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +14 -14
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +128 -75
- package/organisation/organisation.d.ts +128 -75
- package/organisation/organisation.js +14 -14
- package/organisation/organisation.js.map +1 -1
- package/package.json +7 -7
- package/product/product.cjs +24 -24
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +229 -122
- package/product/product.d.ts +229 -122
- package/product/product.js +24 -24
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +63 -14
- package/src/asset/asset.ts +185 -65
- package/src/charges/charges.ts +200 -18
- package/src/event-stream/event-stream.ts +114 -19
- package/src/merchant/merchant.ts +94 -10
- package/src/organisation/organisation.ts +171 -31
- package/src/product/product.ts +301 -41
- package/src/state/state.ts +50 -6
- package/src/unit/unit.ts +188 -38
- package/src/user/user.ts +183 -38
- package/state/state.cjs +4 -4
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +35 -17
- package/state/state.d.ts +35 -17
- package/state/state.js +4 -4
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +12 -12
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +140 -87
- package/unit/unit.d.ts +140 -87
- package/unit/unit.js +12 -12
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +12 -12
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +139 -86
- package/user/user.d.ts +139 -86
- package/user/user.js +12 -12
- package/user/user.js.map +1 -1
package/src/asset/asset.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
/**
|
|
2
|
-
* Generated by orval
|
|
3
|
+
* Generated by orval v7.2.0 🍺
|
|
3
4
|
* Do not edit manually.
|
|
4
5
|
* Account Server API
|
|
5
6
|
* The Informatics Matters Account Server API.
|
|
6
7
|
|
|
7
8
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
8
9
|
|
|
9
|
-
* OpenAPI spec version:
|
|
10
|
+
* OpenAPI spec version: 4.0
|
|
10
11
|
*/
|
|
11
12
|
import {
|
|
12
13
|
useMutation,
|
|
@@ -14,10 +15,14 @@ import {
|
|
|
14
15
|
useSuspenseQuery
|
|
15
16
|
} from '@tanstack/react-query'
|
|
16
17
|
import type {
|
|
18
|
+
DefinedInitialDataOptions,
|
|
19
|
+
DefinedUseQueryResult,
|
|
17
20
|
MutationFunction,
|
|
18
21
|
QueryFunction,
|
|
19
22
|
QueryKey,
|
|
23
|
+
UndefinedInitialDataOptions,
|
|
20
24
|
UseMutationOptions,
|
|
25
|
+
UseMutationResult,
|
|
21
26
|
UseQueryOptions,
|
|
22
27
|
UseQueryResult,
|
|
23
28
|
UseSuspenseQueryOptions,
|
|
@@ -86,13 +91,39 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
86
91
|
export type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>
|
|
87
92
|
export type GetAssetQueryError = ErrorType<AsError | void>
|
|
88
93
|
|
|
94
|
+
|
|
95
|
+
export function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
96
|
+
params: undefined | GetAssetParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> & Pick<
|
|
97
|
+
DefinedInitialDataOptions<
|
|
98
|
+
Awaited<ReturnType<typeof getAsset>>,
|
|
99
|
+
TError,
|
|
100
|
+
TData
|
|
101
|
+
> , 'initialData'
|
|
102
|
+
>, request?: SecondParameter<typeof customInstance>}
|
|
103
|
+
|
|
104
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
105
|
+
export function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
106
|
+
params?: GetAssetParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> & Pick<
|
|
107
|
+
UndefinedInitialDataOptions<
|
|
108
|
+
Awaited<ReturnType<typeof getAsset>>,
|
|
109
|
+
TError,
|
|
110
|
+
TData
|
|
111
|
+
> , 'initialData'
|
|
112
|
+
>, request?: SecondParameter<typeof customInstance>}
|
|
113
|
+
|
|
114
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
115
|
+
export function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
116
|
+
params?: GetAssetParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
117
|
+
|
|
118
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
89
119
|
/**
|
|
90
120
|
* @summary Gets Assets
|
|
91
121
|
*/
|
|
92
|
-
|
|
122
|
+
|
|
123
|
+
export function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
93
124
|
params?: GetAssetParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
94
125
|
|
|
95
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
126
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
96
127
|
|
|
97
128
|
const queryOptions = getGetAssetQueryOptions(params,options)
|
|
98
129
|
|
|
@@ -126,13 +157,27 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
126
157
|
export type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>
|
|
127
158
|
export type GetAssetSuspenseQueryError = ErrorType<AsError | void>
|
|
128
159
|
|
|
160
|
+
|
|
161
|
+
export function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
162
|
+
params: undefined | GetAssetParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
163
|
+
|
|
164
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
165
|
+
export function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
166
|
+
params?: GetAssetParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
167
|
+
|
|
168
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
169
|
+
export function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
170
|
+
params?: GetAssetParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
171
|
+
|
|
172
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
129
173
|
/**
|
|
130
174
|
* @summary Gets Assets
|
|
131
175
|
*/
|
|
132
|
-
|
|
176
|
+
|
|
177
|
+
export function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(
|
|
133
178
|
params?: GetAssetParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
134
179
|
|
|
135
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
180
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
136
181
|
|
|
137
182
|
const queryOptions = getGetAssetSuspenseQueryOptions(params,options)
|
|
138
183
|
|
|
@@ -160,27 +205,27 @@ export const createAsset = (
|
|
|
160
205
|
assetPostBodyBody: AssetPostBodyBody,
|
|
161
206
|
options?: SecondParameter<typeof customInstance>,) => {
|
|
162
207
|
|
|
163
|
-
const
|
|
164
|
-
|
|
208
|
+
const formUrlEncoded = new URLSearchParams();
|
|
209
|
+
formUrlEncoded.append('name', assetPostBodyBody.name)
|
|
165
210
|
if(assetPostBodyBody.content_file !== undefined) {
|
|
166
|
-
|
|
211
|
+
formUrlEncoded.append('content_file', assetPostBodyBody.content_file)
|
|
167
212
|
}
|
|
168
213
|
if(assetPostBodyBody.content_string !== undefined) {
|
|
169
|
-
|
|
214
|
+
formUrlEncoded.append('content_string', assetPostBodyBody.content_string)
|
|
170
215
|
}
|
|
171
|
-
|
|
216
|
+
formUrlEncoded.append('scope', assetPostBodyBody.scope)
|
|
172
217
|
if(assetPostBodyBody.scope_id !== undefined) {
|
|
173
|
-
|
|
218
|
+
formUrlEncoded.append('scope_id', assetPostBodyBody.scope_id)
|
|
174
219
|
}
|
|
175
|
-
|
|
220
|
+
formUrlEncoded.append('secret', assetPostBodyBody.secret.toString())
|
|
176
221
|
if(assetPostBodyBody.description !== undefined) {
|
|
177
|
-
|
|
222
|
+
formUrlEncoded.append('description', assetPostBodyBody.description)
|
|
178
223
|
}
|
|
179
224
|
|
|
180
225
|
return customInstance<AssetPostResponse>(
|
|
181
226
|
{url: `/asset`, method: 'POST',
|
|
182
|
-
headers: {'Content-Type': '
|
|
183
|
-
data:
|
|
227
|
+
headers: {'Content-Type': 'application/x-www-form-urlencoded', },
|
|
228
|
+
data: formUrlEncoded
|
|
184
229
|
},
|
|
185
230
|
options);
|
|
186
231
|
}
|
|
@@ -190,7 +235,7 @@ if(assetPostBodyBody.description !== undefined) {
|
|
|
190
235
|
export const getCreateAssetMutationOptions = <TError = ErrorType<AsError | void>,
|
|
191
236
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError,{data: AssetPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
192
237
|
): UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError,{data: AssetPostBodyBody}, TContext> => {
|
|
193
|
-
|
|
238
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
194
239
|
|
|
195
240
|
|
|
196
241
|
|
|
@@ -204,7 +249,7 @@ export const getCreateAssetMutationOptions = <TError = ErrorType<AsError | void>
|
|
|
204
249
|
|
|
205
250
|
|
|
206
251
|
|
|
207
|
-
|
|
252
|
+
return { mutationFn, ...mutationOptions }}
|
|
208
253
|
|
|
209
254
|
export type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>
|
|
210
255
|
export type CreateAssetMutationBody = AssetPostBodyBody
|
|
@@ -215,7 +260,12 @@ export const getCreateAssetMutationOptions = <TError = ErrorType<AsError | void>
|
|
|
215
260
|
*/
|
|
216
261
|
export const useCreateAsset = <TError = ErrorType<AsError | void>,
|
|
217
262
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createAsset>>, TError,{data: AssetPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
218
|
-
)
|
|
263
|
+
): UseMutationResult<
|
|
264
|
+
Awaited<ReturnType<typeof createAsset>>,
|
|
265
|
+
TError,
|
|
266
|
+
{data: AssetPostBodyBody},
|
|
267
|
+
TContext
|
|
268
|
+
> => {
|
|
219
269
|
|
|
220
270
|
const mutationOptions = getCreateAssetMutationOptions(options);
|
|
221
271
|
|
|
@@ -265,13 +315,39 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
265
315
|
export type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>
|
|
266
316
|
export type GetSpecificAssetQueryError = ErrorType<AsError | void>
|
|
267
317
|
|
|
318
|
+
|
|
319
|
+
export function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
320
|
+
assetId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> & Pick<
|
|
321
|
+
DefinedInitialDataOptions<
|
|
322
|
+
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
323
|
+
TError,
|
|
324
|
+
TData
|
|
325
|
+
> , 'initialData'
|
|
326
|
+
>, request?: SecondParameter<typeof customInstance>}
|
|
327
|
+
|
|
328
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
329
|
+
export function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
330
|
+
assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> & Pick<
|
|
331
|
+
UndefinedInitialDataOptions<
|
|
332
|
+
Awaited<ReturnType<typeof getSpecificAsset>>,
|
|
333
|
+
TError,
|
|
334
|
+
TData
|
|
335
|
+
> , 'initialData'
|
|
336
|
+
>, request?: SecondParameter<typeof customInstance>}
|
|
337
|
+
|
|
338
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
339
|
+
export function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
340
|
+
assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
341
|
+
|
|
342
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
268
343
|
/**
|
|
269
344
|
* @summary Gets an Asset
|
|
270
345
|
*/
|
|
271
|
-
|
|
346
|
+
|
|
347
|
+
export function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
272
348
|
assetId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
273
349
|
|
|
274
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
350
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
275
351
|
|
|
276
352
|
const queryOptions = getGetSpecificAssetQueryOptions(assetId,options)
|
|
277
353
|
|
|
@@ -305,13 +381,27 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
305
381
|
export type GetSpecificAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>
|
|
306
382
|
export type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>
|
|
307
383
|
|
|
384
|
+
|
|
385
|
+
export function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
386
|
+
assetId: string, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
387
|
+
|
|
388
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
389
|
+
export function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
390
|
+
assetId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
391
|
+
|
|
392
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
393
|
+
export function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
394
|
+
assetId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
395
|
+
|
|
396
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
308
397
|
/**
|
|
309
398
|
* @summary Gets an Asset
|
|
310
399
|
*/
|
|
311
|
-
|
|
400
|
+
|
|
401
|
+
export function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(
|
|
312
402
|
assetId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
313
403
|
|
|
314
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
404
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
315
405
|
|
|
316
406
|
const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId,options)
|
|
317
407
|
|
|
@@ -338,31 +428,31 @@ export const patchAsset = (
|
|
|
338
428
|
assetPatchBodyBody: AssetPatchBodyBody,
|
|
339
429
|
options?: SecondParameter<typeof customInstance>,) => {
|
|
340
430
|
|
|
341
|
-
const
|
|
431
|
+
const formUrlEncoded = new URLSearchParams();
|
|
342
432
|
if(assetPatchBodyBody.content_file !== undefined) {
|
|
343
|
-
|
|
433
|
+
formUrlEncoded.append('content_file', assetPatchBodyBody.content_file)
|
|
344
434
|
}
|
|
345
435
|
if(assetPatchBodyBody.content_string !== undefined) {
|
|
346
|
-
|
|
436
|
+
formUrlEncoded.append('content_string', assetPatchBodyBody.content_string)
|
|
347
437
|
}
|
|
348
438
|
if(assetPatchBodyBody.description !== undefined) {
|
|
349
|
-
|
|
439
|
+
formUrlEncoded.append('description', assetPatchBodyBody.description)
|
|
350
440
|
}
|
|
351
441
|
|
|
352
442
|
return customInstance<void>(
|
|
353
443
|
{url: `/asset/${assetId}`, method: 'PATCH',
|
|
354
|
-
headers: {'Content-Type': '
|
|
355
|
-
data:
|
|
444
|
+
headers: {'Content-Type': 'application/x-www-form-urlencoded', },
|
|
445
|
+
data: formUrlEncoded
|
|
356
446
|
},
|
|
357
447
|
options);
|
|
358
448
|
}
|
|
359
449
|
|
|
360
450
|
|
|
361
451
|
|
|
362
|
-
export const getPatchAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
452
|
+
export const getPatchAssetMutationOptions = <TError = ErrorType<void | AsError>,
|
|
363
453
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchAsset>>, TError,{assetId: string;data: AssetPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
364
454
|
): UseMutationOptions<Awaited<ReturnType<typeof patchAsset>>, TError,{assetId: string;data: AssetPatchBodyBody}, TContext> => {
|
|
365
|
-
|
|
455
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
366
456
|
|
|
367
457
|
|
|
368
458
|
|
|
@@ -376,18 +466,23 @@ export const getPatchAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
|
376
466
|
|
|
377
467
|
|
|
378
468
|
|
|
379
|
-
|
|
469
|
+
return { mutationFn, ...mutationOptions }}
|
|
380
470
|
|
|
381
471
|
export type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>
|
|
382
472
|
export type PatchAssetMutationBody = AssetPatchBodyBody
|
|
383
|
-
export type PatchAssetMutationError = ErrorType<AsError>
|
|
473
|
+
export type PatchAssetMutationError = ErrorType<void | AsError>
|
|
384
474
|
|
|
385
475
|
/**
|
|
386
476
|
* @summary Adjust an existing Asset
|
|
387
477
|
*/
|
|
388
|
-
export const usePatchAsset = <TError = ErrorType<AsError>,
|
|
478
|
+
export const usePatchAsset = <TError = ErrorType<void | AsError>,
|
|
389
479
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchAsset>>, TError,{assetId: string;data: AssetPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
390
|
-
)
|
|
480
|
+
): UseMutationResult<
|
|
481
|
+
Awaited<ReturnType<typeof patchAsset>>,
|
|
482
|
+
TError,
|
|
483
|
+
{assetId: string;data: AssetPatchBodyBody},
|
|
484
|
+
TContext
|
|
485
|
+
> => {
|
|
391
486
|
|
|
392
487
|
const mutationOptions = getPatchAssetMutationOptions(options);
|
|
393
488
|
|
|
@@ -413,10 +508,10 @@ export const deleteAsset = (
|
|
|
413
508
|
|
|
414
509
|
|
|
415
510
|
|
|
416
|
-
export const getDeleteAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
511
|
+
export const getDeleteAssetMutationOptions = <TError = ErrorType<AsError | void>,
|
|
417
512
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
418
513
|
): UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError,{assetId: string}, TContext> => {
|
|
419
|
-
|
|
514
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
420
515
|
|
|
421
516
|
|
|
422
517
|
|
|
@@ -430,18 +525,23 @@ export const getDeleteAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
|
430
525
|
|
|
431
526
|
|
|
432
527
|
|
|
433
|
-
|
|
528
|
+
return { mutationFn, ...mutationOptions }}
|
|
434
529
|
|
|
435
530
|
export type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>
|
|
436
531
|
|
|
437
|
-
export type DeleteAssetMutationError = ErrorType<AsError>
|
|
532
|
+
export type DeleteAssetMutationError = ErrorType<AsError | void>
|
|
438
533
|
|
|
439
534
|
/**
|
|
440
535
|
* @summary Deletes an Asset
|
|
441
536
|
*/
|
|
442
|
-
export const useDeleteAsset = <TError = ErrorType<AsError>,
|
|
537
|
+
export const useDeleteAsset = <TError = ErrorType<AsError | void>,
|
|
443
538
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
444
|
-
)
|
|
539
|
+
): UseMutationResult<
|
|
540
|
+
Awaited<ReturnType<typeof deleteAsset>>,
|
|
541
|
+
TError,
|
|
542
|
+
{assetId: string},
|
|
543
|
+
TContext
|
|
544
|
+
> => {
|
|
445
545
|
|
|
446
546
|
const mutationOptions = getDeleteAssetMutationOptions(options);
|
|
447
547
|
|
|
@@ -467,10 +567,10 @@ export const disableAsset = (
|
|
|
467
567
|
|
|
468
568
|
|
|
469
569
|
|
|
470
|
-
export const getDisableAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
570
|
+
export const getDisableAssetMutationOptions = <TError = ErrorType<AsError | void>,
|
|
471
571
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
472
572
|
): UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError,{assetId: string}, TContext> => {
|
|
473
|
-
|
|
573
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
474
574
|
|
|
475
575
|
|
|
476
576
|
|
|
@@ -484,18 +584,23 @@ export const getDisableAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
|
484
584
|
|
|
485
585
|
|
|
486
586
|
|
|
487
|
-
|
|
587
|
+
return { mutationFn, ...mutationOptions }}
|
|
488
588
|
|
|
489
589
|
export type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>
|
|
490
590
|
|
|
491
|
-
export type DisableAssetMutationError = ErrorType<AsError>
|
|
591
|
+
export type DisableAssetMutationError = ErrorType<AsError | void>
|
|
492
592
|
|
|
493
593
|
/**
|
|
494
594
|
* @summary Disables an Asset
|
|
495
595
|
*/
|
|
496
|
-
export const useDisableAsset = <TError = ErrorType<AsError>,
|
|
596
|
+
export const useDisableAsset = <TError = ErrorType<AsError | void>,
|
|
497
597
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof disableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
498
|
-
)
|
|
598
|
+
): UseMutationResult<
|
|
599
|
+
Awaited<ReturnType<typeof disableAsset>>,
|
|
600
|
+
TError,
|
|
601
|
+
{assetId: string},
|
|
602
|
+
TContext
|
|
603
|
+
> => {
|
|
499
604
|
|
|
500
605
|
const mutationOptions = getDisableAssetMutationOptions(options);
|
|
501
606
|
|
|
@@ -521,10 +626,10 @@ export const enableAsset = (
|
|
|
521
626
|
|
|
522
627
|
|
|
523
628
|
|
|
524
|
-
export const getEnableAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
629
|
+
export const getEnableAssetMutationOptions = <TError = ErrorType<AsError | void>,
|
|
525
630
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
526
631
|
): UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError,{assetId: string}, TContext> => {
|
|
527
|
-
|
|
632
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
528
633
|
|
|
529
634
|
|
|
530
635
|
|
|
@@ -538,18 +643,23 @@ export const getEnableAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
|
538
643
|
|
|
539
644
|
|
|
540
645
|
|
|
541
|
-
|
|
646
|
+
return { mutationFn, ...mutationOptions }}
|
|
542
647
|
|
|
543
648
|
export type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>
|
|
544
649
|
|
|
545
|
-
export type EnableAssetMutationError = ErrorType<AsError>
|
|
650
|
+
export type EnableAssetMutationError = ErrorType<AsError | void>
|
|
546
651
|
|
|
547
652
|
/**
|
|
548
653
|
* @summary Enables an Asset
|
|
549
654
|
*/
|
|
550
|
-
export const useEnableAsset = <TError = ErrorType<AsError>,
|
|
655
|
+
export const useEnableAsset = <TError = ErrorType<AsError | void>,
|
|
551
656
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof enableAsset>>, TError,{assetId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
552
|
-
)
|
|
657
|
+
): UseMutationResult<
|
|
658
|
+
Awaited<ReturnType<typeof enableAsset>>,
|
|
659
|
+
TError,
|
|
660
|
+
{assetId: string},
|
|
661
|
+
TContext
|
|
662
|
+
> => {
|
|
553
663
|
|
|
554
664
|
const mutationOptions = getEnableAssetMutationOptions(options);
|
|
555
665
|
|
|
@@ -577,10 +687,10 @@ export const attachAsset = (
|
|
|
577
687
|
|
|
578
688
|
|
|
579
689
|
|
|
580
|
-
export const getAttachAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
690
|
+
export const getAttachAssetMutationOptions = <TError = ErrorType<AsError | void>,
|
|
581
691
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError,{assetId: string;params?: AttachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
582
692
|
): UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError,{assetId: string;params?: AttachAssetParams}, TContext> => {
|
|
583
|
-
|
|
693
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
584
694
|
|
|
585
695
|
|
|
586
696
|
|
|
@@ -594,18 +704,23 @@ export const getAttachAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
|
594
704
|
|
|
595
705
|
|
|
596
706
|
|
|
597
|
-
|
|
707
|
+
return { mutationFn, ...mutationOptions }}
|
|
598
708
|
|
|
599
709
|
export type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>
|
|
600
710
|
|
|
601
|
-
export type AttachAssetMutationError = ErrorType<AsError>
|
|
711
|
+
export type AttachAssetMutationError = ErrorType<AsError | void>
|
|
602
712
|
|
|
603
713
|
/**
|
|
604
714
|
* @summary Attaches an Asset to a Merchant
|
|
605
715
|
*/
|
|
606
|
-
export const useAttachAsset = <TError = ErrorType<AsError>,
|
|
716
|
+
export const useAttachAsset = <TError = ErrorType<AsError | void>,
|
|
607
717
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof attachAsset>>, TError,{assetId: string;params?: AttachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
608
|
-
)
|
|
718
|
+
): UseMutationResult<
|
|
719
|
+
Awaited<ReturnType<typeof attachAsset>>,
|
|
720
|
+
TError,
|
|
721
|
+
{assetId: string;params?: AttachAssetParams},
|
|
722
|
+
TContext
|
|
723
|
+
> => {
|
|
609
724
|
|
|
610
725
|
const mutationOptions = getAttachAssetMutationOptions(options);
|
|
611
726
|
|
|
@@ -633,10 +748,10 @@ export const detachAsset = (
|
|
|
633
748
|
|
|
634
749
|
|
|
635
750
|
|
|
636
|
-
export const getDetachAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
751
|
+
export const getDetachAssetMutationOptions = <TError = ErrorType<AsError | void>,
|
|
637
752
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError,{assetId: string;params?: DetachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
638
753
|
): UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError,{assetId: string;params?: DetachAssetParams}, TContext> => {
|
|
639
|
-
|
|
754
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
640
755
|
|
|
641
756
|
|
|
642
757
|
|
|
@@ -650,18 +765,23 @@ export const getDetachAssetMutationOptions = <TError = ErrorType<AsError>,
|
|
|
650
765
|
|
|
651
766
|
|
|
652
767
|
|
|
653
|
-
|
|
768
|
+
return { mutationFn, ...mutationOptions }}
|
|
654
769
|
|
|
655
770
|
export type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>
|
|
656
771
|
|
|
657
|
-
export type DetachAssetMutationError = ErrorType<AsError>
|
|
772
|
+
export type DetachAssetMutationError = ErrorType<AsError | void>
|
|
658
773
|
|
|
659
774
|
/**
|
|
660
775
|
* @summary Detaches an Asset from a Merchant
|
|
661
776
|
*/
|
|
662
|
-
export const useDetachAsset = <TError = ErrorType<AsError>,
|
|
777
|
+
export const useDetachAsset = <TError = ErrorType<AsError | void>,
|
|
663
778
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof detachAsset>>, TError,{assetId: string;params?: DetachAssetParams}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
664
|
-
)
|
|
779
|
+
): UseMutationResult<
|
|
780
|
+
Awaited<ReturnType<typeof detachAsset>>,
|
|
781
|
+
TError,
|
|
782
|
+
{assetId: string;params?: DetachAssetParams},
|
|
783
|
+
TContext
|
|
784
|
+
> => {
|
|
665
785
|
|
|
666
786
|
const mutationOptions = getDetachAssetMutationOptions(options);
|
|
667
787
|
|