@squonk/account-server-client 4.9.0-rc.2 → 4.9.0

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.
@@ -130,7 +130,7 @@ const useLoadCapabilities = (options, queryClient) => {
130
130
  /**
131
131
  * Gets the Capabilities loaded against an Organisation.
132
132
  *
133
- * You need admin rights to use this path.
133
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
134
134
  * @summary Gets an Organisation's Capabilities
135
135
  */
136
136
  const getCapabilities = (orgId, options, signal) => {
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.cjs","names":["customInstance"],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\n} from \"../api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\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\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AllCapabilitiesGetResponse>(\n { url: `/capability`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customInstance<CapabilityPostResponse>(\n {\n url: `/capability/${orgId}`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\n );\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights to use this path.\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<CapabilitiesGetResponse>(\n { url: `/capability/${orgId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}`, method: \"DELETE\", signal },\n options,\n );\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/enable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/disable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AA0CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,Q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;EAAE,UAAU,EAAE,YAAY;EAAG,SAAS,KAAA;CAAU;CAEpD,MAAM,cAGD,UAAU;EACb,MAAM,EAAE,OAAO,mBAAmB,SAAS,CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,QAAA,GAAA,sBAAA,YAAA,CAAmB,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
1
+ {"version":3,"file":"capabilities.cjs","names":["customInstance"],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\n} from \"../api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\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\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AllCapabilitiesGetResponse>(\n { url: `/capability`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customInstance<CapabilityPostResponse>(\n {\n url: `/capability/${orgId}`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\n );\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<CapabilitiesGetResponse>(\n { url: `/capability/${orgId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}`, method: \"DELETE\", signal },\n options,\n );\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/enable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/disable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AA0CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,MAAM,SAAS,EAAE,SAAS;CAC1B,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG;EAGpC,IAAI,QAAQ,YAAY;EACxB,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,YAAY;EAAG,SAAS,KAAA;CAAU;CAEpD,MAAM,cAGD,UAAU;EACb,MAAM,EAAE,OAAO,mBAAmB,SAAS,CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,QAAA,GAAA,sBAAA,YAAA,CAAmB,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
@@ -110,7 +110,7 @@ declare const useLoadCapabilities: <TError = ErrorType<AsError | void>, TContext
110
110
  /**
111
111
  * Gets the Capabilities loaded against an Organisation.
112
112
  *
113
- * You need admin rights to use this path.
113
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
114
114
  * @summary Gets an Organisation's Capabilities
115
115
  */
116
116
  declare const getCapabilities: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<CapabilitiesGetResponse>;
@@ -110,7 +110,7 @@ declare const useLoadCapabilities: <TError = ErrorType<AsError | void>, TContext
110
110
  /**
111
111
  * Gets the Capabilities loaded against an Organisation.
112
112
  *
113
- * You need admin rights to use this path.
113
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
114
114
  * @summary Gets an Organisation's Capabilities
115
115
  */
116
116
  declare const getCapabilities: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<CapabilitiesGetResponse>;
@@ -142,7 +142,7 @@ const getGetCapabilitiesUrl = (orgId) => {
142
142
  /**
143
143
  * Gets the Capabilities loaded against an Organisation.
144
144
  *
145
- * You need admin rights to use this path.
145
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
146
146
  * @summary Gets an Organisation's Capabilities
147
147
  */
148
148
  const getCapabilities = async (orgId, options) => {
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.fetch.cjs","names":["customFetch"],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\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 getAllCapabilitiesResponse200 = { data: AllCapabilitiesGetResponse; status: 200 };\n\nexport type getAllCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getAllCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getAllCapabilitiesResponseSuccess = getAllCapabilitiesResponse200 & {\n headers: Headers;\n};\nexport type getAllCapabilitiesResponseError = (\n | getAllCapabilitiesResponse401\n | getAllCapabilitiesResponse403\n) & { headers: Headers };\n\nexport type getAllCapabilitiesResponse =\n | getAllCapabilitiesResponseSuccess\n | getAllCapabilitiesResponseError;\n\nexport const getGetAllCapabilitiesUrl = () => {\n return `/capability`;\n};\n\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = async (\n options?: RequestInit,\n): Promise<getAllCapabilitiesResponse> => {\n return customFetch<getAllCapabilitiesResponse>(getGetAllCapabilitiesUrl(), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, 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 the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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 loadCapabilitiesResponse201 = { data: CapabilityPostResponse; status: 201 };\n\nexport type loadCapabilitiesResponse400 = { data: AsError; status: 400 };\n\nexport type loadCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type loadCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type loadCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type loadCapabilitiesResponse409 = { data: AsError; status: 409 };\n\nexport type loadCapabilitiesResponse422 = { data: AsError; status: 422 };\n\nexport type loadCapabilitiesResponseSuccess = loadCapabilitiesResponse201 & { headers: Headers };\nexport type loadCapabilitiesResponseError = (\n | loadCapabilitiesResponse400\n | loadCapabilitiesResponse401\n | loadCapabilitiesResponse403\n | loadCapabilitiesResponse404\n | loadCapabilitiesResponse409\n | loadCapabilitiesResponse422\n) & { headers: Headers };\n\nexport type loadCapabilitiesResponse =\n | loadCapabilitiesResponseSuccess\n | loadCapabilitiesResponseError;\n\nexport const getLoadCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = async (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: RequestInit,\n): Promise<loadCapabilitiesResponse> => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customFetch<loadCapabilitiesResponse>(getLoadCapabilitiesUrl(orgId), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\nexport type getCapabilitiesResponse200 = { data: CapabilitiesGetResponse; status: 200 };\n\nexport type getCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type getCapabilitiesResponseSuccess = getCapabilitiesResponse200 & { headers: Headers };\nexport type getCapabilitiesResponseError = (\n | getCapabilitiesResponse401\n | getCapabilitiesResponse403\n | getCapabilitiesResponse404\n) & { headers: Headers };\n\nexport type getCapabilitiesResponse = getCapabilitiesResponseSuccess | getCapabilitiesResponseError;\n\nexport const getGetCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights to use this path.\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = async (\n orgId: string,\n options?: RequestInit,\n): Promise<getCapabilitiesResponse> => {\n return customFetch<getCapabilitiesResponse>(getGetCapabilitiesUrl(orgId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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 deleteCapabilityResponse204 = { data: void; status: 204 };\n\nexport type deleteCapabilityResponse401 = { data: void; status: 401 };\n\nexport type deleteCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type deleteCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type deleteCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type deleteCapabilityResponseSuccess = deleteCapabilityResponse204 & { headers: Headers };\nexport type deleteCapabilityResponseError = (\n | deleteCapabilityResponse401\n | deleteCapabilityResponse403\n | deleteCapabilityResponse404\n | deleteCapabilityResponse422\n) & { headers: Headers };\n\nexport type deleteCapabilityResponse =\n | deleteCapabilityResponseSuccess\n | deleteCapabilityResponseError;\n\nexport const getDeleteCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}`;\n};\n\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<deleteCapabilityResponse> => {\n return customFetch<deleteCapabilityResponse>(getDeleteCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\nexport type enableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type enableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type enableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type enableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type enableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type enableCapabilityResponseSuccess = enableCapabilityResponse204 & { headers: Headers };\nexport type enableCapabilityResponseError = (\n | enableCapabilityResponse401\n | enableCapabilityResponse403\n | enableCapabilityResponse404\n | enableCapabilityResponse422\n) & { headers: Headers };\n\nexport type enableCapabilityResponse =\n | enableCapabilityResponseSuccess\n | enableCapabilityResponseError;\n\nexport const getEnableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/enable`;\n};\n\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<enableCapabilityResponse> => {\n return customFetch<enableCapabilityResponse>(getEnableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\nexport type disableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type disableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type disableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type disableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type disableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type disableCapabilityResponseSuccess = disableCapabilityResponse204 & { headers: Headers };\nexport type disableCapabilityResponseError = (\n | disableCapabilityResponse401\n | disableCapabilityResponse403\n | disableCapabilityResponse404\n | disableCapabilityResponse422\n) & { headers: Headers };\n\nexport type disableCapabilityResponse =\n | disableCapabilityResponseSuccess\n | disableCapabilityResponseError;\n\nexport const getDisableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/disable`;\n};\n\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<disableCapabilityResponse> => {\n return customFetch<disableCapabilityResponse>(getDisableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AA0CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,M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,QAAA,GAAA,sBAAA,YAAA,CAAmB,mCAAmC,OAAO,GAAG,WAAW;AAC7E;AAuBA,MAAa,2BAA2B,OAAe,mBAA2B;CAChF,OAAO,eAAe,MAAM,GAAG,eAAe;AAChD;;;;;;;AAQA,MAAa,oBAAoB,OAC/B,OACA,gBACA,YACuC;CACvC,OAAOA,qBAAAA,YAAuC,wBAAwB,OAAO,cAAc,GAAG;EAC5F,GAAG;EACH,QAAQ;CACV,CAAC;AACH;AAEA,MAAa,uCAGX,YAaG;CACH,MAAM,cAAc,CAAC,mBAAmB;CACxC,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,OAAO,mBAAmB,SAAS,CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,QAAA,GAAA,sBAAA,YAAA,CAAmB,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
1
+ {"version":3,"file":"capabilities.fetch.cjs","names":["customFetch"],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\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 getAllCapabilitiesResponse200 = { data: AllCapabilitiesGetResponse; status: 200 };\n\nexport type getAllCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getAllCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getAllCapabilitiesResponseSuccess = getAllCapabilitiesResponse200 & {\n headers: Headers;\n};\nexport type getAllCapabilitiesResponseError = (\n | getAllCapabilitiesResponse401\n | getAllCapabilitiesResponse403\n) & { headers: Headers };\n\nexport type getAllCapabilitiesResponse =\n | getAllCapabilitiesResponseSuccess\n | getAllCapabilitiesResponseError;\n\nexport const getGetAllCapabilitiesUrl = () => {\n return `/capability`;\n};\n\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = async (\n options?: RequestInit,\n): Promise<getAllCapabilitiesResponse> => {\n return customFetch<getAllCapabilitiesResponse>(getGetAllCapabilitiesUrl(), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, 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 the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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 loadCapabilitiesResponse201 = { data: CapabilityPostResponse; status: 201 };\n\nexport type loadCapabilitiesResponse400 = { data: AsError; status: 400 };\n\nexport type loadCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type loadCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type loadCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type loadCapabilitiesResponse409 = { data: AsError; status: 409 };\n\nexport type loadCapabilitiesResponse422 = { data: AsError; status: 422 };\n\nexport type loadCapabilitiesResponseSuccess = loadCapabilitiesResponse201 & { headers: Headers };\nexport type loadCapabilitiesResponseError = (\n | loadCapabilitiesResponse400\n | loadCapabilitiesResponse401\n | loadCapabilitiesResponse403\n | loadCapabilitiesResponse404\n | loadCapabilitiesResponse409\n | loadCapabilitiesResponse422\n) & { headers: Headers };\n\nexport type loadCapabilitiesResponse =\n | loadCapabilitiesResponseSuccess\n | loadCapabilitiesResponseError;\n\nexport const getLoadCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = async (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: RequestInit,\n): Promise<loadCapabilitiesResponse> => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customFetch<loadCapabilitiesResponse>(getLoadCapabilitiesUrl(orgId), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\nexport type getCapabilitiesResponse200 = { data: CapabilitiesGetResponse; status: 200 };\n\nexport type getCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type getCapabilitiesResponseSuccess = getCapabilitiesResponse200 & { headers: Headers };\nexport type getCapabilitiesResponseError = (\n | getCapabilitiesResponse401\n | getCapabilitiesResponse403\n | getCapabilitiesResponse404\n) & { headers: Headers };\n\nexport type getCapabilitiesResponse = getCapabilitiesResponseSuccess | getCapabilitiesResponseError;\n\nexport const getGetCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = async (\n orgId: string,\n options?: RequestInit,\n): Promise<getCapabilitiesResponse> => {\n return customFetch<getCapabilitiesResponse>(getGetCapabilitiesUrl(orgId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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 deleteCapabilityResponse204 = { data: void; status: 204 };\n\nexport type deleteCapabilityResponse401 = { data: void; status: 401 };\n\nexport type deleteCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type deleteCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type deleteCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type deleteCapabilityResponseSuccess = deleteCapabilityResponse204 & { headers: Headers };\nexport type deleteCapabilityResponseError = (\n | deleteCapabilityResponse401\n | deleteCapabilityResponse403\n | deleteCapabilityResponse404\n | deleteCapabilityResponse422\n) & { headers: Headers };\n\nexport type deleteCapabilityResponse =\n | deleteCapabilityResponseSuccess\n | deleteCapabilityResponseError;\n\nexport const getDeleteCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}`;\n};\n\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<deleteCapabilityResponse> => {\n return customFetch<deleteCapabilityResponse>(getDeleteCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\nexport type enableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type enableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type enableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type enableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type enableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type enableCapabilityResponseSuccess = enableCapabilityResponse204 & { headers: Headers };\nexport type enableCapabilityResponseError = (\n | enableCapabilityResponse401\n | enableCapabilityResponse403\n | enableCapabilityResponse404\n | enableCapabilityResponse422\n) & { headers: Headers };\n\nexport type enableCapabilityResponse =\n | enableCapabilityResponseSuccess\n | enableCapabilityResponseError;\n\nexport const getEnableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/enable`;\n};\n\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<enableCapabilityResponse> => {\n return customFetch<enableCapabilityResponse>(getEnableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\nexport type disableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type disableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type disableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type disableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type disableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type disableCapabilityResponseSuccess = disableCapabilityResponse204 & { headers: Headers };\nexport type disableCapabilityResponseError = (\n | disableCapabilityResponse401\n | disableCapabilityResponse403\n | disableCapabilityResponse404\n | disableCapabilityResponse422\n) & { headers: Headers };\n\nexport type disableCapabilityResponse =\n | disableCapabilityResponseSuccess\n | disableCapabilityResponseError;\n\nexport const getDisableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/disable`;\n};\n\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<disableCapabilityResponse> => {\n return customFetch<disableCapabilityResponse>(getDisableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;;AA0CA,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;AAoBA,MAAa,iCAAiC;CAC5C,OAAO;AACT;;;;;;;AAQA,MAAa,qBAAqB,OAChC,YACwC;CACxC,OAAOA,qBAAAA,YAAwC,yBAAyB,GAAG;E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,cAAc,CAAC,mBAAmB;CACxC,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,OAAO,mBAAmB,SAAS,CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,QAAA,GAAA,sBAAA,YAAA,CAAmB,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
@@ -190,7 +190,7 @@ declare const getGetCapabilitiesUrl: (orgId: string) => string;
190
190
  /**
191
191
  * Gets the Capabilities loaded against an Organisation.
192
192
  *
193
- * You need admin rights to use this path.
193
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
194
194
  * @summary Gets an Organisation's Capabilities
195
195
  */
196
196
  declare const getCapabilities: (orgId: string, options?: RequestInit) => Promise<getCapabilitiesResponse>;
@@ -190,7 +190,7 @@ declare const getGetCapabilitiesUrl: (orgId: string) => string;
190
190
  /**
191
191
  * Gets the Capabilities loaded against an Organisation.
192
192
  *
193
- * You need admin rights to use this path.
193
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
194
194
  * @summary Gets an Organisation's Capabilities
195
195
  */
196
196
  declare const getCapabilities: (orgId: string, options?: RequestInit) => Promise<getCapabilitiesResponse>;
@@ -141,7 +141,7 @@ const getGetCapabilitiesUrl = (orgId) => {
141
141
  /**
142
142
  * Gets the Capabilities loaded against an Organisation.
143
143
  *
144
- * You need admin rights to use this path.
144
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
145
145
  * @summary Gets an Organisation's Capabilities
146
146
  */
147
147
  const getCapabilities = async (orgId, options) => {
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.fetch.js","names":[],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\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 getAllCapabilitiesResponse200 = { data: AllCapabilitiesGetResponse; status: 200 };\n\nexport type getAllCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getAllCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getAllCapabilitiesResponseSuccess = getAllCapabilitiesResponse200 & {\n headers: Headers;\n};\nexport type getAllCapabilitiesResponseError = (\n | getAllCapabilitiesResponse401\n | getAllCapabilitiesResponse403\n) & { headers: Headers };\n\nexport type getAllCapabilitiesResponse =\n | getAllCapabilitiesResponseSuccess\n | getAllCapabilitiesResponseError;\n\nexport const getGetAllCapabilitiesUrl = () => {\n return `/capability`;\n};\n\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = async (\n options?: RequestInit,\n): Promise<getAllCapabilitiesResponse> => {\n return customFetch<getAllCapabilitiesResponse>(getGetAllCapabilitiesUrl(), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, 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 the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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 loadCapabilitiesResponse201 = { data: CapabilityPostResponse; status: 201 };\n\nexport type loadCapabilitiesResponse400 = { data: AsError; status: 400 };\n\nexport type loadCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type loadCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type loadCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type loadCapabilitiesResponse409 = { data: AsError; status: 409 };\n\nexport type loadCapabilitiesResponse422 = { data: AsError; status: 422 };\n\nexport type loadCapabilitiesResponseSuccess = loadCapabilitiesResponse201 & { headers: Headers };\nexport type loadCapabilitiesResponseError = (\n | loadCapabilitiesResponse400\n | loadCapabilitiesResponse401\n | loadCapabilitiesResponse403\n | loadCapabilitiesResponse404\n | loadCapabilitiesResponse409\n | loadCapabilitiesResponse422\n) & { headers: Headers };\n\nexport type loadCapabilitiesResponse =\n | loadCapabilitiesResponseSuccess\n | loadCapabilitiesResponseError;\n\nexport const getLoadCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = async (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: RequestInit,\n): Promise<loadCapabilitiesResponse> => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customFetch<loadCapabilitiesResponse>(getLoadCapabilitiesUrl(orgId), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\nexport type getCapabilitiesResponse200 = { data: CapabilitiesGetResponse; status: 200 };\n\nexport type getCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type getCapabilitiesResponseSuccess = getCapabilitiesResponse200 & { headers: Headers };\nexport type getCapabilitiesResponseError = (\n | getCapabilitiesResponse401\n | getCapabilitiesResponse403\n | getCapabilitiesResponse404\n) & { headers: Headers };\n\nexport type getCapabilitiesResponse = getCapabilitiesResponseSuccess | getCapabilitiesResponseError;\n\nexport const getGetCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights to use this path.\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = async (\n orgId: string,\n options?: RequestInit,\n): Promise<getCapabilitiesResponse> => {\n return customFetch<getCapabilitiesResponse>(getGetCapabilitiesUrl(orgId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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 deleteCapabilityResponse204 = { data: void; status: 204 };\n\nexport type deleteCapabilityResponse401 = { data: void; status: 401 };\n\nexport type deleteCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type deleteCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type deleteCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type deleteCapabilityResponseSuccess = deleteCapabilityResponse204 & { headers: Headers };\nexport type deleteCapabilityResponseError = (\n | deleteCapabilityResponse401\n | deleteCapabilityResponse403\n | deleteCapabilityResponse404\n | deleteCapabilityResponse422\n) & { headers: Headers };\n\nexport type deleteCapabilityResponse =\n | deleteCapabilityResponseSuccess\n | deleteCapabilityResponseError;\n\nexport const getDeleteCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}`;\n};\n\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<deleteCapabilityResponse> => {\n return customFetch<deleteCapabilityResponse>(getDeleteCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\nexport type enableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type enableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type enableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type enableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type enableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type enableCapabilityResponseSuccess = enableCapabilityResponse204 & { headers: Headers };\nexport type enableCapabilityResponseError = (\n | enableCapabilityResponse401\n | enableCapabilityResponse403\n | enableCapabilityResponse404\n | enableCapabilityResponse422\n) & { headers: Headers };\n\nexport type enableCapabilityResponse =\n | enableCapabilityResponseSuccess\n | enableCapabilityResponseError;\n\nexport const getEnableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/enable`;\n};\n\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<enableCapabilityResponse> => {\n return customFetch<enableCapabilityResponse>(getEnableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\nexport type disableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type disableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type disableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type disableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type disableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type disableCapabilityResponseSuccess = disableCapabilityResponse204 & { headers: Headers };\nexport type disableCapabilityResponseError = (\n | disableCapabilityResponse401\n | disableCapabilityResponse403\n | disableCapabilityResponse404\n | disableCapabilityResponse422\n) & { headers: Headers };\n\nexport type disableCapabilityResponse =\n | disableCapabilityResponseSuccess\n | disableCapabilityResponseError;\n\nexport const getDisableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/disable`;\n};\n\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<disableCapabilityResponse> => {\n return customFetch<disableCapabilityResponse>(getDisableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,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;AAoBA,MAAa,iCAAiC;CAC5C,OAAO;AACT;;;;;;;AAQA,MAAa,qBAAqB,OAChC,YACwC;CACxC,OAAO,YAAwC,yBAAyB,GAAG;EACzE,GAAG;EACH,QAAQ;CACV,CAAC;AACH;AAEA,MAAa,sCAAsC;CACjD,OAAO,CAAC,kBAAkB,YAAY;AACxC;AAEA,MAAa,qCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;CAErE,MAAM,WAAW,cAAc,YAAY,8BAA8B;CAEzE,MAAM,WAA0E,EAAE,aAChF,mBAAmB;EAAE;EAAQ,GAAG;CAAe,CAAC;CAElD,OAAO;EAAE;EAAU;EAAS,GAAG;CAAa;AAK9C;;;;AA2DA,SAAgB,sBAId,SAIA,aACgF;CAChF,MAAM,eAAe,kCAAkC,OAAO;CAM9D,OAAO,aAJO,SAAS,cAAc,WAIb,GAAG,aAAa,QAAQ;AAClD;;;;AAKA,MAAa,+BAA+B,OAC1C,aACA,YACyB;CACzB,MAAM,YAAY,kBAAkB,EAAE,UAAU,8BAA8B,EAAE,GAAG,OAAO;CAE1F,OAAO;AACT;AAEA,MAAa,6CAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,CAAC;CAErE,MAAM,WAAW,cAAc,YAAY,8BAA8B;CAEzE,MAAM,WAA0E,EAAE,aAChF,mBAAmB;EAAE;EAAQ,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O,GAAG,WAAW;AAC7E;AAuBA,MAAa,2BAA2B,OAAe,mBAA2B;CAChF,OAAO,eAAe,MAAM,GAAG,eAAe;AAChD;;;;;;;AAQA,MAAa,oBAAoB,OAC/B,OACA,gBACA,YACuC;CACvC,OAAO,YAAuC,wBAAwB,OAAO,cAAc,GAAG;EAC5F,GAAG;EACH,QAAQ;CACV,CAAC;AACH;AAEA,MAAa,uCAGX,YAaG;CACH,MAAM,cAAc,CAAC,mBAAmB;CACxC,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,OAAO,mBAAmB,SAAS,CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,OAAO,YAAY,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
1
+ {"version":3,"file":"capabilities.fetch.js","names":[],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\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 getAllCapabilitiesResponse200 = { data: AllCapabilitiesGetResponse; status: 200 };\n\nexport type getAllCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getAllCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getAllCapabilitiesResponseSuccess = getAllCapabilitiesResponse200 & {\n headers: Headers;\n};\nexport type getAllCapabilitiesResponseError = (\n | getAllCapabilitiesResponse401\n | getAllCapabilitiesResponse403\n) & { headers: Headers };\n\nexport type getAllCapabilitiesResponse =\n | getAllCapabilitiesResponseSuccess\n | getAllCapabilitiesResponseError;\n\nexport const getGetAllCapabilitiesUrl = () => {\n return `/capability`;\n};\n\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = async (\n options?: RequestInit,\n): Promise<getAllCapabilitiesResponse> => {\n return customFetch<getAllCapabilitiesResponse>(getGetAllCapabilitiesUrl(), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities({ signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, 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 the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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 loadCapabilitiesResponse201 = { data: CapabilityPostResponse; status: 201 };\n\nexport type loadCapabilitiesResponse400 = { data: AsError; status: 400 };\n\nexport type loadCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type loadCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type loadCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type loadCapabilitiesResponse409 = { data: AsError; status: 409 };\n\nexport type loadCapabilitiesResponse422 = { data: AsError; status: 422 };\n\nexport type loadCapabilitiesResponseSuccess = loadCapabilitiesResponse201 & { headers: Headers };\nexport type loadCapabilitiesResponseError = (\n | loadCapabilitiesResponse400\n | loadCapabilitiesResponse401\n | loadCapabilitiesResponse403\n | loadCapabilitiesResponse404\n | loadCapabilitiesResponse409\n | loadCapabilitiesResponse422\n) & { headers: Headers };\n\nexport type loadCapabilitiesResponse =\n | loadCapabilitiesResponseSuccess\n | loadCapabilitiesResponseError;\n\nexport const getLoadCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = async (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: RequestInit,\n): Promise<loadCapabilitiesResponse> => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customFetch<loadCapabilitiesResponse>(getLoadCapabilitiesUrl(orgId), {\n ...options,\n method: \"POST\",\n body: formData,\n });\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\nexport type getCapabilitiesResponse200 = { data: CapabilitiesGetResponse; status: 200 };\n\nexport type getCapabilitiesResponse401 = { data: void; status: 401 };\n\nexport type getCapabilitiesResponse403 = { data: AsError; status: 403 };\n\nexport type getCapabilitiesResponse404 = { data: AsError; status: 404 };\n\nexport type getCapabilitiesResponseSuccess = getCapabilitiesResponse200 & { headers: Headers };\nexport type getCapabilitiesResponseError = (\n | getCapabilitiesResponse401\n | getCapabilitiesResponse403\n | getCapabilitiesResponse404\n) & { headers: Headers };\n\nexport type getCapabilitiesResponse = getCapabilitiesResponseSuccess | getCapabilitiesResponseError;\n\nexport const getGetCapabilitiesUrl = (orgId: string) => {\n return `/capability/${orgId}`;\n};\n\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = async (\n orgId: string,\n options?: RequestInit,\n): Promise<getCapabilitiesResponse> => {\n return customFetch<getCapabilitiesResponse>(getGetCapabilitiesUrl(orgId), {\n ...options,\n method: \"GET\",\n });\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, { signal, ...requestOptions });\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, 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 Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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 deleteCapabilityResponse204 = { data: void; status: 204 };\n\nexport type deleteCapabilityResponse401 = { data: void; status: 401 };\n\nexport type deleteCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type deleteCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type deleteCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type deleteCapabilityResponseSuccess = deleteCapabilityResponse204 & { headers: Headers };\nexport type deleteCapabilityResponseError = (\n | deleteCapabilityResponse401\n | deleteCapabilityResponse403\n | deleteCapabilityResponse404\n | deleteCapabilityResponse422\n) & { headers: Headers };\n\nexport type deleteCapabilityResponse =\n | deleteCapabilityResponseSuccess\n | deleteCapabilityResponseError;\n\nexport const getDeleteCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}`;\n};\n\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<deleteCapabilityResponse> => {\n return customFetch<deleteCapabilityResponse>(getDeleteCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"DELETE\",\n });\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\nexport type enableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type enableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type enableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type enableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type enableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type enableCapabilityResponseSuccess = enableCapabilityResponse204 & { headers: Headers };\nexport type enableCapabilityResponseError = (\n | enableCapabilityResponse401\n | enableCapabilityResponse403\n | enableCapabilityResponse404\n | enableCapabilityResponse422\n) & { headers: Headers };\n\nexport type enableCapabilityResponse =\n | enableCapabilityResponseSuccess\n | enableCapabilityResponseError;\n\nexport const getEnableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/enable`;\n};\n\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<enableCapabilityResponse> => {\n return customFetch<enableCapabilityResponse>(getEnableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\nexport type disableCapabilityResponse204 = { data: void; status: 204 };\n\nexport type disableCapabilityResponse401 = { data: void; status: 401 };\n\nexport type disableCapabilityResponse403 = { data: AsError; status: 403 };\n\nexport type disableCapabilityResponse404 = { data: AsError; status: 404 };\n\nexport type disableCapabilityResponse422 = { data: AsError; status: 422 };\n\nexport type disableCapabilityResponseSuccess = disableCapabilityResponse204 & { headers: Headers };\nexport type disableCapabilityResponseError = (\n | disableCapabilityResponse401\n | disableCapabilityResponse403\n | disableCapabilityResponse404\n | disableCapabilityResponse422\n) & { headers: Headers };\n\nexport type disableCapabilityResponse =\n | disableCapabilityResponseSuccess\n | disableCapabilityResponseError;\n\nexport const getDisableCapabilityUrl = (orgId: string, capabilityName: string) => {\n return `/capability/${orgId}/${capabilityName}/disable`;\n};\n\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = async (\n orgId: string,\n capabilityName: string,\n options?: RequestInit,\n): Promise<disableCapabilityResponse> => {\n return customFetch<disableCapabilityResponse>(getDisableCapabilityUrl(orgId, capabilityName), {\n ...options,\n method: \"PUT\",\n });\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customFetch>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,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;AAoBA,MAAa,iCAAiC;CAC5C,OAAO;AACT;;;;;;;AAQA,MAAa,qBAAqB,OAChC,YACwC;CACxC,OAAO,YAAwC,yBAAyB,GAAG;EACzE,GAAG;EACH,QAAQ;CACV,CAAC;AACH;AAEA,MAAa,sCAAsC;CACjD,OAAO,CAAC,kBAAkB,YAAY;AACx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AM,EAAE,OAAO,mBAAmB,SAAS,CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,OAAO,YAAY,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
@@ -129,7 +129,7 @@ const useLoadCapabilities = (options, queryClient) => {
129
129
  /**
130
130
  * Gets the Capabilities loaded against an Organisation.
131
131
  *
132
- * You need admin rights to use this path.
132
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
133
133
  * @summary Gets an Organisation's Capabilities
134
134
  */
135
135
  const getCapabilities = (orgId, options, signal) => {
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","names":[],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\n} from \"../api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\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\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AllCapabilitiesGetResponse>(\n { url: `/capability`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customInstance<CapabilityPostResponse>(\n {\n url: `/capability/${orgId}`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\n );\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights to use this path.\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<CapabilitiesGetResponse>(\n { url: `/capability/${orgId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}`, method: \"DELETE\", signal },\n options,\n );\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/enable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/disable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,MAAM,gBAAqC,OAAU,aAAqC;CACxF,M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CAAC;EAE5C,OAAO,kBAAkB,OAAO,gBAAgB,cAAc;CAChE;CAEA,OAAO;EAAE;EAAY,GAAG;CAAgB;AAC1C;;;;AAWA,MAAa,wBACX,SASA,gBAMG;CACH,OAAO,YAAY,oCAAoC,OAAO,GAAG,WAAW;AAC9E"}
1
+ {"version":3,"file":"capabilities.js","names":[],"sources":["../../../src/api/capabilities/capabilities.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 AllCapabilitiesGetResponse,\n AsError,\n CapabilitiesGetResponse,\n CapabilityPostBodyBody,\n CapabilityPostResponse,\n} from \"../api-schemas\";\n\nimport { customInstance } from \"../../custom-axios\";\nimport type { ErrorType } from \"../../custom-axios\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\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\n/**\n * Gets the Capabilities of all the Organisations, indexed by Organisation. Organisations without Capabilities are not included.\n *\n * You need admin rights to use this path.\n * @summary Gets the Capabilities of all Organisations\n */\nexport const getAllCapabilities = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<AllCapabilitiesGetResponse>(\n { url: `/capability`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetAllCapabilitiesQueryKey = () => {\n return [\"account-server\", \"capability\"] as const;\n};\n\nexport const getGetAllCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getAllCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilities<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesQueryOptions(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 the Capabilities of all Organisations\n */\nexport const invalidateGetAllCapabilities = async (\n queryClient: QueryClient,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetAllCapabilitiesQueryKey() }, options);\n\n return queryClient;\n};\n\nexport const getGetAllCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetAllCapabilitiesQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getAllCapabilities>>> = ({ signal }) =>\n getAllCapabilities(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getAllCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetAllCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getAllCapabilities>>\n>;\nexport type GetAllCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Capabilities of all Organisations\n */\n\nexport function useGetAllCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getAllCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getAllCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetAllCapabilitiesSuspenseQueryOptions(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\n/**\n * Loads the Capabilities defined in a YAML file against an Organisation. Several Capabilities can be loaded at once by concatenating their definitions (as separate YAML documents). Either all the Capabilities in the file are loaded or none of them are.\n *\n * A Capability can only be loaded once against an Organisation, and is enabled when it's loaded. The Capabilities that can be loaded, and what goes in their **spec**, are described in the Capability catalogue.\n *\n * You need admin rights to use this path.\n * @summary Loads Capabilities against an Organisation\n */\nexport const loadCapabilities = (\n orgId: string,\n capabilityPostBodyBody: CapabilityPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n const formData = new FormData();\n formData.append(`capability_file`, capabilityPostBodyBody.capability_file);\n\n return customInstance<CapabilityPostResponse>(\n {\n url: `/capability/${orgId}`,\n method: \"POST\",\n headers: { \"Content-Type\": \"multipart/form-data\" },\n data: formData,\n signal,\n },\n options,\n );\n};\n\nexport const getLoadCapabilitiesMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"loadCapabilities\"];\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 loadCapabilities>>,\n { orgId: string; data: CapabilityPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return loadCapabilities(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type LoadCapabilitiesMutationResult = NonNullable<\n Awaited<ReturnType<typeof loadCapabilities>>\n>;\nexport type LoadCapabilitiesMutationBody = CapabilityPostBodyBody;\nexport type LoadCapabilitiesMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Loads Capabilities against an Organisation\n */\nexport const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof loadCapabilities>>,\n TError,\n { orgId: string; data: CapabilityPostBodyBody },\n TContext\n> => {\n return useMutation(getLoadCapabilitiesMutationOptions(options), queryClient);\n};\n/**\n * Gets the Capabilities loaded against an Organisation.\n *\n * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).\n * @summary Gets an Organisation's Capabilities\n */\nexport const getCapabilities = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<CapabilitiesGetResponse>(\n { url: `/capability/${orgId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetCapabilitiesQueryKey = (orgId: string) => {\n return [\"account-server\", \"capability\", orgId] as const;\n};\n\nexport const getGetCapabilitiesQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return {\n queryKey,\n queryFn,\n enabled: orgId !== null && orgId !== undefined,\n ...queryOptions,\n } as UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n};\n\nexport type GetCapabilitiesQueryResult = NonNullable<Awaited<ReturnType<typeof getCapabilities>>>;\nexport type GetCapabilitiesQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n Awaited<ReturnType<typeof getCapabilities>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilities<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesQueryOptions(orgId, 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 Organisation's Capabilities\n */\nexport const invalidateGetCapabilities = async (\n queryClient: QueryClient,\n orgId: string,\n options?: InvalidateOptions,\n): Promise<QueryClient> => {\n await queryClient.invalidateQueries({ queryKey: getGetCapabilitiesQueryKey(orgId) }, options);\n\n return queryClient;\n};\n\nexport const getGetCapabilitiesSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetCapabilitiesQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getCapabilities>>> = ({ signal }) =>\n getCapabilities(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions } as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getCapabilities>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetCapabilitiesSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getCapabilities>>\n>;\nexport type GetCapabilitiesSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation's Capabilities\n */\n\nexport function useGetCapabilitiesSuspense<\n TData = Awaited<ReturnType<typeof getCapabilities>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCapabilities>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = getGetCapabilitiesSuspenseQueryOptions(orgId, 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\n/**\n * Deletes a Capability from an Organisation. What else happens depends on the Capability (see the Capability catalogue).\n *\n * You need admin rights to use this path.\n * @summary Deletes a Capability\n */\nexport const deleteCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}`, method: \"DELETE\", signal },\n options,\n );\n};\n\nexport const getDeleteCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"deleteCapability\"];\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 deleteCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return deleteCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteCapability>>\n>;\n\nexport type DeleteCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Deletes a Capability\n */\nexport const useDeleteCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDeleteCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Enables an Organisation's Capability. An enabled Capability is available to Merchants. It is not an error to enable a Capability that is already enabled.\n *\n * You need admin rights to use this path.\n * @summary Enables a Capability\n */\nexport const enableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/enable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getEnableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"enableCapability\"];\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 enableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return enableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type EnableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof enableCapability>>\n>;\n\nexport type EnableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Enables a Capability\n */\nexport const useEnableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof enableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getEnableCapabilityMutationOptions(options), queryClient);\n};\n/**\n * Disables an Organisation's Capability. A disabled Capability remains loaded but has no effect. It is not an error to disable a Capability that is already disabled.\n *\n * You need admin rights to use this path.\n * @summary Disables a Capability\n */\nexport const disableCapability = (\n orgId: string,\n capabilityName: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<void>(\n { url: `/capability/${orgId}/${capabilityName}/disable`, method: \"PUT\", signal },\n options,\n );\n};\n\nexport const getDisableCapabilityMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n const mutationKey = [\"disableCapability\"];\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 disableCapability>>,\n { orgId: string; capabilityName: string }\n > = (props) => {\n const { orgId, capabilityName } = props ?? {};\n\n return disableCapability(orgId, capabilityName, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DisableCapabilityMutationResult = NonNullable<\n Awaited<ReturnType<typeof disableCapability>>\n>;\n\nexport type DisableCapabilityMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Disables a Capability\n */\nexport const useDisableCapability = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof disableCapability>>,\n TError,\n { orgId: string; capabilityName: string },\n TContext\n> => {\n return useMutation(getDisableCapabilityMutationOptions(options), queryClient);\n};\n"],"mappings":";;;;;;;;;;;;;AA0CA,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;;;;;;;AAQA,MAAa,sBACX,SACA,WACG;CACH,OA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",
2
+ "version": "4.9.0",
3
3
  "author": "Informatics Matters",
4
4
  "name": "@squonk/account-server-client",
5
5
  "private": false,
@@ -438,7 +438,7 @@ export const getGetCapabilitiesUrl = (orgId: string) => {
438
438
  /**
439
439
  * Gets the Capabilities loaded against an Organisation.
440
440
  *
441
- * You need admin rights to use this path.
441
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
442
442
  * @summary Gets an Organisation's Capabilities
443
443
  */
444
444
  export const getCapabilities = async (
@@ -370,7 +370,7 @@ export const useLoadCapabilities = <TError = ErrorType<AsError | void>, TContext
370
370
  /**
371
371
  * Gets the Capabilities loaded against an Organisation.
372
372
  *
373
- * You need admin rights to use this path.
373
+ * You need admin rights or need to be a member of the Organisation to use this path. No-one is a member of the Default Organisation, but anyone can get its Capabilities (unless it's hidden).
374
374
  * @summary Gets an Organisation's Capabilities
375
375
  */
376
376
  export const getCapabilities = (