@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.fetch.js","names":["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,QAAO,YAA8B,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,MAAMA,WAAgE,EAAE,aACtE,SAAS,QAAQ;EAAE;EAAQ,GAAG;EAAgB,CAAC;AAEjD,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAc/C,SAAgB,YAId,QACA,SAIwD;CACxD,MAAM,eAAe,wBAAwB,QAAQ,QAAQ;CAE7D,MAAM,QAAQ,SAAS,aAAa;AAEpC,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,qBAAqB,O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D,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,QAAO,YAFiB,8BAA8B,QAAQ,CAE3B"}
|
|
1
|
+
{"version":3,"file":"asset.fetch.js","names":["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,m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/dist/api/asset/asset.js
CHANGED
|
@@ -45,9 +45,9 @@ const getGetAssetQueryOptions = (params, options) => {
|
|
|
45
45
|
/**
|
|
46
46
|
* @summary Gets Assets
|
|
47
47
|
*/
|
|
48
|
-
function useGetAsset(params, options) {
|
|
48
|
+
function useGetAsset(params, options, queryClient) {
|
|
49
49
|
const queryOptions = getGetAssetQueryOptions(params, options);
|
|
50
|
-
const query = useQuery(queryOptions);
|
|
50
|
+
const query = useQuery(queryOptions, queryClient);
|
|
51
51
|
query.queryKey = queryOptions.queryKey;
|
|
52
52
|
return query;
|
|
53
53
|
}
|
|
@@ -71,9 +71,9 @@ const getGetAssetSuspenseQueryOptions = (params, options) => {
|
|
|
71
71
|
/**
|
|
72
72
|
* @summary Gets Assets
|
|
73
73
|
*/
|
|
74
|
-
function useGetAssetSuspense(params, options) {
|
|
74
|
+
function useGetAssetSuspense(params, options, queryClient) {
|
|
75
75
|
const queryOptions = getGetAssetSuspenseQueryOptions(params, options);
|
|
76
|
-
const query = useSuspenseQuery(queryOptions);
|
|
76
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
77
77
|
query.queryKey = queryOptions.queryKey;
|
|
78
78
|
return query;
|
|
79
79
|
}
|
|
@@ -129,8 +129,8 @@ const getCreateAssetMutationOptions = (options) => {
|
|
|
129
129
|
/**
|
|
130
130
|
* @summary Create an Asset
|
|
131
131
|
*/
|
|
132
|
-
const useCreateAsset = (options) => {
|
|
133
|
-
return useMutation(getCreateAssetMutationOptions(options));
|
|
132
|
+
const useCreateAsset = (options, queryClient) => {
|
|
133
|
+
return useMutation(getCreateAssetMutationOptions(options), queryClient);
|
|
134
134
|
};
|
|
135
135
|
/**
|
|
136
136
|
* Gets a known Asset
|
|
@@ -165,9 +165,9 @@ const getGetSpecificAssetQueryOptions = (assetId, options) => {
|
|
|
165
165
|
/**
|
|
166
166
|
* @summary Gets an Asset
|
|
167
167
|
*/
|
|
168
|
-
function useGetSpecificAsset(assetId, options) {
|
|
168
|
+
function useGetSpecificAsset(assetId, options, queryClient) {
|
|
169
169
|
const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);
|
|
170
|
-
const query = useQuery(queryOptions);
|
|
170
|
+
const query = useQuery(queryOptions, queryClient);
|
|
171
171
|
query.queryKey = queryOptions.queryKey;
|
|
172
172
|
return query;
|
|
173
173
|
}
|
|
@@ -191,9 +191,9 @@ const getGetSpecificAssetSuspenseQueryOptions = (assetId, options) => {
|
|
|
191
191
|
/**
|
|
192
192
|
* @summary Gets an Asset
|
|
193
193
|
*/
|
|
194
|
-
function useGetSpecificAssetSuspense(assetId, options) {
|
|
194
|
+
function useGetSpecificAssetSuspense(assetId, options, queryClient) {
|
|
195
195
|
const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);
|
|
196
|
-
const query = useSuspenseQuery(queryOptions);
|
|
196
|
+
const query = useSuspenseQuery(queryOptions, queryClient);
|
|
197
197
|
query.queryKey = queryOptions.queryKey;
|
|
198
198
|
return query;
|
|
199
199
|
}
|
|
@@ -242,8 +242,8 @@ const getPatchAssetMutationOptions = (options) => {
|
|
|
242
242
|
/**
|
|
243
243
|
* @summary Adjust an existing Asset
|
|
244
244
|
*/
|
|
245
|
-
const usePatchAsset = (options) => {
|
|
246
|
-
return useMutation(getPatchAssetMutationOptions(options));
|
|
245
|
+
const usePatchAsset = (options, queryClient) => {
|
|
246
|
+
return useMutation(getPatchAssetMutationOptions(options), queryClient);
|
|
247
247
|
};
|
|
248
248
|
/**
|
|
249
249
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
@@ -282,8 +282,8 @@ const getDeleteAssetMutationOptions = (options) => {
|
|
|
282
282
|
/**
|
|
283
283
|
* @summary Deletes an Asset
|
|
284
284
|
*/
|
|
285
|
-
const useDeleteAsset = (options) => {
|
|
286
|
-
return useMutation(getDeleteAssetMutationOptions(options));
|
|
285
|
+
const useDeleteAsset = (options, queryClient) => {
|
|
286
|
+
return useMutation(getDeleteAssetMutationOptions(options), queryClient);
|
|
287
287
|
};
|
|
288
288
|
/**
|
|
289
289
|
* Disables a known Asset
|
|
@@ -322,8 +322,8 @@ const getDisableAssetMutationOptions = (options) => {
|
|
|
322
322
|
/**
|
|
323
323
|
* @summary Disables an Asset
|
|
324
324
|
*/
|
|
325
|
-
const useDisableAsset = (options) => {
|
|
326
|
-
return useMutation(getDisableAssetMutationOptions(options));
|
|
325
|
+
const useDisableAsset = (options, queryClient) => {
|
|
326
|
+
return useMutation(getDisableAssetMutationOptions(options), queryClient);
|
|
327
327
|
};
|
|
328
328
|
/**
|
|
329
329
|
* Enables a known Asset
|
|
@@ -362,8 +362,8 @@ const getEnableAssetMutationOptions = (options) => {
|
|
|
362
362
|
/**
|
|
363
363
|
* @summary Enables an Asset
|
|
364
364
|
*/
|
|
365
|
-
const useEnableAsset = (options) => {
|
|
366
|
-
return useMutation(getEnableAssetMutationOptions(options));
|
|
365
|
+
const useEnableAsset = (options, queryClient) => {
|
|
366
|
+
return useMutation(getEnableAssetMutationOptions(options), queryClient);
|
|
367
367
|
};
|
|
368
368
|
/**
|
|
369
369
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
@@ -403,8 +403,8 @@ const getAttachAssetMutationOptions = (options) => {
|
|
|
403
403
|
/**
|
|
404
404
|
* @summary Attaches an Asset to a Merchant
|
|
405
405
|
*/
|
|
406
|
-
const useAttachAsset = (options) => {
|
|
407
|
-
return useMutation(getAttachAssetMutationOptions(options));
|
|
406
|
+
const useAttachAsset = (options, queryClient) => {
|
|
407
|
+
return useMutation(getAttachAssetMutationOptions(options), queryClient);
|
|
408
408
|
};
|
|
409
409
|
/**
|
|
410
410
|
* Detaches an Asset from a **Merchant**
|
|
@@ -444,8 +444,8 @@ const getDetachAssetMutationOptions = (options) => {
|
|
|
444
444
|
/**
|
|
445
445
|
* @summary Detaches an Asset from a Merchant
|
|
446
446
|
*/
|
|
447
|
-
const useDetachAsset = (options) => {
|
|
448
|
-
return useMutation(getDetachAssetMutationOptions(options));
|
|
447
|
+
const useDetachAsset = (options, queryClient) => {
|
|
448
|
+
return useMutation(getDetachAssetMutationOptions(options), queryClient);
|
|
449
449
|
};
|
|
450
450
|
|
|
451
451
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.js","names":["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.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 { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\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 const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"GET\", params, signal },\n options,\n );\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\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 customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\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 customInstance>;\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 customInstance>;\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 const getSpecificAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AssetDetail>({ url: `/asset/${assetId}`, method: \"GET\", signal }, options);\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,\n) => {\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 customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"PATCH\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options,\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 customInstance>;\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 customInstance>;\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 const deleteAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}`, method: \"DELETE\" }, options);\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 customInstance>;\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 customInstance>;\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 const disableAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}/disable`, method: \"PATCH\" }, options);\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 customInstance>;\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 customInstance>;\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 const enableAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}/enable`, method: \"PATCH\" }, options);\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 customInstance>;\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 customInstance>;\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 const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"PATCH\", params },\n options,\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 customInstance>;\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 customInstance>;\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 const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"PATCH\", params },\n options,\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 customInstance>;\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 customInstance>;\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":";;;;;;;;;;;;;;;;;;;AA+CA,MAAa,YACX,QACA,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAU,QAAQ;EAAO;EAAQ;EAAQ,EAChD,QACD;;AAGH,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,MAAMA,WAAgE,EAAE,aACtE,SAAS,QAAQ,gBAAgB,OAAO;AAE1C,QAAO;EAAE;EAAU;EAAS,GAAG;EAAc;;;;;AAc/C,SAAgB,YAId,QACA,SAIwD;CACxD,MAAM,eAAe,wBAAwB,QAAQ,QAAQ;CAE7D,MAAM,QAAQ,SAAS,aAAa;AAEpC,OAAM,WAAW,aAAa;AAE9B,QAAO;;;;;AAMT,MAAa,qBAAqB,OAChC,aACA,QACA,YACyB;AACzB,OAAM,YAAY,kBAAkB,EAAE,UAAU,oBAAoB,OAAO,EAAE,EAAE,QAAQ;AAEvF,QAAO;;AAGT,MAAa,mCAIX,QACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB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AAa;EAAE,GAChE;EAAE,UAAU,EAAE,aAAa;EAAE,SAAS;EAAW;CAErD,MAAMC,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,QAAO,YAFiB,8BAA8B,QAAQ,CAE3B"}
|
|
1
|
+
{"version":3,"file":"asset.js","names":["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.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 { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\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 const getAsset = (\n params?: GetAssetParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AssetGetResponse>(\n { url: `/asset`, method: \"GET\", params, signal },\n options,\n );\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 const createAsset = (\n assetPostBodyBody: AssetPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\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 customInstance<AssetPostResponse>(\n {\n url: `/asset`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\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 customInstance>;\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 customInstance>;\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 const getSpecificAsset = (\n assetId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AssetDetail>({ url: `/asset/${assetId}`, method: \"GET\", signal }, options);\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 customInstance>;\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, requestOptions, signal);\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 customInstance>;\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 const patchAsset = (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,\n) => {\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 customInstance<void>(\n {\n url: `/asset/${assetId}`,\n method: \"PATCH\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n },\n options,\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 customInstance>;\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 customInstance>;\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 const deleteAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}`, method: \"DELETE\" }, options);\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 customInstance>;\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 customInstance>;\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 const disableAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}/disable`, method: \"PATCH\" }, options);\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 customInstance>;\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 customInstance>;\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 const enableAsset = (assetId: string, options?: SecondParameter<typeof customInstance>) => {\n return customInstance<void>({ url: `/asset/${assetId}/enable`, method: \"PATCH\" }, options);\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 customInstance>;\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 customInstance>;\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 const attachAsset = (\n assetId: string,\n params?: AttachAssetParams,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/attach`, method: \"PATCH\", params },\n options,\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 customInstance>;\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 customInstance>;\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 const detachAsset = (\n assetId: string,\n params?: DetachAssetParams,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n { url: `/asset/${assetId}/detach`, method: \"PATCH\", params },\n options,\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 customInstance>;\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 customInstance>;\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":";;;;;;;;;;;;;;;;;;;AAmDA,MAAa,YACX,QACA,SACA,WACG;AACH,QAAO,eACL;EAAE,KAAK;EAAU,QAAQ;EAAO;EAAQ;EAAQ,EAChD,QACD;;AAGH,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,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