@squonk/account-server-client 4.9.0-beta.2 → 4.9.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/api-schemas/assetDetailScope.cjs +2 -1
- package/dist/api/api-schemas/assetDetailScope.cjs.map +1 -1
- package/dist/api/api-schemas/assetDetailScope.d.cts +1 -0
- package/dist/api/api-schemas/assetDetailScope.d.ts +1 -0
- package/dist/api/api-schemas/assetDetailScope.js +2 -1
- package/dist/api/api-schemas/assetDetailScope.js.map +1 -1
- package/dist/api/api-schemas/assetPostBodyBody.d.cts +2 -2
- package/dist/api/api-schemas/assetPostBodyBody.d.ts +2 -2
- package/dist/api/api-schemas/assetPostBodyBodyScope.cjs +2 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.cjs.map +1 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.d.cts +2 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.d.ts +2 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.js +2 -1
- package/dist/api/api-schemas/assetPostBodyBodyScope.js.map +1 -1
- package/dist/api/asset/asset.cjs +7 -7
- package/dist/api/asset/asset.cjs.map +1 -1
- package/dist/api/asset/asset.d.cts +7 -7
- package/dist/api/asset/asset.d.ts +7 -7
- package/dist/api/asset/asset.fetch.cjs +7 -7
- package/dist/api/asset/asset.fetch.cjs.map +1 -1
- package/dist/api/asset/asset.fetch.d.cts +7 -7
- package/dist/api/asset/asset.fetch.d.ts +7 -7
- package/dist/api/asset/asset.fetch.js +7 -7
- package/dist/api/asset/asset.fetch.js.map +1 -1
- package/dist/api/asset/asset.js +7 -7
- package/dist/api/asset/asset.js.map +1 -1
- package/package.json +1 -1
- package/src/api/api-schemas/assetDetailScope.fetch.ts +1 -0
- package/src/api/api-schemas/assetDetailScope.ts +1 -0
- package/src/api/api-schemas/assetPostBodyBody.fetch.ts +2 -2
- package/src/api/api-schemas/assetPostBodyBody.ts +2 -2
- package/src/api/api-schemas/assetPostBodyBodyScope.fetch.ts +2 -1
- package/src/api/api-schemas/assetPostBodyBodyScope.ts +2 -1
- package/src/api/asset/asset.fetch.ts +7 -7
- package/src/api/asset/asset.ts +7 -7
|
@@ -100,7 +100,7 @@ const getCreateAssetUrl = () => {
|
|
|
100
100
|
return `/asset`;
|
|
101
101
|
};
|
|
102
102
|
/**
|
|
103
|
-
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**
|
|
103
|
+
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**. An administrator can also create an **Internal** Asset, one that is read only by the Account Server
|
|
104
104
|
*
|
|
105
105
|
* Assets 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**.
|
|
106
106
|
*
|
|
@@ -227,7 +227,7 @@ const getPatchAssetUrl = (assetId) => {
|
|
|
227
227
|
*
|
|
228
228
|
* The 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.
|
|
229
229
|
*
|
|
230
|
-
* Anyone 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.
|
|
230
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
231
231
|
* @summary Adjust an existing Asset
|
|
232
232
|
*/
|
|
233
233
|
const patchAsset = async (assetId, assetPatchBodyBody, options) => {
|
|
@@ -274,7 +274,7 @@ const getDeleteAssetUrl = (assetId) => {
|
|
|
274
274
|
/**
|
|
275
275
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
276
276
|
*
|
|
277
|
-
* Anyone 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.
|
|
277
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
278
278
|
* @summary Deletes an Asset
|
|
279
279
|
*/
|
|
280
280
|
const deleteAsset = async (assetId, options) => {
|
|
@@ -316,7 +316,7 @@ const getDisableAssetUrl = (assetId) => {
|
|
|
316
316
|
/**
|
|
317
317
|
* Disables a known Asset
|
|
318
318
|
*
|
|
319
|
-
* Anyone 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.
|
|
319
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
320
320
|
* @summary Disables an Asset
|
|
321
321
|
*/
|
|
322
322
|
const disableAsset = async (assetId, options) => {
|
|
@@ -358,7 +358,7 @@ const getEnableAssetUrl = (assetId) => {
|
|
|
358
358
|
/**
|
|
359
359
|
* Enables a known Asset
|
|
360
360
|
*
|
|
361
|
-
* Anyone 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.
|
|
361
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
362
362
|
* @summary Enables an Asset
|
|
363
363
|
*/
|
|
364
364
|
const enableAsset = async (assetId, options) => {
|
|
@@ -405,7 +405,7 @@ const getAttachAssetUrl = (assetId, params) => {
|
|
|
405
405
|
/**
|
|
406
406
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
407
407
|
*
|
|
408
|
-
* Anyone 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.
|
|
408
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
409
409
|
* @summary Attaches an Asset to a Merchant
|
|
410
410
|
*/
|
|
411
411
|
const attachAsset = async (assetId, params, options) => {
|
|
@@ -452,7 +452,7 @@ const getDetachAssetUrl = (assetId, params) => {
|
|
|
452
452
|
/**
|
|
453
453
|
* Detaches an Asset from a **Merchant**
|
|
454
454
|
*
|
|
455
|
-
* Anyone 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.
|
|
455
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
456
456
|
* @summary Detaches an Asset from a Merchant
|
|
457
457
|
*/
|
|
458
458
|
const detachAsset = async (assetId, params, options) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.fetch.cjs","names":["customFetch"],"sources":["../../../src/api/asset/asset.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v8.22.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n *\n * A 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.9\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n AssetDetail,\n AssetGetResponse,\n AssetPatchBodyBody,\n AssetPostBodyBody,\n AssetPostResponse,\n AttachAssetParams,\n DetachAssetParams,\n GetAssetParams,\n} from \"../api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === \"queryKey\") continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport type getAssetResponse201 = { data: AssetGetResponse; status: 201 };\n\nexport type getAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getAssetResponse401 = { data: void; status: 401 };\n\nexport type getAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getAssetResponseSuccess = getAssetResponse201 & { headers: Headers };\nexport type getAssetResponseError = (\n | getAssetResponse400\n | getAssetResponse401\n | getAssetResponse403\n) & { headers: Headers };\n\nexport type getAssetResponse = getAssetResponseSuccess | getAssetResponseError;\n\nexport const getGetAssetUrl = (params?: GetAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : String(value));\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/asset?${stringifiedParams}` : `/asset`;\n};\n\n/**\n * Gets Assets you have access to.\n * @summary Gets Assets\n */\nexport const getAsset = async (\n params?: GetAssetParams,\n options?: RequestInit,\n): Promise<getAssetResponse> => {\n return customFetch<getAssetResponse>(getGetAssetUrl(params), { ...options, method: \"GET\" });\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => {\n return [\"account-server\", \"asset\", ...(params ? [params] : [])] as const;\n};\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params: undefined | GetAssetParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n Awaited<ReturnType<typeof getAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n/**\n * @summary Gets Assets\n */\nexport const invalidateGetAsset = async (\n queryClient: QueryClient,\n params?: GetAssetParams,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAssetQueryKey(params) }, options);\n\n return queryClient;\n};\n\nexport const getGetAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\nexport type createAssetResponse201 = { data: AssetPostResponse; status: 201 };\n\nexport type createAssetResponse400 = { data: AsError; status: 400 };\n\nexport type createAssetResponse401 = { data: void; status: 401 };\n\nexport type createAssetResponse403 = { data: AsError; status: 403 };\n\nexport type createAssetResponseSuccess = createAssetResponse201 & { headers: Headers };\nexport type createAssetResponseError = (\n | createAssetResponse400\n | createAssetResponse401\n | createAssetResponse403\n) & { headers: Headers };\n\nexport type createAssetResponse = createAssetResponseSuccess | createAssetResponseError;\n\nexport const getCreateAssetUrl = () => {\n return `/asset`;\n};\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**\n *\n * Assets 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 *\n * Assets must be *enabled* before they can be used.\n *\n * They 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 * @summary Create an Asset\n */\nexport const createAsset = async (\n assetPostBodyBody: AssetPostBodyBody,\n options?: RequestInit,\n): Promise<createAssetResponse> => {\n const formData = new FormData();\n formData.append(`name`, assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPostBodyBody.content_string);\n }\n formData.append(`scope`, assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(`scope_id`, assetPostBodyBody.scope_id);\n }\n formData.append(`secret`, assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(`description`, assetPostBodyBody.description);\n }\n\n return customFetch<createAssetResponse>(getCreateAssetUrl(), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create an Asset\n */\nexport const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n return useMutation(getCreateAssetMutationOptions(options), queryClient);\n};\nexport type getSpecificAssetResponse201 = { data: AssetDetail; status: 201 };\n\nexport type getSpecificAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getSpecificAssetResponse401 = { data: void; status: 401 };\n\nexport type getSpecificAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getSpecificAssetResponseSuccess = getSpecificAssetResponse201 & { headers: Headers };\nexport type getSpecificAssetResponseError = (\n | getSpecificAssetResponse400\n | getSpecificAssetResponse401\n | getSpecificAssetResponse403\n) & { headers: Headers };\n\nexport type getSpecificAssetResponse =\n | getSpecificAssetResponseSuccess\n | getSpecificAssetResponseError;\n\nexport const getGetSpecificAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\n/**\n * Gets a known Asset\n * @summary Gets an Asset\n */\nexport const getSpecificAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<getSpecificAssetResponse> => {\n return customFetch<getSpecificAssetResponse>(getGetSpecificAssetUrl(assetId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetSpecificAssetQueryKey = (assetId: string) => {\n return [\"account-server\", \"asset\", assetId] as const;\n};\n\nexport const getGetSpecificAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return {\n queryKey,\n queryFn,\n enabled: assetId !== null && assetId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;\nexport type GetSpecificAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n Awaited<ReturnType<typeof getSpecificAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n/**\n * @summary Gets an Asset\n */\nexport const invalidateGetSpecificAsset = async (\n queryClient: QueryClient,\n assetId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetSpecificAssetQueryKey(assetId) }, options);\n\n return queryClient;\n};\n\nexport const getGetSpecificAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\nexport type patchAssetResponse200 = { data: void; status: 200 };\n\nexport type patchAssetResponse401 = { data: void; status: 401 };\n\nexport type patchAssetResponse403 = { data: AsError; status: 403 };\n\nexport type patchAssetResponse404 = { data: AsError; status: 404 };\n\nexport type patchAssetResponseSuccess = patchAssetResponse200 & { headers: Headers };\nexport type patchAssetResponseError = (\n | patchAssetResponse401\n | patchAssetResponse403\n | patchAssetResponse404\n) & { headers: Headers };\n\nexport type patchAssetResponse = patchAssetResponseSuccess | patchAssetResponseError;\n\nexport const getPatchAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\n/**\n * Used to update or replace Asset *Content* or *Description*.\n *\n * The 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 *\n * Anyone 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 * @summary Adjust an existing Asset\n */\nexport const patchAsset = async (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: RequestInit,\n): Promise<patchAssetResponse> => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(`description`, assetPatchBodyBody.description);\n }\n\n return customFetch<patchAssetResponse>(getPatchAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n body: formData,\n });\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Asset\n */\nexport const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n return useMutation(getPatchAssetMutationOptions(options), queryClient);\n};\nexport type deleteAssetResponse204 = { data: void; status: 204 };\n\nexport type deleteAssetResponse400 = { data: AsError; status: 400 };\n\nexport type deleteAssetResponse401 = { data: void; status: 401 };\n\nexport type deleteAssetResponse403 = { data: AsError; status: 403 };\n\nexport type deleteAssetResponseSuccess = deleteAssetResponse204 & { headers: Headers };\nexport type deleteAssetResponseError = (\n | deleteAssetResponse400\n | deleteAssetResponse401\n | deleteAssetResponse403\n) & { headers: Headers };\n\nexport type deleteAssetResponse = deleteAssetResponseSuccess | deleteAssetResponseError;\n\nexport const getDeleteAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n *\n * Anyone 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 * @summary Deletes an Asset\n */\nexport const deleteAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<deleteAssetResponse> => {\n return customFetch<deleteAssetResponse>(getDeleteAssetUrl(assetId), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"deleteAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Asset\n */\nexport const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n return useMutation(getDeleteAssetMutationOptions(options), queryClient);\n};\nexport type disableAssetResponse204 = { data: void; status: 204 };\n\nexport type disableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type disableAssetResponse401 = { data: void; status: 401 };\n\nexport type disableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type disableAssetResponseSuccess = disableAssetResponse204 & { headers: Headers };\nexport type disableAssetResponseError = (\n | disableAssetResponse400\n | disableAssetResponse401\n | disableAssetResponse403\n) & { headers: Headers };\n\nexport type disableAssetResponse = disableAssetResponseSuccess | disableAssetResponseError;\n\nexport const getDisableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/disable`;\n};\n\n/**\n * Disables a known Asset\n *\n * Anyone 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 * @summary Disables an Asset\n */\nexport const disableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<disableAssetResponse> => {\n return customFetch<disableAssetResponse>(getDisableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"disableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;\n\nexport type DisableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Disables an Asset\n */\nexport const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n return useMutation(getDisableAssetMutationOptions(options), queryClient);\n};\nexport type enableAssetResponse204 = { data: void; status: 204 };\n\nexport type enableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type enableAssetResponse401 = { data: void; status: 401 };\n\nexport type enableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type enableAssetResponseSuccess = enableAssetResponse204 & { headers: Headers };\nexport type enableAssetResponseError = (\n | enableAssetResponse400\n | enableAssetResponse401\n | enableAssetResponse403\n) & { headers: Headers };\n\nexport type enableAssetResponse = enableAssetResponseSuccess | enableAssetResponseError;\n\nexport const getEnableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/enable`;\n};\n\n/**\n * Enables a known Asset\n *\n * Anyone 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 * @summary Enables an Asset\n */\nexport const enableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<enableAssetResponse> => {\n return customFetch<enableAssetResponse>(getEnableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"enableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;\n\nexport type EnableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Enables an Asset\n */\nexport const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n return useMutation(getEnableAssetMutationOptions(options), queryClient);\n};\nexport type attachAssetResponse204 = { data: void; status: 204 };\n\nexport type attachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type attachAssetResponse401 = { data: void; status: 401 };\n\nexport type attachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type attachAssetResponseSuccess = attachAssetResponse204 & { headers: Headers };\nexport type attachAssetResponseError = (\n | attachAssetResponse400\n | attachAssetResponse401\n | attachAssetResponse403\n) & { headers: Headers };\n\nexport type attachAssetResponse = attachAssetResponseSuccess | attachAssetResponseError;\n\nexport const getAttachAssetUrl = (assetId: string, params?: AttachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : String(value));\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/attach?${stringifiedParams}`\n : `/asset/${assetId}/attach`;\n};\n\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 *\n * Anyone 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 * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = async (\n assetId: string,\n params?: AttachAssetParams,\n options?: RequestInit,\n): Promise<attachAssetResponse> => {\n return customFetch<attachAssetResponse>(getAttachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationKey = [\"attachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;\n\nexport type AttachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Attaches an Asset to a Merchant\n */\nexport const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n return useMutation(getAttachAssetMutationOptions(options), queryClient);\n};\nexport type detachAssetResponse204 = { data: void; status: 204 };\n\nexport type detachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type detachAssetResponse401 = { data: void; status: 401 };\n\nexport type detachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type detachAssetResponseSuccess = detachAssetResponse204 & { headers: Headers };\nexport type detachAssetResponseError = (\n | detachAssetResponse400\n | detachAssetResponse401\n | detachAssetResponse403\n) & { headers: Headers };\n\nexport type detachAssetResponse = detachAssetResponseSuccess | detachAssetResponseError;\n\nexport const getDetachAssetUrl = (assetId: string, params?: DetachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : String(value));\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/detach?${stringifiedParams}`\n : `/asset/${assetId}/detach`;\n};\n\n/**\n * Detaches an Asset from a **Merchant**\n *\n * Anyone 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 * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = async (\n assetId: string,\n params?: DetachAssetParams,\n options?: RequestInit,\n): Promise<detachAssetResponse> => {\n return customFetch<detachAssetResponse>(getDetachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationKey = [\"detachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;\n\nexport type DetachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Detaches an Asset from a Merchant\n */\nexport const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n return useMutation(getDetachAssetMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AA8CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,OAAO,eAAe,QAAQ,KAAK;GACjC,YAAY;GACZ,cAAc;GACd,WAAY,MAAkC;EAChD,CAAC;CACH;CACA,OAAO;AACT;AAmBA,MAAa,kBAAkB,WAA4B;CACzD,MAAM,mBAAmB,IAAI,gBAAgB;CAE7C,OAAO,QAAQ,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,WAAW;EACrD,IAAI,UAAU,KAAA,GACZ,iBAAiB,OAAO,KAAK,UAAU,OAAO,SAAS,OAAO,KAAK,CAAC;CAExE,CAAC;CAED,MAAM,oBAAoB,iBAAiB,SAAS;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G,QAAQ;GAAU;EAAY;CAAE,IAC/D;EAAE,UAAU,EAAE,YAAY;EAAG,SAAS,KAAA;CAAU;CAEpD,MAAM,cAGD,UAAU;EACb,MAAM,EAAE,SAAS,WAAW,SAAS,CAAC;EAEtC,OAAO,YAAY,SAAS,QAAQ,cAAc;CACpD;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AASA,MAAa,kBACX,SASA,gBAMG;CACH,QAAA,GAAA,sBAAA,YAAA,CAAmB,8BAA8B,OAAO,GAAG,WAAW;AACxE"}
|
|
1
|
+
{"version":3,"file":"asset.fetch.cjs","names":["customFetch"],"sources":["../../../src/api/asset/asset.fetch.ts"],"sourcesContent":["/**\n * Generated by orval v8.22.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n *\n * A 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.9\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n InvalidateOptions,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n AssetDetail,\n AssetGetResponse,\n AssetPatchBodyBody,\n AssetPostBodyBody,\n AssetPostResponse,\n AttachAssetParams,\n DetachAssetParams,\n GetAssetParams,\n} from \"../api-schemas\";\n\nimport { customFetch } from \"../../custom-fetch\";\nimport type { ErrorType } from \"../../custom-fetch\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\nconst withQueryKey = <T extends object, K>(query: T, queryKey: K): T & { queryKey: K } => {\n const result = { queryKey } as T & { queryKey: K };\n for (const key of Object.keys(query)) {\n // The explicit queryKey always wins, matching the previous\n // `{ ...query, queryKey }` spread where it was set last.\n if (key === \"queryKey\") continue;\n Object.defineProperty(result, key, {\n enumerable: true,\n configurable: true,\n get: () => (query as Record<string, unknown>)[key],\n });\n }\n return result;\n};\n\nexport type getAssetResponse201 = { data: AssetGetResponse; status: 201 };\n\nexport type getAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getAssetResponse401 = { data: void; status: 401 };\n\nexport type getAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getAssetResponseSuccess = getAssetResponse201 & { headers: Headers };\nexport type getAssetResponseError = (\n | getAssetResponse400\n | getAssetResponse401\n | getAssetResponse403\n) & { headers: Headers };\n\nexport type getAssetResponse = getAssetResponseSuccess | getAssetResponseError;\n\nexport const getGetAssetUrl = (params?: GetAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : String(value));\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/asset?${stringifiedParams}` : `/asset`;\n};\n\n/**\n * Gets Assets you have access to.\n * @summary Gets Assets\n */\nexport const getAsset = async (\n params?: GetAssetParams,\n options?: RequestInit,\n): Promise<getAssetResponse> => {\n return customFetch<getAssetResponse>(getGetAssetUrl(params), { ...options, method: \"GET\" });\n};\n\nexport const getGetAssetQueryKey = (params?: GetAssetParams) => {\n return [\"account-server\", \"asset\", ...(params ? [params] : [])] as const;\n};\n\nexport const getGetAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getAsset>>>;\nexport type GetAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetAsset<\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params: undefined | GetAssetParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n Awaited<ReturnType<typeof getAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAssetQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n/**\n * @summary Gets Assets\n */\nexport const invalidateGetAsset = async (\n queryClient: QueryClient,\n params?: GetAssetParams,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAssetQueryKey(params) }, options);\n\n return queryClient;\n};\n\nexport const getGetAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n params?: GetAssetParams,\n options?: {\n query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAssetQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAsset>>> = ({ signal }) =>\n getAsset(params, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAssetSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\nexport type createAssetResponse201 = { data: AssetPostResponse; status: 201 };\n\nexport type createAssetResponse400 = { data: AsError; status: 400 };\n\nexport type createAssetResponse401 = { data: void; status: 401 };\n\nexport type createAssetResponse403 = { data: AsError; status: 403 };\n\nexport type createAssetResponseSuccess = createAssetResponse201 & { headers: Headers };\nexport type createAssetResponseError = (\n | createAssetResponse400\n | createAssetResponse401\n | createAssetResponse403\n) & { headers: Headers };\n\nexport type createAssetResponse = createAssetResponseSuccess | createAssetResponseError;\n\nexport const getCreateAssetUrl = () => {\n return `/asset`;\n};\n\n/**\n * Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**. An administrator can also create an **Internal** Asset, one that is read only by the Account Server\n *\n * Assets 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 *\n * Assets must be *enabled* before they can be used.\n *\n * They 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 * @summary Create an Asset\n */\nexport const createAsset = async (\n assetPostBodyBody: AssetPostBodyBody,\n options?: RequestInit,\n): Promise<createAssetResponse> => {\n const formData = new FormData();\n formData.append(`name`, assetPostBodyBody.name);\n if (assetPostBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPostBodyBody.content_file);\n }\n if (assetPostBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPostBodyBody.content_string);\n }\n formData.append(`scope`, assetPostBodyBody.scope);\n if (assetPostBodyBody.scope_id !== undefined) {\n formData.append(`scope_id`, assetPostBodyBody.scope_id);\n }\n formData.append(`secret`, assetPostBodyBody.secret.toString());\n if (assetPostBodyBody.description !== undefined) {\n formData.append(`description`, assetPostBodyBody.description);\n }\n\n return customFetch<createAssetResponse>(getCreateAssetUrl(), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getCreateAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createAsset>>,\n { data: AssetPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createAsset(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateAssetMutationResult = NonNullable<Awaited<ReturnType<typeof createAsset>>>;\nexport type CreateAssetMutationBody = AssetPostBodyBody;\nexport type CreateAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create an Asset\n */\nexport const useCreateAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createAsset>>,\n TError,\n { data: AssetPostBodyBody },\n TContext\n> => {\n return useMutation(getCreateAssetMutationOptions(options), queryClient);\n};\nexport type getSpecificAssetResponse201 = { data: AssetDetail; status: 201 };\n\nexport type getSpecificAssetResponse400 = { data: AsError; status: 400 };\n\nexport type getSpecificAssetResponse401 = { data: void; status: 401 };\n\nexport type getSpecificAssetResponse403 = { data: AsError; status: 403 };\n\nexport type getSpecificAssetResponseSuccess = getSpecificAssetResponse201 & { headers: Headers };\nexport type getSpecificAssetResponseError = (\n | getSpecificAssetResponse400\n | getSpecificAssetResponse401\n | getSpecificAssetResponse403\n) & { headers: Headers };\n\nexport type getSpecificAssetResponse =\n | getSpecificAssetResponseSuccess\n | getSpecificAssetResponseError;\n\nexport const getGetSpecificAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\n/**\n * Gets a known Asset\n * @summary Gets an Asset\n */\nexport const getSpecificAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<getSpecificAssetResponse> => {\n return customFetch<getSpecificAssetResponse>(getGetSpecificAssetUrl(assetId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetSpecificAssetQueryKey = (assetId: string) => {\n return [\"account-server\", \"asset\", assetId] as const;\n};\n\nexport const getGetSpecificAssetQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return {\n queryKey,\n queryFn,\n enabled: assetId !== null && assetId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetSpecificAssetQueryResult = NonNullable<Awaited<ReturnType<typeof getSpecificAsset>>>;\nexport type GetSpecificAssetQueryError = ErrorType<AsError | void>;\n\nexport function useGetSpecificAsset<\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n Awaited<ReturnType<typeof getSpecificAsset>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetSpecificAssetQueryOptions(assetId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\n/**\n * @summary Gets an Asset\n */\nexport const invalidateGetSpecificAsset = async (\n queryClient: QueryClient,\n assetId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetSpecificAssetQueryKey(assetId) }, options);\n\n return queryClient;\n};\n\nexport const getGetSpecificAssetSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getSpecificAsset>>,\n TError = ErrorType<AsError | void>,\n>(\n assetId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getSpecificAsset>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetSpecificAssetQueryKey(assetId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getSpecificAsset>>> = ({ signal }) =>\n getSpecificAsset(assetId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getSpecificAsset>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, 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 customFetch>;\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 customFetch>;\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 customFetch>;\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 customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetSpecificAssetSuspenseQueryOptions(assetId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n return withQueryKey(query, queryOptions.queryKey);\n}\n\nexport type patchAssetResponse200 = { data: void; status: 200 };\n\nexport type patchAssetResponse401 = { data: void; status: 401 };\n\nexport type patchAssetResponse403 = { data: AsError; status: 403 };\n\nexport type patchAssetResponse404 = { data: AsError; status: 404 };\n\nexport type patchAssetResponseSuccess = patchAssetResponse200 & { headers: Headers };\nexport type patchAssetResponseError = (\n | patchAssetResponse401\n | patchAssetResponse403\n | patchAssetResponse404\n) & { headers: Headers };\n\nexport type patchAssetResponse = patchAssetResponseSuccess | patchAssetResponseError;\n\nexport const getPatchAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\n/**\n * Used to update or replace Asset *Content* or *Description*.\n *\n * The 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 *\n * Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.\n * @summary Adjust an existing Asset\n */\nexport const patchAsset = async (\n assetId: string,\n assetPatchBodyBody: AssetPatchBodyBody,\n options?: RequestInit,\n): Promise<patchAssetResponse> => {\n const formData = new FormData();\n if (assetPatchBodyBody.content_file !== undefined) {\n formData.append(`content_file`, assetPatchBodyBody.content_file);\n }\n if (assetPatchBodyBody.content_string !== undefined) {\n formData.append(`content_string`, assetPatchBodyBody.content_string);\n }\n if (assetPatchBodyBody.description !== undefined) {\n formData.append(`description`, assetPatchBodyBody.description);\n }\n\n return customFetch<patchAssetResponse>(getPatchAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n body: formData,\n });\n};\n\nexport const getPatchAssetMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchAsset>>,\n { assetId: string; data: AssetPatchBodyBody }\n > = (props) => {\n const { assetId, data } = props ?? {};\n\n return patchAsset(assetId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchAssetMutationResult = NonNullable<Awaited<ReturnType<typeof patchAsset>>>;\nexport type PatchAssetMutationBody = AssetPatchBodyBody;\nexport type PatchAssetMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Asset\n */\nexport const usePatchAsset = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof patchAsset>>,\n TError,\n { assetId: string; data: AssetPatchBodyBody },\n TContext\n> => {\n return useMutation(getPatchAssetMutationOptions(options), queryClient);\n};\nexport type deleteAssetResponse204 = { data: void; status: 204 };\n\nexport type deleteAssetResponse400 = { data: AsError; status: 400 };\n\nexport type deleteAssetResponse401 = { data: void; status: 401 };\n\nexport type deleteAssetResponse403 = { data: AsError; status: 403 };\n\nexport type deleteAssetResponseSuccess = deleteAssetResponse204 & { headers: Headers };\nexport type deleteAssetResponseError = (\n | deleteAssetResponse400\n | deleteAssetResponse401\n | deleteAssetResponse403\n) & { headers: Headers };\n\nexport type deleteAssetResponse = deleteAssetResponseSuccess | deleteAssetResponseError;\n\nexport const getDeleteAssetUrl = (assetId: string) => {\n return `/asset/${assetId}`;\n};\n\n/**\n * Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted\n *\n * Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.\n * @summary Deletes an Asset\n */\nexport const deleteAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<deleteAssetResponse> => {\n return customFetch<deleteAssetResponse>(getDeleteAssetUrl(assetId), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"deleteAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return deleteAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteAssetMutationResult = NonNullable<Awaited<ReturnType<typeof deleteAsset>>>;\n\nexport type DeleteAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Asset\n */\nexport const useDeleteAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n return useMutation(getDeleteAssetMutationOptions(options), queryClient);\n};\nexport type disableAssetResponse204 = { data: void; status: 204 };\n\nexport type disableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type disableAssetResponse401 = { data: void; status: 401 };\n\nexport type disableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type disableAssetResponseSuccess = disableAssetResponse204 & { headers: Headers };\nexport type disableAssetResponseError = (\n | disableAssetResponse400\n | disableAssetResponse401\n | disableAssetResponse403\n) & { headers: Headers };\n\nexport type disableAssetResponse = disableAssetResponseSuccess | disableAssetResponseError;\n\nexport const getDisableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/disable`;\n};\n\n/**\n * Disables a known Asset\n *\n * Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.\n * @summary Disables an Asset\n */\nexport const disableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<disableAssetResponse> => {\n return customFetch<disableAssetResponse>(getDisableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDisableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"disableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof disableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return disableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof disableAsset>>>;\n\nexport type DisableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Disables an Asset\n */\nexport const useDisableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n return useMutation(getDisableAssetMutationOptions(options), queryClient);\n};\nexport type enableAssetResponse204 = { data: void; status: 204 };\n\nexport type enableAssetResponse400 = { data: AsError; status: 400 };\n\nexport type enableAssetResponse401 = { data: void; status: 401 };\n\nexport type enableAssetResponse403 = { data: AsError; status: 403 };\n\nexport type enableAssetResponseSuccess = enableAssetResponse204 & { headers: Headers };\nexport type enableAssetResponseError = (\n | enableAssetResponse400\n | enableAssetResponse401\n | enableAssetResponse403\n) & { headers: Headers };\n\nexport type enableAssetResponse = enableAssetResponseSuccess | enableAssetResponseError;\n\nexport const getEnableAssetUrl = (assetId: string) => {\n return `/asset/${assetId}/enable`;\n};\n\n/**\n * Enables a known Asset\n *\n * Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.\n * @summary Enables an Asset\n */\nexport const enableAsset = async (\n assetId: string,\n options?: RequestInit,\n): Promise<enableAssetResponse> => {\n return customFetch<enableAssetResponse>(getEnableAssetUrl(assetId), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getEnableAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n const mutationKey = [\"enableAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof enableAsset>>,\n { assetId: string }\n > = (props) => {\n const { assetId } = props ?? {};\n\n return enableAsset(assetId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableAssetMutationResult = NonNullable<Awaited<ReturnType<typeof enableAsset>>>;\n\nexport type EnableAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Enables an Asset\n */\nexport const useEnableAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableAsset>>,\n TError,\n { assetId: string },\n TContext\n> => {\n return useMutation(getEnableAssetMutationOptions(options), queryClient);\n};\nexport type attachAssetResponse204 = { data: void; status: 204 };\n\nexport type attachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type attachAssetResponse401 = { data: void; status: 401 };\n\nexport type attachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type attachAssetResponseSuccess = attachAssetResponse204 & { headers: Headers };\nexport type attachAssetResponseError = (\n | attachAssetResponse400\n | attachAssetResponse401\n | attachAssetResponse403\n) & { headers: Headers };\n\nexport type attachAssetResponse = attachAssetResponseSuccess | attachAssetResponseError;\n\nexport const getAttachAssetUrl = (assetId: string, params?: AttachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : String(value));\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/attach?${stringifiedParams}`\n : `/asset/${assetId}/attach`;\n};\n\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 *\n * Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.\n * @summary Attaches an Asset to a Merchant\n */\nexport const attachAsset = async (\n assetId: string,\n params?: AttachAssetParams,\n options?: RequestInit,\n): Promise<attachAssetResponse> => {\n return customFetch<attachAssetResponse>(getAttachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getAttachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n const mutationKey = [\"attachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof attachAsset>>,\n { assetId: string; params?: AttachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return attachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AttachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof attachAsset>>>;\n\nexport type AttachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Attaches an Asset to a Merchant\n */\nexport const useAttachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof attachAsset>>,\n TError,\n { assetId: string; params?: AttachAssetParams },\n TContext\n> => {\n return useMutation(getAttachAssetMutationOptions(options), queryClient);\n};\nexport type detachAssetResponse204 = { data: void; status: 204 };\n\nexport type detachAssetResponse400 = { data: AsError; status: 400 };\n\nexport type detachAssetResponse401 = { data: void; status: 401 };\n\nexport type detachAssetResponse403 = { data: AsError; status: 403 };\n\nexport type detachAssetResponseSuccess = detachAssetResponse204 & { headers: Headers };\nexport type detachAssetResponseError = (\n | detachAssetResponse400\n | detachAssetResponse401\n | detachAssetResponse403\n) & { headers: Headers };\n\nexport type detachAssetResponse = detachAssetResponseSuccess | detachAssetResponseError;\n\nexport const getDetachAssetUrl = (assetId: string, params?: DetachAssetParams) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n if (value !== undefined) {\n normalizedParams.append(key, value === null ? \"null\" : String(value));\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0\n ? `/asset/${assetId}/detach?${stringifiedParams}`\n : `/asset/${assetId}/detach`;\n};\n\n/**\n * Detaches an Asset from a **Merchant**\n *\n * Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.\n * @summary Detaches an Asset from a Merchant\n */\nexport const detachAsset = async (\n assetId: string,\n params?: DetachAssetParams,\n options?: RequestInit,\n): Promise<detachAssetResponse> => {\n return customFetch<detachAssetResponse>(getDetachAssetUrl(assetId, params), {\n ...options,\n method: \"PATCH\",\n });\n};\n\nexport const getDetachAssetMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n const mutationKey = [\"detachAsset\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof detachAsset>>,\n { assetId: string; params?: DetachAssetParams }\n > = (props) => {\n const { assetId, params } = props ?? {};\n\n return detachAsset(assetId, params, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DetachAssetMutationResult = NonNullable<Awaited<ReturnType<typeof detachAsset>>>;\n\nexport type DetachAssetMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Detaches an Asset from a Merchant\n */\nexport const useDetachAsset = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof detachAsset>>,\n TError,\n { assetId: string; params?: DetachAssetParams },\n TContext\n> => {\n return useMutation(getDetachAssetMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AA8CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAA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AAO,kBAAkB,SAAS,IAC9B,UAAU,QAAQ,UAAU,sBAC5B,UAAU,QAAQ;AACxB;;;;;;;AAQA,MAAa,cAAc,OACzB,SACA,QACA,YACiC;CACjC,OAAOA,qBAAAA,YAAiC,kBAAkB,SAAS,MAAM,GAAG;EAC1E,GAAG;EACH,QAAQ;CACV,CAAC;AACH;AAEA,MAAa,iCAGX,YAaG;CACH,MAAM,cAAc,CAAC,aAAa;CAClC,MAAM,EAAE,UAAU,iBAAiB,SAAS,mBAAmB,UAC3D,QAAQ,YAAY,iBAAiB,QAAQ,YAAY,QAAQ,SAAS,cACxE,UACA;EAAE,GAAG;EAAS,UAAU;GAAE,GAAG,QAAQ;GAAU;EAAY;CAAE,IAC/D;EAAE,UAAU,EAAE,YAAY;EAAG,SAAS,KAAA;CAAU;CAEpD,MAAM,cAGD,UAAU;EACb,MAAM,EAAE,SAAS,WAAW,SAAS,CAAC;EAEtC,OAAO,YAAY,SAAS,QAAQ,cAAc;CACpD;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AASA,MAAa,kBACX,SASA,gBAMG;CACH,QAAA,GAAA,sBAAA,YAAA,CAAmB,8BAA8B,OAAO,GAAG,WAAW;AACxE"}
|
|
@@ -123,7 +123,7 @@ type createAssetResponseError = (createAssetResponse400 | createAssetResponse401
|
|
|
123
123
|
type createAssetResponse = createAssetResponseSuccess | createAssetResponseError;
|
|
124
124
|
declare const getCreateAssetUrl: () => string;
|
|
125
125
|
/**
|
|
126
|
-
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**
|
|
126
|
+
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**. An administrator can also create an **Internal** Asset, one that is read only by the Account Server
|
|
127
127
|
*
|
|
128
128
|
* Assets 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**.
|
|
129
129
|
*
|
|
@@ -270,7 +270,7 @@ declare const getPatchAssetUrl: (assetId: string) => string;
|
|
|
270
270
|
*
|
|
271
271
|
* The 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.
|
|
272
272
|
*
|
|
273
|
-
* Anyone 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.
|
|
273
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
274
274
|
* @summary Adjust an existing Asset
|
|
275
275
|
*/
|
|
276
276
|
declare const patchAsset: (assetId: string, assetPatchBodyBody: AssetPatchBodyBody, options?: RequestInit) => Promise<patchAssetResponse>;
|
|
@@ -327,7 +327,7 @@ declare const getDeleteAssetUrl: (assetId: string) => string;
|
|
|
327
327
|
/**
|
|
328
328
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
329
329
|
*
|
|
330
|
-
* Anyone 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.
|
|
330
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
331
331
|
* @summary Deletes an Asset
|
|
332
332
|
*/
|
|
333
333
|
declare const deleteAsset: (assetId: string, options?: RequestInit) => Promise<deleteAssetResponse>;
|
|
@@ -379,7 +379,7 @@ declare const getDisableAssetUrl: (assetId: string) => string;
|
|
|
379
379
|
/**
|
|
380
380
|
* Disables a known Asset
|
|
381
381
|
*
|
|
382
|
-
* Anyone 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.
|
|
382
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
383
383
|
* @summary Disables an Asset
|
|
384
384
|
*/
|
|
385
385
|
declare const disableAsset: (assetId: string, options?: RequestInit) => Promise<disableAssetResponse>;
|
|
@@ -431,7 +431,7 @@ declare const getEnableAssetUrl: (assetId: string) => string;
|
|
|
431
431
|
/**
|
|
432
432
|
* Enables a known Asset
|
|
433
433
|
*
|
|
434
|
-
* Anyone 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.
|
|
434
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
435
435
|
* @summary Enables an Asset
|
|
436
436
|
*/
|
|
437
437
|
declare const enableAsset: (assetId: string, options?: RequestInit) => Promise<enableAssetResponse>;
|
|
@@ -483,7 +483,7 @@ declare const getAttachAssetUrl: (assetId: string, params?: AttachAssetParams) =
|
|
|
483
483
|
/**
|
|
484
484
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
485
485
|
*
|
|
486
|
-
* Anyone 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.
|
|
486
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
487
487
|
* @summary Attaches an Asset to a Merchant
|
|
488
488
|
*/
|
|
489
489
|
declare const attachAsset: (assetId: string, params?: AttachAssetParams, options?: RequestInit) => Promise<attachAssetResponse>;
|
|
@@ -539,7 +539,7 @@ declare const getDetachAssetUrl: (assetId: string, params?: DetachAssetParams) =
|
|
|
539
539
|
/**
|
|
540
540
|
* Detaches an Asset from a **Merchant**
|
|
541
541
|
*
|
|
542
|
-
* Anyone 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.
|
|
542
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
543
543
|
* @summary Detaches an Asset from a Merchant
|
|
544
544
|
*/
|
|
545
545
|
declare const detachAsset: (assetId: string, params?: DetachAssetParams, options?: RequestInit) => Promise<detachAssetResponse>;
|
|
@@ -123,7 +123,7 @@ type createAssetResponseError = (createAssetResponse400 | createAssetResponse401
|
|
|
123
123
|
type createAssetResponse = createAssetResponseSuccess | createAssetResponseError;
|
|
124
124
|
declare const getCreateAssetUrl: () => string;
|
|
125
125
|
/**
|
|
126
|
-
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**
|
|
126
|
+
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**. An administrator can also create an **Internal** Asset, one that is read only by the Account Server
|
|
127
127
|
*
|
|
128
128
|
* Assets 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**.
|
|
129
129
|
*
|
|
@@ -270,7 +270,7 @@ declare const getPatchAssetUrl: (assetId: string) => string;
|
|
|
270
270
|
*
|
|
271
271
|
* The 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.
|
|
272
272
|
*
|
|
273
|
-
* Anyone 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.
|
|
273
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
274
274
|
* @summary Adjust an existing Asset
|
|
275
275
|
*/
|
|
276
276
|
declare const patchAsset: (assetId: string, assetPatchBodyBody: AssetPatchBodyBody, options?: RequestInit) => Promise<patchAssetResponse>;
|
|
@@ -327,7 +327,7 @@ declare const getDeleteAssetUrl: (assetId: string) => string;
|
|
|
327
327
|
/**
|
|
328
328
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
329
329
|
*
|
|
330
|
-
* Anyone 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.
|
|
330
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
331
331
|
* @summary Deletes an Asset
|
|
332
332
|
*/
|
|
333
333
|
declare const deleteAsset: (assetId: string, options?: RequestInit) => Promise<deleteAssetResponse>;
|
|
@@ -379,7 +379,7 @@ declare const getDisableAssetUrl: (assetId: string) => string;
|
|
|
379
379
|
/**
|
|
380
380
|
* Disables a known Asset
|
|
381
381
|
*
|
|
382
|
-
* Anyone 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.
|
|
382
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
383
383
|
* @summary Disables an Asset
|
|
384
384
|
*/
|
|
385
385
|
declare const disableAsset: (assetId: string, options?: RequestInit) => Promise<disableAssetResponse>;
|
|
@@ -431,7 +431,7 @@ declare const getEnableAssetUrl: (assetId: string) => string;
|
|
|
431
431
|
/**
|
|
432
432
|
* Enables a known Asset
|
|
433
433
|
*
|
|
434
|
-
* Anyone 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.
|
|
434
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
435
435
|
* @summary Enables an Asset
|
|
436
436
|
*/
|
|
437
437
|
declare const enableAsset: (assetId: string, options?: RequestInit) => Promise<enableAssetResponse>;
|
|
@@ -483,7 +483,7 @@ declare const getAttachAssetUrl: (assetId: string, params?: AttachAssetParams) =
|
|
|
483
483
|
/**
|
|
484
484
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
485
485
|
*
|
|
486
|
-
* Anyone 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.
|
|
486
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
487
487
|
* @summary Attaches an Asset to a Merchant
|
|
488
488
|
*/
|
|
489
489
|
declare const attachAsset: (assetId: string, params?: AttachAssetParams, options?: RequestInit) => Promise<attachAssetResponse>;
|
|
@@ -539,7 +539,7 @@ declare const getDetachAssetUrl: (assetId: string, params?: DetachAssetParams) =
|
|
|
539
539
|
/**
|
|
540
540
|
* Detaches an Asset from a **Merchant**
|
|
541
541
|
*
|
|
542
|
-
* Anyone 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.
|
|
542
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
543
543
|
* @summary Detaches an Asset from a Merchant
|
|
544
544
|
*/
|
|
545
545
|
declare const detachAsset: (assetId: string, params?: DetachAssetParams, options?: RequestInit) => Promise<detachAssetResponse>;
|
|
@@ -99,7 +99,7 @@ const getCreateAssetUrl = () => {
|
|
|
99
99
|
return `/asset`;
|
|
100
100
|
};
|
|
101
101
|
/**
|
|
102
|
-
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**
|
|
102
|
+
* Creates an Asset, which can be attached to a **User** account, a **Product**, **Unit**, **Organisation** or can be made **Global**. An administrator can also create an **Internal** Asset, one that is read only by the Account Server
|
|
103
103
|
*
|
|
104
104
|
* Assets 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**.
|
|
105
105
|
*
|
|
@@ -226,7 +226,7 @@ const getPatchAssetUrl = (assetId) => {
|
|
|
226
226
|
*
|
|
227
227
|
* The 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.
|
|
228
228
|
*
|
|
229
|
-
* Anyone 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.
|
|
229
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
230
230
|
* @summary Adjust an existing Asset
|
|
231
231
|
*/
|
|
232
232
|
const patchAsset = async (assetId, assetPatchBodyBody, options) => {
|
|
@@ -273,7 +273,7 @@ const getDeleteAssetUrl = (assetId) => {
|
|
|
273
273
|
/**
|
|
274
274
|
* Deletes a known Asset. Assets that are attached to **Merchants** cannot be deleted
|
|
275
275
|
*
|
|
276
|
-
* Anyone 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.
|
|
276
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
277
277
|
* @summary Deletes an Asset
|
|
278
278
|
*/
|
|
279
279
|
const deleteAsset = async (assetId, options) => {
|
|
@@ -315,7 +315,7 @@ const getDisableAssetUrl = (assetId) => {
|
|
|
315
315
|
/**
|
|
316
316
|
* Disables a known Asset
|
|
317
317
|
*
|
|
318
|
-
* Anyone 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.
|
|
318
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
319
319
|
* @summary Disables an Asset
|
|
320
320
|
*/
|
|
321
321
|
const disableAsset = async (assetId, options) => {
|
|
@@ -357,7 +357,7 @@ const getEnableAssetUrl = (assetId) => {
|
|
|
357
357
|
/**
|
|
358
358
|
* Enables a known Asset
|
|
359
359
|
*
|
|
360
|
-
* Anyone 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.
|
|
360
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
361
361
|
* @summary Enables an Asset
|
|
362
362
|
*/
|
|
363
363
|
const enableAsset = async (assetId, options) => {
|
|
@@ -404,7 +404,7 @@ const getAttachAssetUrl = (assetId, params) => {
|
|
|
404
404
|
/**
|
|
405
405
|
* Attaches an Asset to a **Merchant**. This allows the **Merchant** to query the Asset. **Merchants** cannot obtain Assets that are not attached to them.
|
|
406
406
|
*
|
|
407
|
-
* Anyone 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.
|
|
407
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
408
408
|
* @summary Attaches an Asset to a Merchant
|
|
409
409
|
*/
|
|
410
410
|
const attachAsset = async (assetId, params, options) => {
|
|
@@ -451,7 +451,7 @@ const getDetachAssetUrl = (assetId, params) => {
|
|
|
451
451
|
/**
|
|
452
452
|
* Detaches an Asset from a **Merchant**
|
|
453
453
|
*
|
|
454
|
-
* Anyone 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.
|
|
454
|
+
* Anyone 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. Only administrators can alter `INTERNAL` assets. Administrators can patch any asset.
|
|
455
455
|
* @summary Detaches an Asset from a Merchant
|
|
456
456
|
*/
|
|
457
457
|
const detachAsset = async (assetId, params, options) => {
|