@squonk/account-server-client 4.3.1 → 4.4.0-4-4.2174353771
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/actions/actions.cjs +53 -0
- package/actions/actions.cjs.map +1 -0
- package/actions/actions.d.cts +72 -0
- package/actions/actions.d.ts +72 -0
- package/actions/actions.js +53 -0
- package/actions/actions.js.map +1 -0
- package/actions/package.json +7 -0
- package/asset/asset.cjs +12 -12
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.js +1 -1
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +9 -9
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.js +1 -1
- package/charges/charges.js.map +1 -1
- package/{chunk-3WKSNKHE.js → chunk-76ADQBHZ.js} +3 -3
- package/chunk-76ADQBHZ.js.map +1 -0
- package/{chunk-NY2VJJG7.cjs → chunk-KHB5TJT7.cjs} +3 -3
- package/chunk-KHB5TJT7.cjs.map +1 -0
- package/chunk-RB2KVIEK.cjs.map +1 -1
- package/event-stream/event-stream.cjs +7 -7
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.js +1 -1
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +9 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +74 -2
- package/index.d.ts +74 -2
- package/index.js +8 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +5 -5
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.js +1 -1
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +10 -10
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.js +1 -1
- package/organisation/organisation.js.map +1 -1
- package/package.json +3 -3
- package/product/product.cjs +16 -16
- package/product/product.cjs.map +1 -1
- package/product/product.js +1 -1
- package/product/product.js.map +1 -1
- package/src/{account-server-api.schemas.ts → API_TARGET_NAME.schemas.ts} +81 -1
- package/src/actions/actions.ts +249 -0
- package/src/asset/asset.ts +2 -2
- package/src/charges/charges.ts +2 -2
- package/src/event-stream/event-stream.ts +2 -2
- package/src/index.ts +2 -2
- package/src/merchant/merchant.ts +2 -2
- package/src/options-mutator.ts +2 -2
- package/src/organisation/organisation.ts +2 -2
- package/src/product/product.ts +2 -2
- package/src/state/state.ts +2 -2
- package/src/unit/unit.ts +2 -2
- package/src/user/user.ts +2 -2
- package/state/state.cjs +3 -3
- package/state/state.cjs.map +1 -1
- package/state/state.js +1 -1
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +16 -16
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.js +1 -1
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +11 -11
- package/user/user.cjs.map +1 -1
- package/user/user.js +1 -1
- package/user/user.js.map +1 -1
- package/chunk-3WKSNKHE.js.map +0 -1
- package/chunk-NY2VJJG7.cjs.map +0 -1
package/asset/asset.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/asset/asset.cjs","../../src/asset/asset.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACA;ACEA,mDAAwD;AA0CjD,IAAM,SAAA,EAAW,CACtB,MAAA,EACA,OAAA,EACA,MAAA,EAAA,GACG;AACH,EAAA,OAAO,8CAAA;AAAA,IACL,EAAE,GAAA,EAAK,CAAA,MAAA,CAAA,EAAU,MAAA,EAAQ,KAAA,EAAO,MAAA,EAAQ,OAAO,CAAA;AAAA,IAC/C;AAAA,EACF,CAAA;AACF,CAAA;AAEO,IAAM,oBAAA,EAAsB,CAAC,MAAA,EAAA,GAA4B;AAC9D,EAAA,OAAO,CAAC,CAAA,MAAA,CAAA,EAAU,GAAI,OAAA,EAAS,CAAC,MAAM,EAAA,EAAI,CAAC,CAAE,CAAA;AAC/C,CAAA;AAEO,IAAM,wBAAA,EAA0B,CAIrC,MAAA,EACA,OAAA,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A;AAEa,IAAA;AAC7C,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAQkG;AAC5C,EAAA;AACtD;AAkBK;AAC+B,EAAA;AACU,EAAA;AAS7B,EAAA;AACiB,IAAA;AAEY,IAAA;AAC5C,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAYK;AACI,EAAA;AACsC,IAAA;AAC3C,IAAA;AACF,EAAA;AACF;AAkBK;AAC+B,EAAA;AACU,EAAA;AAS7B,EAAA;AACyB,IAAA;AAEF,IAAA;AACtC,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AAYK;AACI,EAAA;AACsC,IAAA;AAC3C,IAAA;AACF,EAAA;AACF;AAkBK;AAC+B,EAAA;AACU,EAAA;AAS7B,EAAA;AACyB,IAAA;AAEF,IAAA;AACtC,EAAA;AAE2C,EAAA;AAEpC,EAAA;AACT;AAyBK;AACqB,EAAA;AAEuB,EAAA;AACjD;AD90BiD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/squonk2-account-server-js-client/squonk2-account-server-js-client/dist/asset/asset.cjs","sourcesContent":[null,"/**\n * Generated by orval v7.10.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.3\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\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 \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\nimport { mutationMutator } from \".././options-mutator\";\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 [`/asset`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 useCreateAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useCreateAssetMutationOptions(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 [`/asset/${assetId}`] as const;\n};\n\nexport const useGetSpecificAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetSpecificAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 usePatchAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = usePatchAssetMutationOptions(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 useDeleteAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDeleteAssetMutationOptions(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 useDisableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDisableAssetMutationOptions(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 useEnableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useEnableAssetMutationOptions(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 useAttachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useAttachAssetMutationOptions(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 useDetachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["/builds/informaticsmatters/squonk2-account-server/openapi-client/dist/asset/asset.cjs","../../src/asset/asset.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,yDAA8B;AAC9B;AACE;AACF,yDAA8B;AAC9B;AACA;ACEA,mDAAwD;AA0CjD,IAAM,SAAA,EAAW,CACtB,MAAA,EACA,OAAA,EACA,MAAA,EAAA,GACG;AACH,EAAA,OAAO,8CAAA;AAAA,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builds/informaticsmatters/squonk2-account-server/openapi-client/dist/asset/asset.cjs","sourcesContent":[null,"/**\n * Generated by orval v7.10.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 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_TARGET_NAME.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\nimport { mutationMutator } from \".././options-mutator\";\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 [`/asset`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 useCreateAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useCreateAssetMutationOptions(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 [`/asset/${assetId}`] as const;\n};\n\nexport const useGetSpecificAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetSpecificAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 usePatchAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = usePatchAssetMutationOptions(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 useDeleteAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDeleteAssetMutationOptions(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 useDisableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDisableAssetMutationOptions(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 useEnableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useEnableAssetMutationOptions(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 useAttachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useAttachAssetMutationOptions(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 useDetachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"]}
|
package/asset/asset.js
CHANGED
package/asset/asset.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/asset/asset.ts"],"sourcesContent":["/**\n * Generated by orval v7.10.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.3\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\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 \"../account-server-api.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\nimport { mutationMutator } from \".././options-mutator\";\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 [`/asset`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 useCreateAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useCreateAssetMutationOptions(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 [`/asset/${assetId}`] as const;\n};\n\nexport const useGetSpecificAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetSpecificAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 usePatchAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = usePatchAssetMutationOptions(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 useDeleteAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDeleteAssetMutationOptions(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 useDisableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDisableAssetMutationOptions(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 useEnableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useEnableAssetMutationOptions(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 useAttachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useAttachAssetMutationOptions(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 useDetachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDetachAssetMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n"],"mappings":";;;;;;;;;AAUA,SAAS,aAAa,UAAU,wBAAwB;AA0CjD,IAAM,WAAW,CACtB,QACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,QAAQ,OAAO,QAAQ,OAAO;AAAA,IAC/C;AAAA,EACF;AACF;AAEO,IAAM,sBAAsB,CAAC,WAA4B;AAC9D,SAAO,CAAC,UAAU,GAAI,SAAS,CAAC,MAAM,IAAI,CAAC,CAAE;AAC/C;AAEO,IAAM,0BAA0B,CAIrC,QACA,YAIG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAC7E,SAAS,QAAQ,gBAAgB,MAAM;AAEzC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE,SAAO;AAGT;AA0DO,SAAS,YAId,QACA,SAIA,aACgF;AAChF,QAAM,eAAe,wBAAwB,QAAQ,OAAO;AAE5D,QAAM,QAAQ,SAAS,cAAc,WAAW;AAIhD,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAEO,IAAM,kCAAkC,CAI7C,QACA,YAIG;AACH,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,WAAW,cAAc,YAAY,oBAAoB,MAAM;AAErE,QAAM,UAA+D,CAAC,EAAE,OAAO,MAC7E,SAAS,QAAQ,gBAAgB,MAAM;AAEzC,QAAM,gBAAgB,aAAa,EAAE,GAAG,cAAc,UAAU,QAAQ,CAAC;AAEzE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set.ts"],"sourcesContent":["/**\n * Generated by orval v7.10.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 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_TARGET_NAME.schemas\";\n\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\nimport { queryMutator } from \".././options-mutator\";\nimport { mutationMutator } from \".././options-mutator\";\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 [`/asset`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 useCreateAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useCreateAssetMutationOptions(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 [`/asset/${assetId}`] as const;\n};\n\nexport const useGetSpecificAssetQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetSpecificAssetSuspenseQueryOptions = <\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 const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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, TError> };\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, TError> };\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, TError> };\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, TError> } {\n const queryOptions = useGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\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 usePatchAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = usePatchAssetMutationOptions(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 useDeleteAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDeleteAssetMutationOptions(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 useDisableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDisableAssetMutationOptions(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 useEnableAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useEnableAssetMutationOptions(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 useAttachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useAttachAssetMutationOptions(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 useDetachAssetMutationOptions = <\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 const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\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 = useDetachAssetMutationOptions(options);\n\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AE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,QAAM,gBAAgB,gBAAgB,EAAE,GAAG,iBAAiB,WAAW,CAAC;AAExE,SAAO;AACT;AASO,IAAM,iBAAiB,CAC5B,SASA,gBAMG;AACH,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,iBAAiB,WAAW;AACjD;AAQO,IAAM,cAAc,CACzB,SACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,UAAU,OAAO,WAAW,QAAQ,SAAS,OAAO;AAAA,IAC3D;AAAA,EACF;AACF;AAEO,IAAM,gCAAgC,CAG3C,YAaG;AACH,QAAM,cAAc,CAAC,aAAa;AAClC,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA,EAAE,GAAG,SAAS,UAAU,EAAE,GAAG,QAAQ,UAAU,YAAY,EAAE,IAC/D,EAAE,UAAU,EAAE,YAAY,GAAG,SAAS,OAAU;AAEpD,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,SAAS,OAAO,IAAI,SAAS,CAAC;AAEtC,WAAO,YAAY,SAAS,QAAQ,cAAc;AAAA,EACpD;AAEA,QAAM,gBAAgB,gBAAgB,EAAE,GAAG,iBAAiB,WAAW,CAAC;AAExE,SAAO;AACT;AASO,IAAM,iBAAiB,CAC5B,SASA,gBAMG;AACH,QAAM,kBAAkB,8BAA8B,OAAO;AAE7D,SAAO,YAAY,iBAAiB,WAAW;AACjD;","names":[]}
|
package/charges/charges.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKHB5TJT7cjs = require('../chunk-KHB5TJT7.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkRB2KVIEKcjs = require('../chunk-RB2KVIEK.cjs');
|
|
@@ -20,7 +20,7 @@ var useGetChargesQueryOptions = (params, options) => {
|
|
|
20
20
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
21
21
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _ => _.queryKey]), () => ( getGetChargesQueryKey(params)));
|
|
22
22
|
const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
23
|
-
const customOptions =
|
|
23
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
24
24
|
return customOptions;
|
|
25
25
|
};
|
|
26
26
|
function useGetCharges(params, options, queryClient) {
|
|
@@ -33,7 +33,7 @@ var useGetChargesSuspenseQueryOptions = (params, options) => {
|
|
|
33
33
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
34
34
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _2 => _2.queryKey]), () => ( getGetChargesQueryKey(params)));
|
|
35
35
|
const queryFn = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
36
|
-
const customOptions =
|
|
36
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
37
37
|
return customOptions;
|
|
38
38
|
};
|
|
39
39
|
function useGetChargesSuspense(params, options, queryClient) {
|
|
@@ -55,7 +55,7 @@ var useGetOrganisationChargesQueryOptions = (orgId, params, options) => {
|
|
|
55
55
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
56
56
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _3 => _3.queryKey]), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
|
|
57
57
|
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
58
|
-
const customOptions =
|
|
58
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
59
59
|
return customOptions;
|
|
60
60
|
};
|
|
61
61
|
function useGetOrganisationCharges(orgId, params, options, queryClient) {
|
|
@@ -68,7 +68,7 @@ var useGetOrganisationChargesSuspenseQueryOptions = (orgId, params, options) =>
|
|
|
68
68
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
69
69
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _4 => _4.queryKey]), () => ( getGetOrganisationChargesQueryKey(orgId, params)));
|
|
70
70
|
const queryFn = ({ signal }) => getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
71
|
-
const customOptions =
|
|
71
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
72
72
|
return customOptions;
|
|
73
73
|
};
|
|
74
74
|
function useGetOrganisationChargesSuspense(orgId, params, options, queryClient) {
|
|
@@ -90,7 +90,7 @@ var useGetProductChargesQueryOptions = (productId, params, options) => {
|
|
|
90
90
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
91
91
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _5 => _5.queryKey]), () => ( getGetProductChargesQueryKey(productId, params)));
|
|
92
92
|
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
93
|
-
const customOptions =
|
|
93
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
94
94
|
return customOptions;
|
|
95
95
|
};
|
|
96
96
|
function useGetProductCharges(productId, params, options, queryClient) {
|
|
@@ -103,7 +103,7 @@ var useGetProductChargesSuspenseQueryOptions = (productId, params, options) => {
|
|
|
103
103
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
104
104
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _6 => _6.queryKey]), () => ( getGetProductChargesQueryKey(productId, params)));
|
|
105
105
|
const queryFn = ({ signal }) => getProductCharges(productId, params, requestOptions, signal);
|
|
106
|
-
const customOptions =
|
|
106
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
107
107
|
return customOptions;
|
|
108
108
|
};
|
|
109
109
|
function useGetProductChargesSuspense(productId, params, options, queryClient) {
|
|
@@ -125,7 +125,7 @@ var useGetUnitChargesQueryOptions = (unitId, params, options) => {
|
|
|
125
125
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
126
126
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _7 => _7.queryKey]), () => ( getGetUnitChargesQueryKey(unitId, params)));
|
|
127
127
|
const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
|
|
128
|
-
const customOptions =
|
|
128
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
129
129
|
return customOptions;
|
|
130
130
|
};
|
|
131
131
|
function useGetUnitCharges(unitId, params, options, queryClient) {
|
|
@@ -138,7 +138,7 @@ var useGetUnitChargesSuspenseQueryOptions = (unitId, params, options) => {
|
|
|
138
138
|
const { query: queryOptions, request: requestOptions } = _nullishCoalesce(options, () => ( {}));
|
|
139
139
|
const queryKey = _nullishCoalesce(_optionalChain([queryOptions, 'optionalAccess', _8 => _8.queryKey]), () => ( getGetUnitChargesQueryKey(unitId, params)));
|
|
140
140
|
const queryFn = ({ signal }) => getUnitCharges(unitId, params, requestOptions, signal);
|
|
141
|
-
const customOptions =
|
|
141
|
+
const customOptions = _chunkKHB5TJT7cjs.queryMutator.call(void 0, { ...queryOptions, queryKey, queryFn });
|
|
142
142
|
return customOptions;
|
|
143
143
|
};
|
|
144
144
|
function useGetUnitChargesSuspense(unitId, params, options, queryClient) {
|