@squonk/account-server-client 2.4.0-rc.8 → 2.4.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +9 -5
- package/organisation/organisation.d.ts +9 -5
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/src/organisation/organisation.ts +9 -5
- package/src/unit/unit.ts +9 -3
- package/src/user/user.ts +4 -0
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +9 -3
- package/unit/unit.d.ts +9 -3
- package/unit/unit.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +4 -0
- package/user/user.d.ts +4 -0
- package/user/user.js.map +1 -1
package/unit/unit.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,uBAAuB,CAChC,OACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IACtD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,kCAAkC,CAAC,UAAmB;AAC/D,SAAO,CAAC,sBAAsB,iBAAiB,KAAK,OAAO;AAC3D;AAGG,IAAM,sCAAsC,CAA+F,OAAe,YAC5J;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,KAAK;AAI/E,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAMpJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,0BAA0B,CACtC,OAAe,YAE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QAAO,OAAO;AAExE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,wCAAwC,CAAyF,QAC1I,QAA+B,YAC9B;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B,QAAO,MAAM;AAIjF,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,QAAO,QAAQ,gBAAgB,MAAM;AAMhJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,QAAS,GAAG,aAAY;AACpE;AAQO,IAAM,4BAA4B,CACxC,QACG,QAA+B,YAEqC;AAEtE,QAAM,eAAe,sCAAsC,QAAO,QAAO,OAAO;AAEhF,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.4\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n GetUnitChargesParams,\n OrganisationUnitPostBodyBody,\n OrganisationUnitPostResponse,\n OrganisationUnitsGetResponse,\n PersonalUnitPutBodyBody,\n PersonalUnitPutResponse,\n UnitAllDetail,\n UnitChargesGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationUnitsGetResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n }\n\n \nexport const getGetOrganisationUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnits = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnitsSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new Organisation Unit. You need to be a member of the **Organisation** or have administration rights to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<OrganisationUnitPostResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: organisationUnitPostBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateOrganisationUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisationUnit>>, {orgId: string;data: OrganisationUnitPostBodyBody}> = (props) => {\n const {orgId,data} = props ?? {};\n\n return createOrganisationUnit(orgId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisationUnit>>>\n export type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody\n export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Organisational Unit\n */\nexport const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets a Unit, assuming it is public, you are a member of it or its **Organisation**. Admin users have access to all Units\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitAllDetail>(\n {url: `/unit/${unitId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}`] as const;\n }\n\n \nexport const getGetUnitQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnit = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnitSuspense = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Used to update existing Unit.\n\nYou have to be a member of the **Unit**, a member of its **Organisation**, or an administrator to patch a Unit.\n\n * @summary Adjust an existing Unit\n */\nexport const patchUnit = (\n unitId: string,\n unitPatchBodyBody: UnitPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'PATCH',\n headers: {'Content-Type': 'application/json', },\n data: unitPatchBodyBody\n },\n options);\n }\n \n\n\nexport const getPatchUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUnit>>, {unitId: string;data: UnitPatchBodyBody}> = (props) => {\n const {unitId,data} = props ?? {};\n\n return patchUnit(unitId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchUnitMutationResult = NonNullable<Awaited<ReturnType<typeof patchUnit>>>\n export type PatchUnitMutationBody = UnitPatchBodyBody\n export type PatchUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Adjust an existing Unit\n */\nexport const usePatchUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.\n\nYou cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.\n\nYou cannot delete a Unit that contains undeleted **Products**\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnit>>, {unitId: string}> = (props) => {\n const {unitId} = props ?? {};\n\n return deleteOrganisationUnit(unitId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnit>>>\n \n export type DeleteOrganisationUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an Organisational Unit\n */\nexport const useDeleteOrganisationUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units.\n\n * @summary Gets Units\n */\nexport const getUnits = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitsGetResponse>(\n {url: `/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitsQueryKey = () => {\n return [\"account-server-api\", `/unit`] as const;\n }\n\n \nexport const getGetUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnits = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnitsSuspense = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.\n\nUsers can only create one Personal unit and you cannot add other Users to a Personal Unit.\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<PersonalUnitPutResponse>(\n {url: `/unit`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: personalUnitPutBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateDefaultUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDefaultUnit>>, {data: PersonalUnitPutBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createDefaultUnit(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createDefaultUnit>>>\n export type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody\n export type CreateDefaultUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Personal Unit\n */\nexport const useCreateDefaultUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteDefaultUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteDefaultUnit>>, void> = () => {\n \n\n return deleteDefaultUnit(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDefaultUnit>>>\n \n export type DeleteDefaultUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a Personal Unit\n */\nexport const useDeleteDefaultUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitChargesGetResponse>(\n {url: `/unit/${unitId}/charges`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUnitChargesQueryKey = (unitId: string,\n params?: GetUnitChargesParams,) => {\n return [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUnitChargesQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitCharges = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesQueryOptions(unitId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitChargesSuspense = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,uBAAuB,CAChC,OACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IACtD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,kCAAkC,CAAC,UAAmB;AAC/D,SAAO,CAAC,sBAAsB,iBAAiB,KAAK,OAAO;AAC3D;AAGG,IAAM,sCAAsC,CAA+F,OAAe,YAC5J;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,KAAK;AAI/E,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAMpJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,0BAA0B,CACtC,OAAe,YAEgD;AAE9D,QAAM,eAAe,oCAAoC,OAAM,OAAO;AAEtE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,8CAA8C,CAA+F,OAAe,YACpK;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,KAAK;AAI/E,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAMpJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,kCAAkC,CAC9C,O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EqC;AAEtE,QAAM,eAAe,sCAAsC,QAAO,QAAO,OAAO;AAEhF,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.4\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n GetUnitChargesParams,\n OrganisationUnitPostBodyBody,\n OrganisationUnitPostResponse,\n OrganisationUnitsGetResponse,\n PersonalUnitPutBodyBody,\n PersonalUnitPutResponse,\n UnitAllDetail,\n UnitChargesGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationUnitsGetResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n }\n\n \nexport const getGetOrganisationUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnits = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnitsSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new Organisation Unit.\n\nThe **User** who creates the Unit becomes the **Owner** of the Unit. They are considered a *Member* (**User**) of the Unit but are not present in the list of users, which a separate list of users explicitly added to the Unit by a member of the Organisation or another member of the Unit.\n\nYou need to be a member of the **Organisation** or have administration rights to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<OrganisationUnitPostResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: organisationUnitPostBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateOrganisationUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisationUnit>>, {orgId: string;data: OrganisationUnitPostBodyBody}> = (props) => {\n const {orgId,data} = props ?? {};\n\n return createOrganisationUnit(orgId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisationUnit>>>\n export type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody\n export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Organisational Unit\n */\nexport const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets a Unit. You can get a Unit if you are a member of it or are its creator. You can also get a Unit if you are a member of its **Organisation**, or its creator or an admin user.\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitAllDetail>(\n {url: `/unit/${unitId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}`] as const;\n }\n\n \nexport const getGetUnitQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnit = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnitSuspense = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Used to update existing Unit.\n\nYou have to be a member of the **Unit**, a member of its **Organisation**, or an administrator to patch a Unit.\n\n * @summary Adjust an existing Unit\n */\nexport const patchUnit = (\n unitId: string,\n unitPatchBodyBody: UnitPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'PATCH',\n headers: {'Content-Type': 'application/json', },\n data: unitPatchBodyBody\n },\n options);\n }\n \n\n\nexport const getPatchUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUnit>>, {unitId: string;data: UnitPatchBodyBody}> = (props) => {\n const {unitId,data} = props ?? {};\n\n return patchUnit(unitId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchUnitMutationResult = NonNullable<Awaited<ReturnType<typeof patchUnit>>>\n export type PatchUnitMutationBody = UnitPatchBodyBody\n export type PatchUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Adjust an existing Unit\n */\nexport const usePatchUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.\n\nYou cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.\n\nYou cannot delete a Unit that contains undeleted **Products**\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnit>>, {unitId: string}> = (props) => {\n const {unitId} = props ?? {};\n\n return deleteOrganisationUnit(unitId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnit>>>\n \n export type DeleteOrganisationUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an Organisational Unit\n */\nexport const useDeleteOrganisationUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets all the Units that you are a member of.\n\nYou can see a Unit if you are a member of it, the owner (creator) of it, or a member or creator of the Unit's Organisation, or if you are an admin user.\n\n * @summary Gets Units\n */\nexport const getUnits = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitsGetResponse>(\n {url: `/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitsQueryKey = () => {\n return [\"account-server-api\", `/unit`] as const;\n }\n\n \nexport const getGetUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnits = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnitsSuspense = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.\n\nUsers can only create one Personal unit and you cannot add other Users to a Personal Unit.\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<PersonalUnitPutResponse>(\n {url: `/unit`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: personalUnitPutBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateDefaultUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDefaultUnit>>, {data: PersonalUnitPutBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createDefaultUnit(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createDefaultUnit>>>\n export type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody\n export type CreateDefaultUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Personal Unit\n */\nexport const useCreateDefaultUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteDefaultUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteDefaultUnit>>, void> = () => {\n \n\n return deleteDefaultUnit(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDefaultUnit>>>\n \n export type DeleteDefaultUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a Personal Unit\n */\nexport const useDeleteDefaultUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitChargesGetResponse>(\n {url: `/unit/${unitId}/charges`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUnitChargesQueryKey = (unitId: string,\n params?: GetUnitChargesParams,) => {\n return [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUnitChargesQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitCharges = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesQueryOptions(unitId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitChargesSuspense = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"]}
|
package/unit/unit.d.cts
CHANGED
|
@@ -46,7 +46,11 @@ declare const useGetOrganisationUnitsSuspense: <TData = OrganisationUnitsGetResp
|
|
|
46
46
|
queryKey: QueryKey;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* Creates a new Organisation Unit.
|
|
49
|
+
* Creates a new Organisation Unit.
|
|
50
|
+
|
|
51
|
+
The **User** who creates the Unit becomes the **Owner** of the Unit. They are considered a *Member* (**User**) of the Unit but are not present in the list of users, which a separate list of users explicitly added to the Unit by a member of the Organisation or another member of the Unit.
|
|
52
|
+
|
|
53
|
+
You need to be a member of the **Organisation** or have administration rights to use this endpoint
|
|
50
54
|
|
|
51
55
|
* @summary Create a new Organisational Unit
|
|
52
56
|
*/
|
|
@@ -78,7 +82,7 @@ declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TC
|
|
|
78
82
|
data: OrganisationUnitPostBodyBody;
|
|
79
83
|
}, TContext>;
|
|
80
84
|
/**
|
|
81
|
-
* Gets a Unit
|
|
85
|
+
* Gets a Unit. You can get a Unit if you are a member of it or are its creator. You can also get a Unit if you are a member of its **Organisation**, or its creator or an admin user.
|
|
82
86
|
|
|
83
87
|
* @summary Gets an Organisational Unit
|
|
84
88
|
*/
|
|
@@ -184,7 +188,9 @@ declare const useDeleteOrganisationUnit: <TError = ErrorType<AsError>, TContext
|
|
|
184
188
|
unitId: string;
|
|
185
189
|
}, TContext>;
|
|
186
190
|
/**
|
|
187
|
-
* Gets all the Units that
|
|
191
|
+
* Gets all the Units that you are a member of.
|
|
192
|
+
|
|
193
|
+
You can see a Unit if you are a member of it, the owner (creator) of it, or a member or creator of the Unit's Organisation, or if you are an admin user.
|
|
188
194
|
|
|
189
195
|
* @summary Gets Units
|
|
190
196
|
*/
|
package/unit/unit.d.ts
CHANGED
|
@@ -46,7 +46,11 @@ declare const useGetOrganisationUnitsSuspense: <TData = OrganisationUnitsGetResp
|
|
|
46
46
|
queryKey: QueryKey;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
|
-
* Creates a new Organisation Unit.
|
|
49
|
+
* Creates a new Organisation Unit.
|
|
50
|
+
|
|
51
|
+
The **User** who creates the Unit becomes the **Owner** of the Unit. They are considered a *Member* (**User**) of the Unit but are not present in the list of users, which a separate list of users explicitly added to the Unit by a member of the Organisation or another member of the Unit.
|
|
52
|
+
|
|
53
|
+
You need to be a member of the **Organisation** or have administration rights to use this endpoint
|
|
50
54
|
|
|
51
55
|
* @summary Create a new Organisational Unit
|
|
52
56
|
*/
|
|
@@ -78,7 +82,7 @@ declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TC
|
|
|
78
82
|
data: OrganisationUnitPostBodyBody;
|
|
79
83
|
}, TContext>;
|
|
80
84
|
/**
|
|
81
|
-
* Gets a Unit
|
|
85
|
+
* Gets a Unit. You can get a Unit if you are a member of it or are its creator. You can also get a Unit if you are a member of its **Organisation**, or its creator or an admin user.
|
|
82
86
|
|
|
83
87
|
* @summary Gets an Organisational Unit
|
|
84
88
|
*/
|
|
@@ -184,7 +188,9 @@ declare const useDeleteOrganisationUnit: <TError = ErrorType<AsError>, TContext
|
|
|
184
188
|
unitId: string;
|
|
185
189
|
}, TContext>;
|
|
186
190
|
/**
|
|
187
|
-
* Gets all the Units that
|
|
191
|
+
* Gets all the Units that you are a member of.
|
|
192
|
+
|
|
193
|
+
You can see a Unit if you are a member of it, the owner (creator) of it, or a member or creator of the Unit's Organisation, or if you are an admin user.
|
|
188
194
|
|
|
189
195
|
* @summary Gets Units
|
|
190
196
|
*/
|
package/unit/unit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.4\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n GetUnitChargesParams,\n OrganisationUnitPostBodyBody,\n OrganisationUnitPostResponse,\n OrganisationUnitsGetResponse,\n PersonalUnitPutBodyBody,\n PersonalUnitPutResponse,\n UnitAllDetail,\n UnitChargesGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationUnitsGetResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n }\n\n \nexport const getGetOrganisationUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnits = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnitsSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new Organisation Unit. You need to be a member of the **Organisation** or have administration rights to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<OrganisationUnitPostResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: organisationUnitPostBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateOrganisationUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisationUnit>>, {orgId: string;data: OrganisationUnitPostBodyBody}> = (props) => {\n const {orgId,data} = props ?? {};\n\n return createOrganisationUnit(orgId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisationUnit>>>\n export type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody\n export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Organisational Unit\n */\nexport const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets a Unit, assuming it is public, you are a member of it or its **Organisation**. Admin users have access to all Units\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitAllDetail>(\n {url: `/unit/${unitId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}`] as const;\n }\n\n \nexport const getGetUnitQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnit = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnitSuspense = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Used to update existing Unit.\n\nYou have to be a member of the **Unit**, a member of its **Organisation**, or an administrator to patch a Unit.\n\n * @summary Adjust an existing Unit\n */\nexport const patchUnit = (\n unitId: string,\n unitPatchBodyBody: UnitPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'PATCH',\n headers: {'Content-Type': 'application/json', },\n data: unitPatchBodyBody\n },\n options);\n }\n \n\n\nexport const getPatchUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUnit>>, {unitId: string;data: UnitPatchBodyBody}> = (props) => {\n const {unitId,data} = props ?? {};\n\n return patchUnit(unitId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchUnitMutationResult = NonNullable<Awaited<ReturnType<typeof patchUnit>>>\n export type PatchUnitMutationBody = UnitPatchBodyBody\n export type PatchUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Adjust an existing Unit\n */\nexport const usePatchUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.\n\nYou cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.\n\nYou cannot delete a Unit that contains undeleted **Products**\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnit>>, {unitId: string}> = (props) => {\n const {unitId} = props ?? {};\n\n return deleteOrganisationUnit(unitId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnit>>>\n \n export type DeleteOrganisationUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an Organisational Unit\n */\nexport const useDeleteOrganisationUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets all the Units that are public or you are a member of. Admin users can see all Units.\n\n * @summary Gets Units\n */\nexport const getUnits = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitsGetResponse>(\n {url: `/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitsQueryKey = () => {\n return [\"account-server-api\", `/unit`] as const;\n }\n\n \nexport const getGetUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnits = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnitsSuspense = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.\n\nUsers can only create one Personal unit and you cannot add other Users to a Personal Unit.\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<PersonalUnitPutResponse>(\n {url: `/unit`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: personalUnitPutBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateDefaultUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDefaultUnit>>, {data: PersonalUnitPutBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createDefaultUnit(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createDefaultUnit>>>\n export type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody\n export type CreateDefaultUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Personal Unit\n */\nexport const useCreateDefaultUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteDefaultUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteDefaultUnit>>, void> = () => {\n \n\n return deleteDefaultUnit(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDefaultUnit>>>\n \n export type DeleteDefaultUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a Personal Unit\n */\nexport const useDeleteDefaultUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitChargesGetResponse>(\n {url: `/unit/${unitId}/charges`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUnitChargesQueryKey = (unitId: string,\n params?: GetUnitChargesParams,) => {\n return [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUnitChargesQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitCharges = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesQueryOptions(unitId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitChargesSuspense = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,uBAAuB,CAChC,OACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IACtD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,kCAAkC,CAAC,UAAmB;AAC/D,SAAO,CAAC,sBAAsB,iBAAiB,KAAK,OAAO;AAC3D;AAGG,IAAM,sCAAsC,CAA+F,OAAe,YAC5J;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,KAAK;AAI/E,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAMpJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,0BAA0B,CACtC,OAAe,YAEgD;AAE9D,QAAM,eAAe,oCAAoC,OAAM,OAAO;AAEtE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,8CAA8C,CAA+F,OAAe,YACpK;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS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C;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B,QAAO,MAAM;AAIjF,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,QAAO,QAAQ,gBAAgB,MAAM;AAMhJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,QAAS,GAAG,aAAY;AACpE;AAQO,IAAM,4BAA4B,CACxC,QACG,QAA+B,YAEqC;AAEtE,QAAM,eAAe,sCAAsC,QAAO,QAAO,OAAO;AAEhF,QAAM,QAAQ,iBAAiB,YAAY;AAE3C,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.4\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n GetUnitChargesParams,\n OrganisationUnitPostBodyBody,\n OrganisationUnitPostResponse,\n OrganisationUnitsGetResponse,\n PersonalUnitPutBodyBody,\n PersonalUnitPutResponse,\n UnitAllDetail,\n UnitChargesGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets Organisational Units you have access to or that are public\n\n * @summary Gets Organisational Units\n */\nexport const getOrganisationUnits = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<OrganisationUnitsGetResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n }\n\n \nexport const getGetOrganisationUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnits = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>\nexport type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Organisational Units\n */\nexport const useGetOrganisationUnitsSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new Organisation Unit.\n\nThe **User** who creates the Unit becomes the **Owner** of the Unit. They are considered a *Member* (**User**) of the Unit but are not present in the list of users, which a separate list of users explicitly added to the Unit by a member of the Organisation or another member of the Unit.\n\nYou need to be a member of the **Organisation** or have administration rights to use this endpoint\n\n * @summary Create a new Organisational Unit\n */\nexport const createOrganisationUnit = (\n orgId: string,\n organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<OrganisationUnitPostResponse>(\n {url: `/organisation/${orgId}/unit`, method: 'POST',\n headers: {'Content-Type': 'application/json', },\n data: organisationUnitPostBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateOrganisationUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisationUnit>>, {orgId: string;data: OrganisationUnitPostBodyBody}> = (props) => {\n const {orgId,data} = props ?? {};\n\n return createOrganisationUnit(orgId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisationUnit>>>\n export type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody\n export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Organisational Unit\n */\nexport const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets a Unit. You can get a Unit if you are a member of it or are its creator. You can also get a Unit if you are a member of its **Organisation**, or its creator or an admin user.\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitAllDetail>(\n {url: `/unit/${unitId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}`] as const;\n }\n\n \nexport const getGetUnitQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnit = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>\nexport type GetUnitSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets an Organisational Unit\n */\nexport const useGetUnitSuspense = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Used to update existing Unit.\n\nYou have to be a member of the **Unit**, a member of its **Organisation**, or an administrator to patch a Unit.\n\n * @summary Adjust an existing Unit\n */\nexport const patchUnit = (\n unitId: string,\n unitPatchBodyBody: UnitPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'PATCH',\n headers: {'Content-Type': 'application/json', },\n data: unitPatchBodyBody\n },\n options);\n }\n \n\n\nexport const getPatchUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchUnit>>, {unitId: string;data: UnitPatchBodyBody}> = (props) => {\n const {unitId,data} = props ?? {};\n\n return patchUnit(unitId,data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type PatchUnitMutationResult = NonNullable<Awaited<ReturnType<typeof patchUnit>>>\n export type PatchUnitMutationBody = UnitPatchBodyBody\n export type PatchUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Adjust an existing Unit\n */\nexport const usePatchUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchUnit>>, TError,{unitId: string;data: UnitPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getPatchUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.\n\nYou cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.\n\nYou cannot delete a Unit that contains undeleted **Products**\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnit>>, {unitId: string}> = (props) => {\n const {unitId} = props ?? {};\n\n return deleteOrganisationUnit(unitId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnit>>>\n \n export type DeleteOrganisationUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an Organisational Unit\n */\nexport const useDeleteOrganisationUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets all the Units that you are a member of.\n\nYou can see a Unit if you are a member of it, the owner (creator) of it, or a member or creator of the Unit's Organisation, or if you are an admin user.\n\n * @summary Gets Units\n */\nexport const getUnits = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitsGetResponse>(\n {url: `/unit`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUnitsQueryKey = () => {\n return [\"account-server-api\", `/unit`] as const;\n }\n\n \nexport const getGetUnitsQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnits = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>\nexport type GetUnitsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets Units\n */\nexport const useGetUnitsSuspense = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitsSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.\n\nUsers can only create one Personal unit and you cannot add other Users to a Personal Unit.\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<PersonalUnitPutResponse>(\n {url: `/unit`, method: 'PUT',\n headers: {'Content-Type': 'application/json', },\n data: personalUnitPutBodyBody\n },\n options);\n }\n \n\n\nexport const getCreateDefaultUnitMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDefaultUnit>>, {data: PersonalUnitPutBodyBody}> = (props) => {\n const {data} = props ?? {};\n\n return createDefaultUnit(data,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createDefaultUnit>>>\n export type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody\n export type CreateDefaultUnitMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Personal Unit\n */\nexport const useCreateDefaultUnit = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,{data: PersonalUnitPutBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteDefaultUnitMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteDefaultUnit>>, void> = () => {\n \n\n return deleteDefaultUnit(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDefaultUnit>>>\n \n export type DeleteDefaultUnitMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a Personal Unit\n */\nexport const useDeleteDefaultUnit = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.\nDates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.\n\n**From** must be a date (day) prior to **until**. For example, to see the charges for the 11th July 2022 set **from** to `11 July 2022` and **until** to `12 July 2022`. As an alternative to **From** and **Until** you can provide a **Prior Billing Period**, a value that identifies the prior period to retrieve. A value of `-1` would indicate the *prior period* (month) with an oldest retrieval value of `-23` allowing you to obtain charges for up to two years.\n\nYou need to be part of the **Unit** or **Organisation** to use this method\n * @summary Get charges made against a Unit\n */\nexport const getUnitCharges = (\n unitId: string,\n params?: GetUnitChargesParams,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UnitChargesGetResponse>(\n {url: `/unit/${unitId}/charges`, method: 'GET',\n params, signal\n },\n options);\n }\n \n\nexport const getGetUnitChargesQueryKey = (unitId: string,\n params?: GetUnitChargesParams,) => {\n return [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params]: [])] as const;\n }\n\n \nexport const getGetUnitChargesQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitCharges = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesQueryOptions(unitId,params,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUnitChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId,params);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) => getUnitCharges(unitId,params, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUnitChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>\nexport type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Get charges made against a Unit\n */\nexport const useGetUnitChargesSuspense = <TData = Awaited<ReturnType<typeof getUnitCharges>>, TError = ErrorType<AsError | void>>(\n unitId: string,\n params?: GetUnitChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId,params,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n"],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAoCA,IAAM,uBAAuB,CAChC,OACH,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,iBAAiB,KAAK;AAAA,MAAS,QAAQ;AAAA,MAAO;AAAA,IACtD;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,kCAAkC,CAAC,UAAmB;AAC/D,SAAO,CAAC,sBAAsB,iBAAiB,KAAK,OAAO;AAC3D;AAGG,IAAM,sCAAsC,CAA+F,OAAe,YAC5J;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,KAAK;AAI/E,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAMpJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,0BAA0B,CACtC,OAAe,YAEgD;AAE9D,QAAM,eAAe,oCAAoC,OAAM,OAAO;AAEtE,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,8CAA8C,CAA+F,OAAe,YACpK;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,gCAAgC,KAAK;AAI/E,QAAM,UAA2E,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAMpJ,SAAQ,EAAE,UAAU,SAAS,SAAS,CAAC,CAAE,OAAQ,GAAG,aAAY;AACnE;AAQO,IAAM,kCAAkC,CAC9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jC,YACwG;AAC/H,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAqH,CAAC,UAAU;AAClI,UAAM,EAAC,QAAO,OAAM,IAAI,SAAS,CAAC;AAElC,WAAQ,wBAAwB,QAAO,QAAO,cAAc;AAAA,EAC9D;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,6BAA6B,CAClB,YACnB;AAEC,QAAM,kBAAkB,0CAA0C,OAAO;AAEzE,SAAO,YAAY,eAAe;AACpC;AAUG,IAAM,6BAA6B,CACtC,QACA,QACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,IAClD;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,+CAA+C,CACpC,YAC2G;AAClI,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAwH,CAAC,UAAU;AACrI,UAAM,EAAC,QAAO,OAAM,IAAI,SAAS,CAAC;AAElC,WAAQ,2BAA2B,QAAO,QAAO,cAAc;AAAA,EACjE;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,gCAAgC,CACrB,YACnB;AAEC,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.4\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n UserAccountDetail,\n UsersGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserAccountDetail>(\n {url: `/user/account`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = () => {\n return [\"account-server-api\", `/user/account`] as const;\n }\n\n \nexport const getGetUserAccountQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Get information about your account\n */\nexport const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserAccountQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUserAccountSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserAccountSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Get information about your account\n */\nexport const useGetUserAccountSuspense = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets Users in an Organisation.\n\nYou have to be a member of the Organisation or an admin user to use this endpoint\n\n * @summary Gets users in an Organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/organisation/${orgId}/user`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUsersQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n }\n\n \nexport const getGetOrganisationUsersQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const useGetOrganisationUsers = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const useGetOrganisationUsersSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Adds a User to an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Adds a User to an Organisation\n */\nexport const addOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'PUT'\n },\n options);\n }\n \n\n\nexport const getAddOrganisationUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addOrganisationUser>>, {orgId: string;userId: string}> = (props) => {\n const {orgId,userId} = props ?? {};\n\n return addOrganisationUser(orgId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUser>>>\n \n export type AddOrganisationUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Adds a User to an Organisation\n */\nexport const useAddOrganisationUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getAddOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Removes a User from an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Deletes a User from an Organisation\n */\nexport const deleteOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUser>>, {orgId: string;userId: string}> = (props) => {\n const {orgId,userId} = props ?? {};\n\n return deleteOrganisationUser(orgId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUser>>>\n \n export type DeleteOrganisationUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a User from an Organisation\n */\nexport const useDeleteOrganisationUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets users in an Organisational Unit.\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/unit/${unitId}/user`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}/user`] as const;\n }\n\n \nexport const getGetOrganisationUnitUsersQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const useGetOrganisationUnitUsers = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const useGetOrganisationUnitUsersSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'PUT'\n },\n options);\n }\n \n\n\nexport const getAddOrganisationUnitUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addOrganisationUnitUser>>, {unitId: string;userId: string}> = (props) => {\n const {unitId,userId} = props ?? {};\n\n return addOrganisationUnitUser(unitId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUnitUser>>>\n \n export type AddOrganisationUnitUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Adds a user to an Organisational Unit\n */\nexport const useAddOrganisationUnitUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getAddOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Removes a User from an Organisational Unit.\n\nUsers cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a User from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, {unitId: string;userId: string}> = (props) => {\n const {unitId,userId} = props ?? {};\n\n return deleteOrganisationUnitUser(unitId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>>\n \n export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a User from an Organisational Unit\n */\nexport const useDeleteOrganisationUnitUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
|
1
|
+
{"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA4BA,IAAM,iBAAiB,CAE7B,SAAiD,WAC7C;AAGC,SAAO;AAAA,IACP;AAAA,MAAC,KAAK;AAAA,MAAiB,QAAQ;AAAA,MAAO;AAAA,IACxC;AAAA,IACE;AAAA,EAAO;AACT;AAGG,IAAM,4BAA4B,MAAM;AAC3C,SAAO,CAAC,sBAAsB,eAAe;AAC7C;AAGG,IAAM,gCAAgC,CAA0F,YAClI;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B;AAIpE,QAAM,UAAqE,CAAC,EAAE,OAAO,MAAM,eAAe,gBAAgB,MAAM;AAMjI,SAAQ,EAAE,UAAU,SAAS,GAAG,aAAY;AAC/C;AAQO,IAAM,oBAAoB,CAC/B,YAE8D;AAE9D,QAAM,eAAe,8BAA8B,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAEnC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAIO,IAAM,wCAAwC,CAA0F,YAC1I;AAEL,QAAM,EAAC,OAAO,cAAc,SAAS,eAAc,IAAI,WAAW,CAAC;AAEjE,QAAM,YAAY,6CAAc,aAAY,0BAA0B;AAIpE,QAAM,UAAqE,CAAC,EAAE,O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sD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,IAClD;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,4CAA4C,CACjC,YACwG;AAC/H,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAqH,CAAC,UAAU;AAClI,UAAM,EAAC,QAAO,OAAM,IAAI,SAAS,CAAC;AAElC,WAAQ,wBAAwB,QAAO,QAAO,cAAc;AAAA,EAC9D;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,6BAA6B,CAClB,YACnB;AAEC,QAAM,kBAAkB,0CAA0C,OAAO;AAEzE,SAAO,YAAY,eAAe;AACpC;AAUG,IAAM,6BAA6B,CACtC,QACA,QACH,YAAsD;AAGjD,SAAO;AAAA,IACP;AAAA,MAAC,KAAK,SAAS,MAAM,SAAS,MAAM;AAAA,MAAI,QAAQ;AAAA,IAClD;AAAA,IACE;AAAA,EAAO;AACT;AAIG,IAAM,+CAA+C,CACpC,YAC2G;AAClI,QAAM,EAAC,UAAU,iBAAiB,SAAS,eAAc,IAAI,WAAW,CAAC;AAKpE,QAAM,aAAwH,CAAC,UAAU;AACrI,UAAM,EAAC,QAAO,OAAM,IAAI,SAAS,CAAC;AAElC,WAAQ,2BAA2B,QAAO,QAAO,cAAc;AAAA,EACjE;AAKL,SAAQ,EAAE,YAAY,GAAG,gBAAgB;AAAC;AAStC,IAAM,gCAAgC,CACrB,YACnB;AAEC,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 2.4\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n UserAccountDetail,\n UsersGetResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UserAccountDetail>(\n {url: `/user/account`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetUserAccountQueryKey = () => {\n return [\"account-server-api\", `/user/account`] as const;\n }\n\n \nexport const getGetUserAccountQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Get information about your account\n */\nexport const useGetUserAccount = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserAccountQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetUserAccountSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({ signal }) => getUserAccount(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetUserAccountSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>\nexport type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Get information about your account\n */\nexport const useGetUserAccountSuspense = <TData = Awaited<ReturnType<typeof getUserAccount>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetUserAccountSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Gets Users in an Organisation.\n\nYou have to be a member of the Organisation or an admin user to use this endpoint\n\n**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /organisation/{org_id}` endpoint instead.\n\n * @summary Gets users in an Organisation\n */\nexport const getOrganisationUsers = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/organisation/${orgId}/user`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUsersQueryKey = (orgId: string,) => {\n return [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n }\n\n \nexport const getGetOrganisationUsersQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const useGetOrganisationUsers = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUsersSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUsers>>> = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUsers>>>\nexport type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisation\n */\nexport const useGetOrganisationUsersSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUsers>>, TError = ErrorType<AsError | void>>(\n orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Adds a User to an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Adds a User to an Organisation\n */\nexport const addOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'PUT'\n },\n options);\n }\n \n\n\nexport const getAddOrganisationUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addOrganisationUser>>, {orgId: string;userId: string}> = (props) => {\n const {orgId,userId} = props ?? {};\n\n return addOrganisationUser(orgId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUser>>>\n \n export type AddOrganisationUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Adds a User to an Organisation\n */\nexport const useAddOrganisationUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getAddOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Removes a User from an **Organisation**.\n\nYou have to be in the Organisation or an admin user to use this endpoint\n\n * @summary Deletes a User from an Organisation\n */\nexport const deleteOrganisationUser = (\n orgId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/organisation/${orgId}/user/${userId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUser>>, {orgId: string;userId: string}> = (props) => {\n const {orgId,userId} = props ?? {};\n\n return deleteOrganisationUser(orgId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUser>>>\n \n export type DeleteOrganisationUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a User from an Organisation\n */\nexport const useDeleteOrganisationUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUser>>, TError,{orgId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Gets users in an Organisational Unit.\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /unit/{unit_id}` endpoint instead.\n\n * @summary Gets users in an Organisational Unit\n */\nexport const getOrganisationUnitUsers = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<UsersGetResponse>(\n {url: `/unit/${unitId}/user`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string,) => {\n return [\"account-server-api\", `/unit/${unitId}/user`] as const;\n }\n\n \nexport const getGetOrganisationUnitUsersQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const useGetOrganisationUnitUsers = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetOrganisationUnitUsersSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnitUsers>>> = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(unitId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnitUsers>>>\nexport type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>\n\n/**\n * @summary Gets users in an Organisational Unit\n */\nexport const useGetOrganisationUnitUsersSuspense = <TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError = ErrorType<AsError | void>>(\n unitId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Adds a user to an Organisational Unit.\n\nUsers cannot be added to **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Adds a user to an Organisational Unit\n */\nexport const addOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'PUT'\n },\n options);\n }\n \n\n\nexport const getAddOrganisationUnitUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof addOrganisationUnitUser>>, {unitId: string;userId: string}> = (props) => {\n const {unitId,userId} = props ?? {};\n\n return addOrganisationUnitUser(unitId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type AddOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof addOrganisationUnitUser>>>\n \n export type AddOrganisationUnitUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Adds a user to an Organisational Unit\n */\nexport const useAddOrganisationUnitUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof addOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getAddOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * Removes a User from an Organisational Unit.\n\nUsers cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).\n\nYou have to be in the Organisation or Unit or an Admin user to use this endpoint\n\n * @summary Deletes a User from an Organisational Unit\n */\nexport const deleteOrganisationUnitUser = (\n unitId: string,\n userId: string,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/unit/${unitId}/user/${userId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, {unitId: string;userId: string}> = (props) => {\n const {unitId,userId} = props ?? {};\n\n return deleteOrganisationUnitUser(unitId,userId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteOrganisationUnitUserMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>>\n \n export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes a User from an Organisational Unit\n */\nexport const useDeleteOrganisationUnitUser = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnitUser>>, TError,{unitId: string;userId: string}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "]}
|
package/user/user.d.cts
CHANGED
|
@@ -50,6 +50,8 @@ declare const useGetUserAccountSuspense: <TData = UserAccountDetail, TError = Er
|
|
|
50
50
|
|
|
51
51
|
You have to be a member of the Organisation or an admin user to use this endpoint
|
|
52
52
|
|
|
53
|
+
**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /organisation/{org_id}` endpoint instead.
|
|
54
|
+
|
|
53
55
|
* @summary Gets users in an Organisation
|
|
54
56
|
*/
|
|
55
57
|
declare const getOrganisationUsers: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
|
|
@@ -159,6 +161,8 @@ declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext
|
|
|
159
161
|
|
|
160
162
|
You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
161
163
|
|
|
164
|
+
**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /unit/{unit_id}` endpoint instead.
|
|
165
|
+
|
|
162
166
|
* @summary Gets users in an Organisational Unit
|
|
163
167
|
*/
|
|
164
168
|
declare const getOrganisationUnitUsers: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
|
package/user/user.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ declare const useGetUserAccountSuspense: <TData = UserAccountDetail, TError = Er
|
|
|
50
50
|
|
|
51
51
|
You have to be a member of the Organisation or an admin user to use this endpoint
|
|
52
52
|
|
|
53
|
+
**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /organisation/{org_id}` endpoint instead.
|
|
54
|
+
|
|
53
55
|
* @summary Gets users in an Organisation
|
|
54
56
|
*/
|
|
55
57
|
declare const getOrganisationUsers: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
|
|
@@ -159,6 +161,8 @@ declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext
|
|
|
159
161
|
|
|
160
162
|
You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
161
163
|
|
|
164
|
+
**WARNING**: This endpoint is **DEPRECATED** and will be removed in a future release. Please use the `GET /unit/{unit_id}` endpoint instead.
|
|
165
|
+
|
|
162
166
|
* @summary Gets users in an Organisational Unit
|
|
163
167
|
*/
|
|
164
168
|
declare const getOrganisationUnitUsers: (unitId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
|