@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
|
@@ -50,9 +50,9 @@ const getGetAssetQueryOptions = (params, options) => {
|
|
|
50
50
|
/**
|
|
51
51
|
* @summary Gets Assets
|
|
52
52
|
*/
|
|
53
|
-
function useGetAsset(params, options) {
|
|
53
|
+
function useGetAsset(params, options, queryClient) {
|
|
54
54
|
const queryOptions = getGetAssetQueryOptions(params, options);
|
|
55
|
-
const query = (0, __tanstack_react_query.useQuery)(queryOptions);
|
|
55
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
56
56
|
query.queryKey = queryOptions.queryKey;
|
|
57
57
|
return query;
|
|
58
58
|
}
|
|
@@ -79,9 +79,9 @@ const getGetAssetSuspenseQueryOptions = (params, options) => {
|
|
|
79
79
|
/**
|
|
80
80
|
* @summary Gets Assets
|
|
81
81
|
*/
|
|
82
|
-
function useGetAssetSuspense(params, options) {
|
|
82
|
+
function useGetAssetSuspense(params, options, queryClient) {
|
|
83
83
|
const queryOptions = getGetAssetSuspenseQueryOptions(params, options);
|
|
84
|
-
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions);
|
|
84
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
85
85
|
query.queryKey = queryOptions.queryKey;
|
|
86
86
|
return query;
|
|
87
87
|
}
|
|
@@ -127,8 +127,8 @@ const getCreateAssetMutationOptions = (options) => {
|
|
|
127
127
|
/**
|
|
128
128
|
* @summary Create an Asset
|
|
129
129
|
*/
|
|
130
|
-
const useCreateAsset = (options) => {
|
|
131
|
-
return (0, __tanstack_react_query.useMutation)(getCreateAssetMutationOptions(options));
|
|
130
|
+
const useCreateAsset = (options, queryClient) => {
|
|
131
|
+
return (0, __tanstack_react_query.useMutation)(getCreateAssetMutationOptions(options), queryClient);
|
|
132
132
|
};
|
|
133
133
|
const getGetSpecificAssetUrl = (assetId) => {
|
|
134
134
|
return `/asset/${assetId}`;
|
|
@@ -163,9 +163,9 @@ const getGetSpecificAssetQueryOptions = (assetId, options) => {
|
|
|
163
163
|
/**
|
|
164
164
|
* @summary Gets an Asset
|
|
165
165
|
*/
|
|
166
|
-
function useGetSpecificAsset(assetId, options) {
|
|
166
|
+
function useGetSpecificAsset(assetId, options, queryClient) {
|
|
167
167
|
const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);
|
|
168
|
-
const query = (0, __tanstack_react_query.useQuery)(queryOptions);
|
|
168
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions, queryClient);
|
|
169
169
|
query.queryKey = queryOptions.queryKey;
|
|
170
170
|
return query;
|
|
171
171
|
}
|
|
@@ -192,9 +192,9 @@ const getGetSpecificAssetSuspenseQueryOptions = (assetId, options) => {
|
|
|
192
192
|
/**
|
|
193
193
|
* @summary Gets an Asset
|
|
194
194
|
*/
|
|
195
|
-
function useGetSpecificAssetSuspense(assetId, options) {
|
|
195
|
+
function useGetSpecificAssetSuspense(assetId, options, queryClient) {
|
|
196
196
|
const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);
|
|
197
|
-
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions);
|
|
197
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions, queryClient);
|
|
198
198
|
query.queryKey = queryOptions.queryKey;
|
|
199
199
|
return query;
|
|
200
200
|
}
|
|
@@ -236,8 +236,8 @@ const getPatchAssetMutationOptions = (options) => {
|
|
|
236
236
|
/**
|
|
237
237
|
* @summary Adjust an existing Asset
|
|
238
238
|
*/
|
|
239
|
-
const usePatchAsset = (options) => {
|
|
240
|
-
return (0, __tanstack_react_query.useMutation)(getPatchAssetMutationOptions(options));
|
|
239
|
+
const usePatchAsset = (options, queryClient) => {
|
|
240
|
+
return (0, __tanstack_react_query.useMutation)(getPatchAssetMutationOptions(options), queryClient);
|
|
241
241
|
};
|
|
242
242
|
const getDeleteAssetUrl = (assetId) => {
|
|
243
243
|
return `/asset/${assetId}`;
|
|
@@ -272,8 +272,8 @@ const getDeleteAssetMutationOptions = (options) => {
|
|
|
272
272
|
/**
|
|
273
273
|
* @summary Deletes an Asset
|
|
274
274
|
*/
|
|
275
|
-
const useDeleteAsset = (options) => {
|
|
276
|
-
return (0, __tanstack_react_query.useMutation)(getDeleteAssetMutationOptions(options));
|
|
275
|
+
const useDeleteAsset = (options, queryClient) => {
|
|
276
|
+
return (0, __tanstack_react_query.useMutation)(getDeleteAssetMutationOptions(options), queryClient);
|
|
277
277
|
};
|
|
278
278
|
const getDisableAssetUrl = (assetId) => {
|
|
279
279
|
return `/asset/${assetId}/disable`;
|
|
@@ -308,8 +308,8 @@ const getDisableAssetMutationOptions = (options) => {
|
|
|
308
308
|
/**
|
|
309
309
|
* @summary Disables an Asset
|
|
310
310
|
*/
|
|
311
|
-
const useDisableAsset = (options) => {
|
|
312
|
-
return (0, __tanstack_react_query.useMutation)(getDisableAssetMutationOptions(options));
|
|
311
|
+
const useDisableAsset = (options, queryClient) => {
|
|
312
|
+
return (0, __tanstack_react_query.useMutation)(getDisableAssetMutationOptions(options), queryClient);
|
|
313
313
|
};
|
|
314
314
|
const getEnableAssetUrl = (assetId) => {
|
|
315
315
|
return `/asset/${assetId}/enable`;
|
|
@@ -344,8 +344,8 @@ const getEnableAssetMutationOptions = (options) => {
|
|
|
344
344
|
/**
|
|
345
345
|
* @summary Enables an Asset
|
|
346
346
|
*/
|
|
347
|
-
const useEnableAsset = (options) => {
|
|
348
|
-
return (0, __tanstack_react_query.useMutation)(getEnableAssetMutationOptions(options));
|
|
347
|
+
const useEnableAsset = (options, queryClient) => {
|
|
348
|
+
return (0, __tanstack_react_query.useMutation)(getEnableAssetMutationOptions(options), queryClient);
|
|
349
349
|
};
|
|
350
350
|
const getAttachAssetUrl = (assetId, params) => {
|
|
351
351
|
const normalizedParams = new URLSearchParams();
|
|
@@ -385,8 +385,8 @@ const getAttachAssetMutationOptions = (options) => {
|
|
|
385
385
|
/**
|
|
386
386
|
* @summary Attaches an Asset to a Merchant
|
|
387
387
|
*/
|
|
388
|
-
const useAttachAsset = (options) => {
|
|
389
|
-
return (0, __tanstack_react_query.useMutation)(getAttachAssetMutationOptions(options));
|
|
388
|
+
const useAttachAsset = (options, queryClient) => {
|
|
389
|
+
return (0, __tanstack_react_query.useMutation)(getAttachAssetMutationOptions(options), queryClient);
|
|
390
390
|
};
|
|
391
391
|
const getDetachAssetUrl = (assetId, params) => {
|
|
392
392
|
const normalizedParams = new URLSearchParams();
|
|
@@ -426,8 +426,8 @@ const getDetachAssetMutationOptions = (options) => {
|
|
|
426
426
|
/**
|
|
427
427
|
* @summary Detaches an Asset from a Merchant
|
|
428
428
|
*/
|
|
429
|
-
const useDetachAsset = (options) => {
|
|
430
|
-
return (0, __tanstack_react_query.useMutation)(getDetachAssetMutationOptions(options));
|
|
429
|
+
const useDetachAsset = (options, queryClient) => {
|
|
430
|
+
return (0, __tanstack_react_query.useMutation)(getDetachAssetMutationOptions(options), queryClient);
|
|
431
431
|
};
|
|
432
432
|
|
|
433
433
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.fetch.cjs","names":["customFetch","queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n >"],"sources":["../../../src/api/asset/asset.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n AssetDetail,\n AssetGetResponse,\n AssetPatchBodyBody,\n AssetPostBodyBody,\n AssetPostResponse,\n AttachAssetParams,\n DetachAssetParams,\n GetAssetParams,\n} from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Assets you have access to.\n\n * @summary Gets Assets\n */\nexport type getAssetResponse201 = { data: AssetGetResponse; status: 201 };\n\nexport type getAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getAssetResponse401 = { data: void; status: 401 };\n\nexport type getAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getAssetResponseSuccess = getAssetResponse201 & { headers: Headers };\nexport type getAssetResponseError = (\n | getAssetResponse400\n | getAssetResponse401\n | getAssetResponse403\n) & { headers: Headers };\n\nexport type getAssetResponse = getAssetResponseSuccess | getAssetResponseError;\n\nexport const getGetAssetUrl = (params?: GetAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/asset?${stringifiedParams}` : `/asset`;\n};\n\nexport const getAsset = async (\n params?: GetAssetParams,\n options?: RequestInit,\n): Promise<getAssetResponse> => {\n return customFetch<getAssetResponse>(getGetAssetUrl(params), { ...options, method: \"GET\" });\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => {\n return [\"account-server\", \"asset\", ...(params ? [params] : [])] as const;\n};\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\n/**\n * @summary Gets Assets\n */\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets Assets\n */\nexport const invalidateGetAsset = async (\n queryClient: QueryClient,\n params?: GetAssetParams,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAssetQueryKey(params) }, options);\n\n return queryClient;\n};\n\nexport const getGetAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetSuspenseQueryError = ErrorType<AsError | void>;\n\n/**\n * @summary Gets Assets\n */\n\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\nAssets are text and file resources that can be requested by **Merchants**. The Data Manager **Merchant** uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nAssets must be *enabled* before they can be used.\n\nThey must also be *attached* to a **Merchant** before the **Merchant** can ue them. Assets are only available to merchants if they are enabled and attached.\n\n * @summary Create an Asset\n */\nexport type createAssetResponse201 = { data: AssetPostResponse; status: 201 };\n\nexport type createAssetResponse400 = { data: AsError; status: 400 };\n\nexport type createAssetResponse401 = { data: void; status: 401 };\n\nexport type createAssetResponse403 = { data: AsError; status: 403 };\n\nexport type createAssetResponseSuccess = createAssetResponse201 & { headers: Headers };\nexport type createAssetResponseError = (\n | createAssetResponse400\n | createAssetResponse401\n | createAssetResponse403\n) & { headers: Headers };\n\nexport type createAssetResponse = createAssetResponseSuccess | createAssetResponseError;\n\nexport const getCreateAssetUrl = () => {\n return `/asset`;\n};\n\nexport const createAsset = async (\n assetPostBodyBody: AssetPostBodyBody,\n options?: RequestInit,\n): Promise<createAssetResponse> => {\n const formData = new FormData();\n formData.append(`name`, assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPostBodyBody.content_string);\n }\n formData.append(`scope`, assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(`scope_id`, assetPostBodyBody.scope_id);\n }\n formData.append(`secret`, assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(`description`, assetPostBodyBody.description);\n }\n\n return customFetch<createAssetResponse>(getCreateAssetUrl(), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create an Asset\n */\nexport const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationOptions = getCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets a known Asset\n\n * @summary Gets an Asset\n */\nexport type getSpecificAssetResponse201 = { data: AssetDetail; status: 201 };\n\nexport type getSpecificAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getSpecificAssetResponse401 = { data: void; status: 401 };\n\nexport type getSpecificAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getSpecificAssetResponseSuccess = getSpecificAssetResponse201 & { headers: Headers };\nexport type getSpecificAssetResponseError = (\n | getSpecificAssetResponse400\n | getSpecificAssetResponse401\n | getSpecificAssetResponse403\n) & { headers: Headers };\n\nexport type getSpecificAssetResponse =\n | getSpecificAssetResponseSuccess\n | getSpecificAssetResponseError;\n\nexport const getGetSpecificAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\nexport const getSpecificAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<getSpecificAssetResponse> => {\n return customFetch<getSpecificAssetResponse>(getGetSpecificAssetUrl(assetId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetSpecificAssetQueryKey = (assetId?: string) => {\n return [\"account-server\", \"asset\", assetId] as const;\n};\n\nexport const getGetSpecificAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!assetId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;\nexport type GetSpecificAssetQueryError = ErrorType<AsError | void>;\n\n/**\n * @summary Gets an Asset\n */\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets an Asset\n */\nexport const invalidateGetSpecificAsset = async (\n queryClient: QueryClient,\n assetId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetSpecificAssetQueryKey(assetId) }, options);\n\n return queryClient;\n};\n\nexport const getGetSpecificAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetSpecificAssetSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSpecificAsset>>\n>;\nexport type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;\n\n/**\n * @summary Gets an Asset\n */\n\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>;\n request?: SecondParameter<typeof customFetch>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Adjust an existing Asset\n */\nexport type patchAssetResponse200 = { data: void; status: 200 };\n\nexport type patchAssetResponse401 = { data: void; status: 401 };\n\nexport type patchAssetResponse403 = { data: AsError; status: 403 };\n\nexport type patchAssetResponse404 = { data: AsError; status: 404 };\n\nexport type patchAssetResponseSuccess = patchAssetResponse200 & { headers: Headers };\nexport type patchAssetResponseError = (\n | patchAssetResponse401\n | patchAssetResponse403\n | patchAssetResponse404\n) & { headers: Headers };\n\nexport type patchAssetResponse = patchAssetResponseSuccess | patchAssetResponseError;\n\nexport const getPatchAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\nexport const patchAsset = async (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: RequestInit,\n): Promise<patchAssetResponse> => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(`description`, assetPatchBodyBody.description);\n }\n\n return customFetch<patchAssetResponse>(getPatchAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n body: formData,\n });\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Asset\n */\nexport const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationOptions = getPatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Deletes an Asset\n */\nexport type deleteAssetResponse204 = { data: void; status: 204 };\n\nexport type deleteAssetResponse400 = { data: AsError; status: 400 };\n\nexport type deleteAssetResponse401 = { data: void; status: 401 };\n\nexport type deleteAssetResponse403 = { data: AsError; status: 403 };\n\nexport type deleteAssetResponseSuccess = deleteAssetResponse204 & { headers: Headers };\nexport type deleteAssetResponseError = (\n | deleteAssetResponse400\n | deleteAssetResponse401\n | deleteAssetResponse403\n) & { headers: Headers };\n\nexport type deleteAssetResponse = deleteAssetResponseSuccess | deleteAssetResponseError;\n\nexport const getDeleteAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\nexport const deleteAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<deleteAssetResponse> => {\n return customFetch<deleteAssetResponse>(getDeleteAssetUrl(assetId), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"deleteAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Asset\n */\nexport const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = getDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Disables a known Asset\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Disables an Asset\n */\nexport type disableAssetResponse204 = { data: void; status: 204 };\n\nexport type disableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type disableAssetResponse401 = { data: void; status: 401 };\n\nexport type disableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type disableAssetResponseSuccess = disableAssetResponse204 & { headers: Headers };\nexport type disableAssetResponseError = (\n | disableAssetResponse400\n | disableAssetResponse401\n | disableAssetResponse403\n) & { headers: Headers };\n\nexport type disableAssetResponse = disableAssetResponseSuccess | disableAssetResponseError;\n\nexport const getDisableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/disable`;\n};\n\nexport const disableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<disableAssetResponse> => {\n return customFetch<disableAssetResponse>(getDisableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"disableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;\n\nexport type DisableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Disables an Asset\n */\nexport const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = getDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Enables a known Asset\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Enables an Asset\n */\nexport type enableAssetResponse204 = { data: void; status: 204 };\n\nexport type enableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type enableAssetResponse401 = { data: void; status: 401 };\n\nexport type enableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type enableAssetResponseSuccess = enableAssetResponse204 & { headers: Headers };\nexport type enableAssetResponseError = (\n | enableAssetResponse400\n | enableAssetResponse401\n | enableAssetResponse403\n) & { headers: Headers };\n\nexport type enableAssetResponse = enableAssetResponseSuccess | enableAssetResponseError;\n\nexport const getEnableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/enable`;\n};\n\nexport const enableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<enableAssetResponse> => {\n return customFetch<enableAssetResponse>(getEnableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"enableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;\n\nexport type EnableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Enables an Asset\n */\nexport const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = getEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport type attachAssetResponse204 = { data: void; status: 204 };\n\nexport type attachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type attachAssetResponse401 = { data: void; status: 401 };\n\nexport type attachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type attachAssetResponseSuccess = attachAssetResponse204 & { headers: Headers };\nexport type attachAssetResponseError = (\n | attachAssetResponse400\n | attachAssetResponse401\n | attachAssetResponse403\n) & { headers: Headers };\n\nexport type attachAssetResponse = attachAssetResponseSuccess | attachAssetResponseError;\n\nexport const getAttachAssetUrl = (assetId: string, params?: AttachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/attach?${stringifiedParams}`\n : `/asset/${assetId}/attach`;\n};\n\nexport const attachAsset = async (\n assetId: string,\n params?: AttachAssetParams,\n options?: RequestInit,\n): Promise<attachAssetResponse> => {\n return customFetch<attachAssetResponse>(getAttachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationKey = [\"attachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;\n\nexport type AttachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Attaches an Asset to a Merchant\n */\nexport const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationOptions = getAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Detaches an Asset from a Merchant\n */\nexport type detachAssetResponse204 = { data: void; status: 204 };\n\nexport type detachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type detachAssetResponse401 = { data: void; status: 401 };\n\nexport type detachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type detachAssetResponseSuccess = detachAssetResponse204 & { headers: Headers };\nexport type detachAssetResponseError = (\n | detachAssetResponse400\n | detachAssetResponse401\n | detachAssetResponse403\n) & { headers: Headers };\n\nexport type detachAssetResponse = detachAssetResponseSuccess | detachAssetResponseError;\n\nexport const getDetachAssetUrl = (assetId: string, params?: DetachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/detach?${stringifiedParams}`\n : `/asset/${assetId}/detach`;\n};\n\nexport const detachAsset = async (\n assetId: string,\n params?: DetachAssetParams,\n options?: RequestInit,\n): Promise<detachAssetResponse> => {\n return customFetch<detachAssetResponse>(getDetachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationKey = [\"detachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;\n\nexport type DetachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Detaches an Asset from a Merchant\n */\nexport const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationOptions = getDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAgEA,MAAa,kBAAkB,WAA4B;CACzD,MAAM,mBAAmB,IAAI,iBAAiB;AAE9C,QAAO,QAAQ,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;AACrD,MAAI,UAAU,OACZ,kBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,MAAM,UAAU,CAAC;GAE1E;CAEF,MAAM,oBAAoB,iBAAiB,UAAU;AAErD,QAAO,kBAAkB,SAAS,IAAI,UAAU,sBAAsB;;AAGxE,MAAa,WAAW,OACtB,QACA,YAC8B;AAC9B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AAU,OAAO,SAAS,MAAM,UAAU,CAAC;GAE1E;CAEF,MAAM,oBAAoB,iBAAiB,UAAU;AAErD,QAAO,kBAAkB,SAAS,IAC9B,UAAU,QAAQ,UAAU,sBAC5B,UAAU,QAAQ;;AAGxB,MAAa,cAAc,OACzB,SACA,QACA,YACiC;AACjC,QAAOR,iCAAiC,kBAAkB,SAAS,OAAO,EAAE;EAC1E,GAAG;EACH,QAAQ;EACT,CAAC;;AAGJ,MAAa,iCAGX,YAaG;CACH,MAAM,cAAc,CAAC,cAAc;CACnC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMS,cAGD,UAAU;EACb,MAAM,EAAE,SAAS,WAAW,SAAS,EAAE;AAEvC,SAAO,YAAY,SAAS,QAAQ,eAAe;;AAGrD,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAU3C,MAAa,kBAA0E,YAalF;AAGH,gDAFwB,8BAA8B,QAAQ,CAE3B"}
|
|
1
|
+
{"version":3,"file":"asset.fetch.cjs","names":["customFetch","queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n >"],"sources":["../../../src/api/asset/asset.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n AssetDetail,\n AssetGetResponse,\n AssetPatchBodyBody,\n AssetPostBodyBody,\n AssetPostResponse,\n AttachAssetParams,\n DetachAssetParams,\n GetAssetParams,\n} from \".././api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets Assets you have access to.\n\n * @summary Gets Assets\n */\nexport type getAssetResponse201 = { data: AssetGetResponse; status: 201 };\n\nexport type getAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getAssetResponse401 = { data: void; status: 401 };\n\nexport type getAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getAssetResponseSuccess = getAssetResponse201 & { headers: Headers };\nexport type getAssetResponseError = (\n | getAssetResponse400\n | getAssetResponse401\n | getAssetResponse403\n) & { headers: Headers };\n\nexport type getAssetResponse = getAssetResponseSuccess | getAssetResponseError;\n\nexport const getGetAssetUrl = (params?: GetAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/asset?${stringifiedParams}` : `/asset`;\n};\n\nexport const getAsset = async (\n params?: GetAssetParams,\n options?: RequestInit,\n): Promise<getAssetResponse> => {\n return customFetch<getAssetResponse>(getGetAssetUrl(params), { ...options, method: \"GET\" });\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => {\n return [\"account-server\", \"asset\", ...(params ? [params] : [])] as const;\n};\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params: undefined | GetAssetParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n Awaited<ReturnType<typeof getAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n Awaited<ReturnType<typeof getAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets Assets\n */\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets Assets\n */\nexport const invalidateGetAsset = async (\n queryClient: QueryClient,\n params?: GetAssetParams,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAssetQueryKey(params) }, options);\n\n return queryClient;\n};\n\nexport const getGetAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params: undefined | GetAssetParams,\n options: {\n query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets Assets\n */\n\nexport function useGetAssetSuspense<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n\nAssets are text and file resources that can be requested by **Merchants**. The Data Manager **Merchant** uses assets to provide additional information that's often sensitive to **Job** (and **Application**) **Instances**.\n\nAssets must be *enabled* before they can be used.\n\nThey must also be *attached* to a **Merchant** before the **Merchant** can ue them. Assets are only available to merchants if they are enabled and attached.\n\n * @summary Create an Asset\n */\nexport type createAssetResponse201 = { data: AssetPostResponse; status: 201 };\n\nexport type createAssetResponse400 = { data: AsError; status: 400 };\n\nexport type createAssetResponse401 = { data: void; status: 401 };\n\nexport type createAssetResponse403 = { data: AsError; status: 403 };\n\nexport type createAssetResponseSuccess = createAssetResponse201 & { headers: Headers };\nexport type createAssetResponseError = (\n | createAssetResponse400\n | createAssetResponse401\n | createAssetResponse403\n) & { headers: Headers };\n\nexport type createAssetResponse = createAssetResponseSuccess | createAssetResponseError;\n\nexport const getCreateAssetUrl = () => {\n return `/asset`;\n};\n\nexport const createAsset = async (\n assetPostBodyBody: AssetPostBodyBody,\n options?: RequestInit,\n): Promise<createAssetResponse> => {\n const formData = new FormData();\n formData.append(`name`, assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPostBodyBody.content_string);\n }\n formData.append(`scope`, assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(`scope_id`, assetPostBodyBody.scope_id);\n }\n formData.append(`secret`, assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(`description`, assetPostBodyBody.description);\n }\n\n return customFetch<createAssetResponse>(getCreateAssetUrl(), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create an Asset\n */\nexport const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationOptions = getCreateAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Gets a known Asset\n\n * @summary Gets an Asset\n */\nexport type getSpecificAssetResponse201 = { data: AssetDetail; status: 201 };\n\nexport type getSpecificAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getSpecificAssetResponse401 = { data: void; status: 401 };\n\nexport type getSpecificAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getSpecificAssetResponseSuccess = getSpecificAssetResponse201 & { headers: Headers };\nexport type getSpecificAssetResponseError = (\n | getSpecificAssetResponse400\n | getSpecificAssetResponse401\n | getSpecificAssetResponse403\n) & { headers: Headers };\n\nexport type getSpecificAssetResponse =\n | getSpecificAssetResponseSuccess\n | getSpecificAssetResponseError;\n\nexport const getGetSpecificAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\nexport const getSpecificAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<getSpecificAssetResponse> => {\n return customFetch<getSpecificAssetResponse>(getGetSpecificAssetUrl(assetId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetSpecificAssetQueryKey = (assetId?: string) => {\n return [\"account-server\", \"asset\", assetId] as const;\n};\n\nexport const getGetSpecificAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, enabled: !!assetId, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;\nexport type GetSpecificAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n Awaited<ReturnType<typeof getSpecificAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n Awaited<ReturnType<typeof getSpecificAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets an Asset\n */\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * @summary Gets an Asset\n */\nexport const invalidateGetSpecificAsset = async (\n queryClient: QueryClient,\n assetId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetSpecificAssetQueryKey(assetId) }, options);\n\n return queryClient;\n};\n\nexport const getGetSpecificAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData> };\n};\n\nexport type GetSpecificAssetSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getSpecificAsset>>\n>;\nexport type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;\n\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };\n/**\n * @summary Gets an Asset\n */\n\nexport function useGetSpecificAssetSuspense<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {\n const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Used to update or replace Asset *Content* or *Description*.\n\nThe content of an Asset currently in use will not be affected by a change made here. If a **Merchant** has already obtained the Asset it may continue to use the original value until the **Merchant** requests the **Asset** again.\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Adjust an existing Asset\n */\nexport type patchAssetResponse200 = { data: void; status: 200 };\n\nexport type patchAssetResponse401 = { data: void; status: 401 };\n\nexport type patchAssetResponse403 = { data: AsError; status: 403 };\n\nexport type patchAssetResponse404 = { data: AsError; status: 404 };\n\nexport type patchAssetResponseSuccess = patchAssetResponse200 & { headers: Headers };\nexport type patchAssetResponseError = (\n | patchAssetResponse401\n | patchAssetResponse403\n | patchAssetResponse404\n) & { headers: Headers };\n\nexport type patchAssetResponse = patchAssetResponseSuccess | patchAssetResponseError;\n\nexport const getPatchAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\nexport const patchAsset = async (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: RequestInit,\n): Promise<patchAssetResponse> => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(`description`, assetPatchBodyBody.description);\n }\n\n return customFetch<patchAssetResponse>(getPatchAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n body: formData,\n });\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Asset\n */\nexport const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationOptions = getPatchAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Deletes an Asset\n */\nexport type deleteAssetResponse204 = { data: void; status: 204 };\n\nexport type deleteAssetResponse400 = { data: AsError; status: 400 };\n\nexport type deleteAssetResponse401 = { data: void; status: 401 };\n\nexport type deleteAssetResponse403 = { data: AsError; status: 403 };\n\nexport type deleteAssetResponseSuccess = deleteAssetResponse204 & { headers: Headers };\nexport type deleteAssetResponseError = (\n | deleteAssetResponse400\n | deleteAssetResponse401\n | deleteAssetResponse403\n) & { headers: Headers };\n\nexport type deleteAssetResponse = deleteAssetResponseSuccess | deleteAssetResponseError;\n\nexport const getDeleteAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\nexport const deleteAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<deleteAssetResponse> => {\n return customFetch<deleteAssetResponse>(getDeleteAssetUrl(assetId), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"deleteAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Asset\n */\nexport const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = getDeleteAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Disables a known Asset\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Disables an Asset\n */\nexport type disableAssetResponse204 = { data: void; status: 204 };\n\nexport type disableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type disableAssetResponse401 = { data: void; status: 401 };\n\nexport type disableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type disableAssetResponseSuccess = disableAssetResponse204 & { headers: Headers };\nexport type disableAssetResponseError = (\n | disableAssetResponse400\n | disableAssetResponse401\n | disableAssetResponse403\n) & { headers: Headers };\n\nexport type disableAssetResponse = disableAssetResponseSuccess | disableAssetResponseError;\n\nexport const getDisableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/disable`;\n};\n\nexport const disableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<disableAssetResponse> => {\n return customFetch<disableAssetResponse>(getDisableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"disableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;\n\nexport type DisableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Disables an Asset\n */\nexport const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = getDisableAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Enables a known Asset\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Enables an Asset\n */\nexport type enableAssetResponse204 = { data: void; status: 204 };\n\nexport type enableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type enableAssetResponse401 = { data: void; status: 401 };\n\nexport type enableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type enableAssetResponseSuccess = enableAssetResponse204 & { headers: Headers };\nexport type enableAssetResponseError = (\n | enableAssetResponse400\n | enableAssetResponse401\n | enableAssetResponse403\n) & { headers: Headers };\n\nexport type enableAssetResponse = enableAssetResponseSuccess | enableAssetResponseError;\n\nexport const getEnableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/enable`;\n};\n\nexport const enableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<enableAssetResponse> => {\n return customFetch<enableAssetResponse>(getEnableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"enableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;\n\nexport type EnableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Enables an Asset\n */\nexport const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationOptions = getEnableAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Attaches an Asset to a Merchant\n */\nexport type attachAssetResponse204 = { data: void; status: 204 };\n\nexport type attachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type attachAssetResponse401 = { data: void; status: 401 };\n\nexport type attachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type attachAssetResponseSuccess = attachAssetResponse204 & { headers: Headers };\nexport type attachAssetResponseError = (\n | attachAssetResponse400\n | attachAssetResponse401\n | attachAssetResponse403\n) & { headers: Headers };\n\nexport type attachAssetResponse = attachAssetResponseSuccess | attachAssetResponseError;\n\nexport const getAttachAssetUrl = (assetId: string, params?: AttachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/attach?${stringifiedParams}`\n : `/asset/${assetId}/attach`;\n};\n\nexport const attachAsset = async (\n assetId: string,\n params?: AttachAssetParams,\n options?: RequestInit,\n): Promise<attachAssetResponse> => {\n return customFetch<attachAssetResponse>(getAttachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationKey = [\"attachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;\n\nexport type AttachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Attaches an Asset to a Merchant\n */\nexport const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationOptions = getAttachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Detaches an Asset from a **Merchant**\n\nAnyone can alter a `GLOBAL` asset. For other *scopes* you will need to be the user for `USER` scoped assets, a member of the **Unit** for `UNIT` and `PRODUCT` scoped assets, or a member of the **Organisation** for `ORGANISATION` scoped assets. Administrators can patch any asset.\n\n * @summary Detaches an Asset from a Merchant\n */\nexport type detachAssetResponse204 = { data: void; status: 204 };\n\nexport type detachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type detachAssetResponse401 = { data: void; status: 401 };\n\nexport type detachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type detachAssetResponseSuccess = detachAssetResponse204 & { headers: Headers };\nexport type detachAssetResponseError = (\n | detachAssetResponse400\n | detachAssetResponse401\n | detachAssetResponse403\n) & { headers: Headers };\n\nexport type detachAssetResponse = detachAssetResponseSuccess | detachAssetResponseError;\n\nexport const getDetachAssetUrl = (assetId: string, params?: DetachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : value.toString());\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/detach?${stringifiedParams}`\n : `/asset/${assetId}/detach`;\n};\n\nexport const detachAsset = async (\n assetId: string,\n params?: DetachAssetParams,\n options?: RequestInit,\n): Promise<detachAssetResponse> => {\n return customFetch<detachAssetResponse>(getDetachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationKey = [\"detachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;\n\nexport type DetachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Detaches an Asset from a Merchant\n */\nexport const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationOptions = getDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;;AAoEA,MAAa,kBAAkB,WAA4B;CACzD,MAAM,mBAAmB,IAAI,iBAAiB;AAE9C,QAAO,QAAQ,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;AACrD,MAAI,UAAU,OACZ,kBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,MAAM,UAAU,CAAC;GAE1E;CAEF,MAAM,oBAAoB,iBAAiB,UAAU;AAErD,QAAO,kBAAkB,SAAS,IAAI,UAAU,sBAAsB;;AAGxE,MAAa,WAAW,OACtB,QACA,YAC8B;AAC9B,QAAOA,iCAA8B,eAAe,OAAO,EAAE;EAAE,GAAG;EAAS,QAAQ;EAAO,CAAC;;AAG7F,MAAa,uBAAuB,WAA4B;AAC9D,QAAO;EAAC;EAAkB;EAAS,GAAI,SAAS,CAAC,OAAO,GAAG,EAAE;EAAE;;AAGjE,MAAa,2BAIX,QACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,oBAAoB,OAAO;CAEtE,MAAMC,WAAgE,EAAE,aACtE,SAAS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C1E,GAAG;EACH,QAAQ;EACT,CAAC;;AAGJ,MAAa,iCAGX,YAaG;CACH,MAAM,cAAc,CAAC,cAAc;CACnC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;GAAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMS,cAGD,UAAU;EACb,MAAM,EAAE,SAAS,WAAW,SAAS,EAAE;AAEvC,SAAO,YAAY,SAAS,QAAQ,eAAe;;AAGrD,QAAO;EAAE;EAAY,GAAG;EAAiB;;;;;AAU3C,MAAa,kBACX,SASA,gBAMG;AAGH,gDAFwB,8BAA8B,QAAQ,EAE1B,YAAY"}
|
|
@@ -8,7 +8,7 @@ import { AttachAssetParams } from "../api-schemas/attachAssetParams.cjs";
|
|
|
8
8
|
import { DetachAssetParams } from "../api-schemas/detachAssetParams.cjs";
|
|
9
9
|
import { GetAssetParams } from "../api-schemas/getAssetParams.cjs";
|
|
10
10
|
import { ErrorType, customFetch } from "../../custom-fetch.cjs";
|
|
11
|
-
import { InvalidateOptions, QueryClient, QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
11
|
+
import { DataTag, DefinedInitialDataOptions, DefinedUseQueryResult, InvalidateOptions, QueryClient, QueryKey, UndefinedInitialDataOptions, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
12
12
|
|
|
13
13
|
//#region src/api/asset/asset.fetch.d.ts
|
|
14
14
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
@@ -44,42 +44,60 @@ declare const getGetAssetUrl: (params?: GetAssetParams) => string;
|
|
|
44
44
|
declare const getAsset: (params?: GetAssetParams, options?: RequestInit) => Promise<getAssetResponse>;
|
|
45
45
|
declare const getGetAssetQueryKey: (params?: GetAssetParams) => readonly ["account-server", "asset", ...GetAssetParams[]];
|
|
46
46
|
declare const getGetAssetQueryOptions: <TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
47
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
47
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
48
48
|
request?: SecondParameter<typeof customFetch>;
|
|
49
49
|
}) => UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {
|
|
50
|
-
queryKey: QueryKey
|
|
50
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
51
51
|
};
|
|
52
52
|
type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
53
53
|
type GetAssetQueryError = ErrorType<AsError | void>;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
declare function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params: undefined | GetAssetParams, options: {
|
|
55
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getAsset>>, TError, Awaited<ReturnType<typeof getAsset>>>, "initialData">;
|
|
56
|
+
request?: SecondParameter<typeof customFetch>;
|
|
57
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
58
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
59
|
+
};
|
|
60
|
+
declare function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
61
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getAsset>>, TError, Awaited<ReturnType<typeof getAsset>>>, "initialData">;
|
|
62
|
+
request?: SecondParameter<typeof customFetch>;
|
|
63
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
64
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
65
|
+
};
|
|
57
66
|
declare function useGetAsset<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
58
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
67
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
59
68
|
request?: SecondParameter<typeof customFetch>;
|
|
60
|
-
}): UseQueryResult<TData, TError> & {
|
|
61
|
-
queryKey: QueryKey
|
|
69
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
70
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
62
71
|
};
|
|
63
72
|
/**
|
|
64
73
|
* @summary Gets Assets
|
|
65
74
|
*/
|
|
66
75
|
declare const invalidateGetAsset: (queryClient: QueryClient, params?: GetAssetParams, options?: InvalidateOptions) => Promise<QueryClient>;
|
|
67
76
|
declare const getGetAssetSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
68
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
77
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
69
78
|
request?: SecondParameter<typeof customFetch>;
|
|
70
79
|
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {
|
|
71
|
-
queryKey: QueryKey
|
|
80
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
72
81
|
};
|
|
73
82
|
type GetAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;
|
|
74
83
|
type GetAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
declare function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params: undefined | GetAssetParams, options: {
|
|
85
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
86
|
+
request?: SecondParameter<typeof customFetch>;
|
|
87
|
+
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
88
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
89
|
+
};
|
|
90
|
+
declare function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
91
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
92
|
+
request?: SecondParameter<typeof customFetch>;
|
|
93
|
+
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
94
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
95
|
+
};
|
|
78
96
|
declare function useGetAssetSuspense<TData = Awaited<ReturnType<typeof getAsset>>, TError = ErrorType<AsError | void>>(params?: GetAssetParams, options?: {
|
|
79
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData
|
|
97
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;
|
|
80
98
|
request?: SecondParameter<typeof customFetch>;
|
|
81
|
-
}): UseSuspenseQueryResult<TData, TError> & {
|
|
82
|
-
queryKey: QueryKey
|
|
99
|
+
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
100
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
83
101
|
};
|
|
84
102
|
/**
|
|
85
103
|
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**
|
|
@@ -136,7 +154,7 @@ declare const useCreateAsset: <TError = ErrorType<AsError | void>, TContext = un
|
|
|
136
154
|
data: AssetPostBodyBody;
|
|
137
155
|
}, TContext>;
|
|
138
156
|
request?: SecondParameter<typeof customFetch>;
|
|
139
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof createAsset>>, TError, {
|
|
157
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof createAsset>>, TError, {
|
|
140
158
|
data: AssetPostBodyBody;
|
|
141
159
|
}, TContext>;
|
|
142
160
|
/**
|
|
@@ -171,42 +189,60 @@ declare const getGetSpecificAssetUrl: (assetId: string) => string;
|
|
|
171
189
|
declare const getSpecificAsset: (assetId: string, options?: RequestInit) => Promise<getSpecificAssetResponse>;
|
|
172
190
|
declare const getGetSpecificAssetQueryKey: (assetId?: string) => readonly ["account-server", "asset", string | undefined];
|
|
173
191
|
declare const getGetSpecificAssetQueryOptions: <TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
174
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
192
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
175
193
|
request?: SecondParameter<typeof customFetch>;
|
|
176
194
|
}) => UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData> & {
|
|
177
|
-
queryKey: QueryKey
|
|
195
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
178
196
|
};
|
|
179
197
|
type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;
|
|
180
198
|
type GetSpecificAssetQueryError = ErrorType<AsError | void>;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
199
|
+
declare function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options: {
|
|
200
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, Awaited<ReturnType<typeof getSpecificAsset>>>, "initialData">;
|
|
201
|
+
request?: SecondParameter<typeof customFetch>;
|
|
202
|
+
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
203
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
204
|
+
};
|
|
205
|
+
declare function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
206
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, Awaited<ReturnType<typeof getSpecificAsset>>>, "initialData">;
|
|
207
|
+
request?: SecondParameter<typeof customFetch>;
|
|
208
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
209
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
210
|
+
};
|
|
184
211
|
declare function useGetSpecificAsset<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
185
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
212
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
186
213
|
request?: SecondParameter<typeof customFetch>;
|
|
187
|
-
}): UseQueryResult<TData, TError> & {
|
|
188
|
-
queryKey: QueryKey
|
|
214
|
+
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
215
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
189
216
|
};
|
|
190
217
|
/**
|
|
191
218
|
* @summary Gets an Asset
|
|
192
219
|
*/
|
|
193
220
|
declare const invalidateGetSpecificAsset: (queryClient: QueryClient, assetId: string, options?: InvalidateOptions) => Promise<QueryClient>;
|
|
194
221
|
declare const getGetSpecificAssetSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
195
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
222
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
196
223
|
request?: SecondParameter<typeof customFetch>;
|
|
197
224
|
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData> & {
|
|
198
|
-
queryKey: QueryKey
|
|
225
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
199
226
|
};
|
|
200
227
|
type GetSpecificAssetSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;
|
|
201
228
|
type GetSpecificAssetSuspenseQueryError = ErrorType<AsError | void>;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
229
|
+
declare function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options: {
|
|
230
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
231
|
+
request?: SecondParameter<typeof customFetch>;
|
|
232
|
+
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
233
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
234
|
+
};
|
|
235
|
+
declare function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
236
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
237
|
+
request?: SecondParameter<typeof customFetch>;
|
|
238
|
+
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
239
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
240
|
+
};
|
|
205
241
|
declare function useGetSpecificAssetSuspense<TData = Awaited<ReturnType<typeof getSpecificAsset>>, TError = ErrorType<AsError | void>>(assetId: string, options?: {
|
|
206
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData
|
|
242
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;
|
|
207
243
|
request?: SecondParameter<typeof customFetch>;
|
|
208
|
-
}): UseSuspenseQueryResult<TData, TError> & {
|
|
209
|
-
queryKey: QueryKey
|
|
244
|
+
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
245
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
210
246
|
};
|
|
211
247
|
/**
|
|
212
248
|
* Used to update or replace Asset *Content* or *Description*.
|
|
@@ -264,7 +300,7 @@ declare const usePatchAsset: <TError = ErrorType<void | AsError>, TContext = unk
|
|
|
264
300
|
data: AssetPatchBodyBody;
|
|
265
301
|
}, TContext>;
|
|
266
302
|
request?: SecondParameter<typeof customFetch>;
|
|
267
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof patchAsset>>, TError, {
|
|
303
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof patchAsset>>, TError, {
|
|
268
304
|
assetId: string;
|
|
269
305
|
data: AssetPatchBodyBody;
|
|
270
306
|
}, TContext>;
|
|
@@ -318,7 +354,7 @@ declare const useDeleteAsset: <TError = ErrorType<AsError | void>, TContext = un
|
|
|
318
354
|
assetId: string;
|
|
319
355
|
}, TContext>;
|
|
320
356
|
request?: SecondParameter<typeof customFetch>;
|
|
321
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof deleteAsset>>, TError, {
|
|
357
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof deleteAsset>>, TError, {
|
|
322
358
|
assetId: string;
|
|
323
359
|
}, TContext>;
|
|
324
360
|
/**
|
|
@@ -371,7 +407,7 @@ declare const useDisableAsset: <TError = ErrorType<AsError | void>, TContext = u
|
|
|
371
407
|
assetId: string;
|
|
372
408
|
}, TContext>;
|
|
373
409
|
request?: SecondParameter<typeof customFetch>;
|
|
374
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof disableAsset>>, TError, {
|
|
410
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof disableAsset>>, TError, {
|
|
375
411
|
assetId: string;
|
|
376
412
|
}, TContext>;
|
|
377
413
|
/**
|
|
@@ -424,7 +460,7 @@ declare const useEnableAsset: <TError = ErrorType<AsError | void>, TContext = un
|
|
|
424
460
|
assetId: string;
|
|
425
461
|
}, TContext>;
|
|
426
462
|
request?: SecondParameter<typeof customFetch>;
|
|
427
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof enableAsset>>, TError, {
|
|
463
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof enableAsset>>, TError, {
|
|
428
464
|
assetId: string;
|
|
429
465
|
}, TContext>;
|
|
430
466
|
/**
|
|
@@ -480,7 +516,7 @@ declare const useAttachAsset: <TError = ErrorType<AsError | void>, TContext = un
|
|
|
480
516
|
params?: AttachAssetParams;
|
|
481
517
|
}, TContext>;
|
|
482
518
|
request?: SecondParameter<typeof customFetch>;
|
|
483
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof attachAsset>>, TError, {
|
|
519
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof attachAsset>>, TError, {
|
|
484
520
|
assetId: string;
|
|
485
521
|
params?: AttachAssetParams;
|
|
486
522
|
}, TContext>;
|
|
@@ -537,7 +573,7 @@ declare const useDetachAsset: <TError = ErrorType<AsError | void>, TContext = un
|
|
|
537
573
|
params?: DetachAssetParams;
|
|
538
574
|
}, TContext>;
|
|
539
575
|
request?: SecondParameter<typeof customFetch>;
|
|
540
|
-
}) => UseMutationResult<Awaited<ReturnType<typeof detachAsset>>, TError, {
|
|
576
|
+
}, queryClient?: QueryClient) => UseMutationResult<Awaited<ReturnType<typeof detachAsset>>, TError, {
|
|
541
577
|
assetId: string;
|
|
542
578
|
params?: DetachAssetParams;
|
|
543
579
|
}, TContext>;
|