@squonk/account-server-client 2.0.4-rc.4 → 2.0.5-rc.1
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/admin/admin.cjs.map +1 -1
- package/admin/admin.d.ts +3 -3
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.ts +13 -7
- package/asset/asset.js.map +1 -1
- package/{custom-instance-8a11f2d1.d.ts → custom-instance-f32f6506.d.ts} +3 -1
- package/index.cjs.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.ts +5 -3
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +16 -10
- package/organisation/organisation.js.map +1 -1
- package/package.json +1 -1
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +19 -11
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +3 -1
- package/src/admin/admin.ts +3 -3
- package/src/asset/asset.ts +13 -7
- package/src/merchant/merchant.ts +5 -3
- package/src/organisation/organisation.ts +16 -10
- package/src/product/product.ts +19 -11
- package/src/state/state.ts +1 -1
- package/src/unit/unit.ts +17 -12
- package/src/user/user.ts +18 -10
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +1 -1
- package/state/state.js.map +1 -1
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +17 -12
- package/unit/unit.js.map +1 -1
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +18 -10
- package/user/user.js.map +1 -1
package/unit/unit.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aE as customInstance, ap as OrganisationUnitsGetResponse, aF as ErrorType, aA as AsError, o as OrganisationUnitPostBodyBody, as as OrganisationUnitPostResponse, w as UnitDetail, n as UnitPatchBodyBody, a4 as UnitsGetResponse, p as PersonalUnitPutBodyBody, ar as PersonalUnitPutResponse, k as GetUnitChargesParams, ab as UnitChargesGetResponse } from '../custom-instance-
|
|
1
|
+
import { aE as customInstance, ap as OrganisationUnitsGetResponse, aF as ErrorType, aA as AsError, o as OrganisationUnitPostBodyBody, as as OrganisationUnitPostResponse, w as UnitDetail, n as UnitPatchBodyBody, a4 as UnitsGetResponse, p as PersonalUnitPutBodyBody, ar as PersonalUnitPutResponse, k as GetUnitChargesParams, ab as UnitChargesGetResponse } from '../custom-instance-f32f6506.js';
|
|
2
2
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
3
3
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
4
4
|
import 'axios';
|
|
@@ -26,7 +26,7 @@ declare const useGetOrganisationUnits: <TData = OrganisationUnitsGetResponse, TE
|
|
|
26
26
|
queryKey: QueryKey;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* Creates a new
|
|
29
|
+
* Creates a new Organisation Unit. You need to be a member of the **Organisation** or have administration rights to use this endpoint
|
|
30
30
|
|
|
31
31
|
* @summary Create a new Organisational Unit
|
|
32
32
|
*/
|
|
@@ -55,7 +55,7 @@ declare const useCreateOrganisationUnit: <TError = ErrorType<void | AsError>, TC
|
|
|
55
55
|
data: OrganisationUnitPostBodyBody;
|
|
56
56
|
}, TContext>;
|
|
57
57
|
/**
|
|
58
|
-
* Gets
|
|
58
|
+
* Gets a Unit, assuming it is public, you are a member of it or its **Organisation**. Admin users have access to all Units
|
|
59
59
|
|
|
60
60
|
* @summary Gets an Organisational Unit
|
|
61
61
|
*/
|
|
@@ -76,9 +76,9 @@ declare const useGetUnit: <TData = UnitDetail, TError = ErrorType<void | AsError
|
|
|
76
76
|
queryKey: QueryKey;
|
|
77
77
|
};
|
|
78
78
|
/**
|
|
79
|
-
* Used to update existing
|
|
79
|
+
* Used to update existing Unit.
|
|
80
80
|
|
|
81
|
-
You have to be the Unit owner
|
|
81
|
+
You have to be the Unit owner, a member of its **Organisation** or an administrator to patch a Unit.
|
|
82
82
|
|
|
83
83
|
* @summary Adjust an existing Unit
|
|
84
84
|
*/
|
|
@@ -107,7 +107,11 @@ declare const usePatchUnit: <TError = ErrorType<AsError>, TContext = unknown>(op
|
|
|
107
107
|
data: UnitPatchBodyBody;
|
|
108
108
|
}, TContext>;
|
|
109
109
|
/**
|
|
110
|
-
* Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or
|
|
110
|
+
* Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.
|
|
111
|
+
|
|
112
|
+
You cannot delete Units in the **Default Organisation**. These Units are **Personal Units** and need to be deleted using the `DELETE /unit` endpoint.
|
|
113
|
+
|
|
114
|
+
You cannot delete a Unit that contains undeleted **Products**
|
|
111
115
|
|
|
112
116
|
* @summary Deletes an Organisational Unit
|
|
113
117
|
*/
|
|
@@ -131,7 +135,7 @@ declare const useDeleteOrganisationUnit: <TError = ErrorType<AsError>, TContext
|
|
|
131
135
|
unitId: string;
|
|
132
136
|
}, TContext>;
|
|
133
137
|
/**
|
|
134
|
-
* Gets all the Units that are public or you are a member of. Admin users can see all Units
|
|
138
|
+
* Gets all the Units that are public or you are a member of. Admin users can see all Units.
|
|
135
139
|
|
|
136
140
|
* @summary Gets Units
|
|
137
141
|
*/
|
|
@@ -152,7 +156,9 @@ declare const useGetUnits: <TData = UnitsGetResponse, TError = ErrorType<void |
|
|
|
152
156
|
queryKey: QueryKey;
|
|
153
157
|
};
|
|
154
158
|
/**
|
|
155
|
-
* Creates a
|
|
159
|
+
* Creates a Personal Unit for a User. The unit will belong to the built-in **Default Organisation**.
|
|
160
|
+
|
|
161
|
+
Users can only create one Personal unit and you cannot add other Users to a Personal Unit.
|
|
156
162
|
|
|
157
163
|
* @summary Create a new Personal Unit
|
|
158
164
|
*/
|
|
@@ -177,7 +183,7 @@ declare const useCreateDefaultUnit: <TError = ErrorType<void | AsError>, TContex
|
|
|
177
183
|
data: PersonalUnitPutBodyBody;
|
|
178
184
|
}, TContext>;
|
|
179
185
|
/**
|
|
180
|
-
* Deletes a
|
|
186
|
+
* Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**
|
|
181
187
|
|
|
182
188
|
* @summary Deletes a Personal Unit
|
|
183
189
|
*/
|
|
@@ -194,10 +200,9 @@ declare const useDeleteDefaultUnit: <TError = ErrorType<AsError>, TVariables = v
|
|
|
194
200
|
} | undefined) => _tanstack_react_query.UseMutationResult<void, TError, TVariables, TContext>;
|
|
195
201
|
/**
|
|
196
202
|
* 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.
|
|
203
|
+
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
197
204
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
**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` (approximately two years).
|
|
205
|
+
**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.
|
|
201
206
|
|
|
202
207
|
You need to be part of the **Unit** or **Organisation** to use this method
|
|
203
208
|
* @summary Get charges made against a Unit
|
package/unit/unit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n PersonalUnitPutBodyBody,\n UnitChargesGetResponse,\n GetUnitChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgId}/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n\nexport const getGetOrganisationUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n > = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n>;\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisationUnits = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a new organisation unit. You need to be in the Organisation or an Admin user 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 return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgId}/unit`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const getCreateOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return createOrganisationUnit(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisationUnit>>\n>;\nexport type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody;\nexport type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateOrganisationUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units\n\n * @summary Gets an Organisational Unit\n */\nexport const getUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}`] as const;\n\nexport const getGetUnitQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({\n signal,\n }) => getUnit(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnit>>\n>;\nexport type GetUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnit = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Used to update existing **Unit**.\n\nYou have to be the Unit owner (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 return customInstance<void>(\n {\n url: `/unit/${unitId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitPatchBodyBody,\n },\n options\n );\n};\n\nexport const getPatchUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchUnit>>,\n { unitId: string; data: UnitPatchBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return patchUnit(unitId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchUnit>>\n>;\nexport type PatchUnitMutationBody = UnitPatchBodyBody;\nexport type PatchUnitMutationError = ErrorType<AsError>;\n\nexport const usePatchUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 Organisation users or Admin users. You cannot delete a Unit that contains Products\n\n * @summary Deletes an Organisational Unit\n */\nexport const deleteOrganisationUnit = (\n unitId: string,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>(\n { url: `/unit/${unitId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n { unitId: string }\n > = (props) => {\n const { unitId } = props ?? {};\n\n return deleteOrganisationUnit(unitId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>\n>;\n\nexport type DeleteOrganisationUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [\"account-server-api\", `/unit`] as const;\n\nexport const getGetUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({\n signal,\n }) => getUnits(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnits>>\n>;\nexport type GetUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnits = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users\n\n * @summary Create a new Personal Unit\n */\nexport const createDefaultUnit = (\n personalUnitPutBodyBody: PersonalUnitPutBodyBody,\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<PersonalUnitPutResponse>(\n {\n url: `/unit`,\n method: \"put\",\n headers: { \"Content-Type\": \"application/json\" },\n data: personalUnitPutBodyBody,\n },\n options\n );\n};\n\nexport const getCreateDefaultUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n { data: PersonalUnitPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDefaultUnit(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDefaultUnit>>\n>;\nexport type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody;\nexport type CreateDefaultUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getCreateDefaultUnitMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation\n\n * @summary Deletes a Personal Unit\n */\nexport const deleteDefaultUnit = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const getDeleteDefaultUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDefaultUnit>>\n>;\n\nexport type DeleteDefaultUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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.\n\nDates are interpreted using the Python dateutil parser so the input strings are extremely flexible, i.e. `1 December 2021` is an acceptable format.\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` (approximately 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>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/unit/${unitId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUnitChargesQueryKey = (\n unitId: string,\n params?: GetUnitChargesParams\n) => [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({\n signal,\n }) => getUnitCharges(unitId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetUnitCharges = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAsC/B,IAAM,uBAAuB,CAClC,OACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,OAAO,OAAO;AAAA,IAC5D;AAAA,EACF;AACF;AAEO,IAAM,kCAAkC,CAAC,UAC9C,CAAC,sBAAsB,iBAAiB,YAAY;AAE/C,IAAM,sCAAsC,CAIjD,OACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,gCAAgC,KAAK;AAEjE,QAAM,UAEF,CAAC,EAAE,OAAO,MAAM,qBAAqB,OAAO,gBAAgB,MAAM;AAEtE,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,OAAO,GAAG,aAAa;AAChE;AAOO,IAAM,0BAA0B,CAIrC,OACA,YAQ2D;AAC3D,QAAM,eAAe,oCAAoC,OAAO,OAAO;AAEvE,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AAOO,IAAM,yBAAyB,CACpC,OACA,8BACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,MACE,KAAK,iBAAiB;AAAA,MACtB,QAAQ;AAAA,MACR,SAAS,EAAE,gBAAgB,mBAAmB;AAAA,MAC9C,MAAM;AAAA,IACR;AAAA,IACA;AAAA,EACF;AACF;AAEO,IAAM,2CAA2C,CAGtD,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM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AAC,CAAE;AAE3E,IAAM,gCAAgC,CAI3C,QACA,QACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YACJ,6CAAc,aAAY,0BAA0B,QAAQ,MAAM;AAEpE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,QAAQ,QAAQ,gBAAgB,MAAM;AAE3D,SAAO,EAAE,UAAU,SAAS,SAAS,CAAC,CAAC,QAAQ,GAAG,aAAa;AACjE;AAOO,IAAM,oBAAoB,CAI/B,QACA,QACA,YAQ2D;AAC3D,QAAM,eAAe,8BAA8B,QAAQ,QAAQ,OAAO;AAE1E,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/unit/unit.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n OrganisationUnitsGetResponse,\n AsError,\n OrganisationUnitPostResponse,\n OrganisationUnitPostBodyBody,\n UnitGetResponse,\n UnitPatchBodyBody,\n UnitsGetResponse,\n PersonalUnitPutResponse,\n PersonalUnitPutBodyBody,\n UnitChargesGetResponse,\n GetUnitChargesParams,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<OrganisationUnitsGetResponse>(\n { url: `/organisation/${orgId}/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitsQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/unit`] as const;\n\nexport const getGetOrganisationUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n > = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnits>>\n>;\nexport type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetOrganisationUnits = <\n TData = Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError = ErrorType<void | AsError>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnits>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<OrganisationUnitPostResponse>(\n {\n url: `/organisation/${orgId}/unit`,\n method: \"post\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationUnitPostBodyBody,\n },\n options\n );\n};\n\nexport const getCreateOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n { orgId: string; data: OrganisationUnitPostBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return createOrganisationUnit(orgId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisationUnit>>\n>;\nexport type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody;\nexport type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateOrganisationUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisationUnit>>,\n TError,\n { orgId: string; data: OrganisationUnitPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitGetResponse>(\n { url: `/unit/${unitId}`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}`] as const;\n\nexport const getGetUnitQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({\n signal,\n }) => getUnit(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnit>>\n>;\nexport type GetUnitQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnit = <\n TData = Awaited<ReturnType<typeof getUnit>>,\n TError = ErrorType<void | AsError>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Used to update existing Unit.\n\nYou have to be the Unit owner, 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 return customInstance<void>(\n {\n url: `/unit/${unitId}`,\n method: \"patch\",\n headers: { \"Content-Type\": \"application/json\" },\n data: unitPatchBodyBody,\n },\n options\n );\n};\n\nexport const getPatchUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchUnit>>,\n { unitId: string; data: UnitPatchBodyBody }\n > = (props) => {\n const { unitId, data } = props ?? {};\n\n return patchUnit(unitId, data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type PatchUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchUnit>>\n>;\nexport type PatchUnitMutationBody = UnitPatchBodyBody;\nexport type PatchUnitMutationError = ErrorType<AsError>;\n\nexport const usePatchUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchUnit>>,\n TError,\n { unitId: string; data: UnitPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/unit/${unitId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n { unitId: string }\n > = (props) => {\n const { unitId } = props ?? {};\n\n return deleteOrganisationUnit(unitId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>\n>;\n\nexport type DeleteOrganisationUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnit = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnit>>,\n TError,\n { unitId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitsGetResponse>(\n { url: `/unit`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUnitsQueryKey = () => [\"account-server-api\", `/unit`] as const;\n\nexport const getGetUnitsQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData> & {\n queryKey: QueryKey;\n} => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({\n signal,\n }) => getUnits(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUnitsQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnits>>\n>;\nexport type GetUnitsQueryError = ErrorType<void | AsError>;\n\nexport const useGetUnits = <\n TData = Awaited<ReturnType<typeof getUnits>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitsQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<PersonalUnitPutResponse>(\n {\n url: `/unit`,\n method: \"put\",\n headers: { \"Content-Type\": \"application/json\" },\n data: personalUnitPutBodyBody,\n },\n options\n );\n};\n\nexport const getCreateDefaultUnitMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n { data: PersonalUnitPutBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createDefaultUnit(data, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type CreateDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof createDefaultUnit>>\n>;\nexport type CreateDefaultUnitMutationBody = PersonalUnitPutBodyBody;\nexport type CreateDefaultUnitMutationError = ErrorType<AsError | void>;\n\nexport const useCreateDefaultUnit = <\n TError = ErrorType<AsError | void>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createDefaultUnit>>,\n TError,\n { data: PersonalUnitPutBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<void>({ url: `/unit`, method: \"delete\" }, options);\n};\n\nexport const getDeleteDefaultUnitMutationOptions = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TVariables\n > = () => {\n return deleteDefaultUnit(requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteDefaultUnitMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteDefaultUnit>>\n>;\n\nexport type DeleteDefaultUnitMutationError = ErrorType<AsError>;\n\nexport const useDeleteDefaultUnit = <\n TError = ErrorType<AsError>,\n TVariables = void,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteDefaultUnit>>,\n TError,\n TVariables,\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<UnitChargesGetResponse>(\n { url: `/unit/${unitId}/charges`, method: \"get\", params, signal },\n options\n );\n};\n\nexport const getGetUnitChargesQueryKey = (\n unitId: string,\n params?: GetUnitChargesParams\n) => [\"account-server-api\", `/unit/${unitId}/charges`, ...(params ? [params] : [])] as const;\n\nexport const getGetUnitChargesQueryOptions = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({\n signal,\n }) => getUnitCharges(unitId, params, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetUnitChargesQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUnitCharges>>\n>;\nexport type GetUnitChargesQueryError = ErrorType<AsError | void>;\n\nexport const useGetUnitCharges = <\n TData = Awaited<ReturnType<typeof getUnitCharges>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n params?: GetUnitChargesParams,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUnitCharges>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AAsC/B,IAAM,uBAAuB,CAClC,OACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,OAAO,OAAO;AAAA,IAC5D;AAAA,EAC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A,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SAAS;AAAA,IAC1D;AAAA,EACF;AACF;AAEO,IAAM,+CAA+C,CAG1D,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,OAAO,IAAI,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [\"account-server-api\", `/user/account`] as const;\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets users in an Organisation. You have to be in 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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n\nexport const getGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n > = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Adds a user to an organisation. You 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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return addOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Removes a user from an organisation. You 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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return deleteOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You 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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}/user`] as const;\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n > = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return addOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return deleteOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/user/user.ts"],"names":[],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA8B/B,IAAM,iBAAiB,CAC5B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,MAAM,CAAC,sBAAsB,eAAe;AAE9E,IAAM,gCAAgC,CAG3C,YAW4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAErE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,gBAAgB,MAAM;AAE3C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,eAAe,8BAA8B,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,uBAAuB,CAClC,OACA,SACA,WACG;AACH,SAAO;AAAA,IAC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WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,OAAO,IAAI,SAAS,CAAC;AAErC,WAAO,wBAAwB,QAAQ,QAAQ,cAAc;AAAA,EAC/D;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,6BAA6B,CAGxC,YAQI;AACJ,QAAM,kBAAkB,0CAA0C,OAAO;AAEzE,SAAO,YAAY,eAAe;AACpC;AAUO,IAAM,6BAA6B,CACxC,QACA,QACA,YACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,SAAS,eAAe,UAAU,QAAQ,SAAS;AAAA,IAC1D;AAAA,EACF;AACF;AAEO,IAAM,+CAA+C,CAG1D,YAaG;AACH,QAAM,EAAE,UAAU,iBAAiB,SAAS,eAAe,IAAI,WAAW,CAAC;AAE3E,QAAM,aAGF,CAAC,UAAU;AACb,UAAM,EAAE,QAAQ,OAAO,IAAI,SAAS,CAAC;AAErC,WAAO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,eAAe;AACpC","sourcesContent":["/**\n * Generated by orval v6.15.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.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [\"account-server-api\", `/user/account`] as const;\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n\nexport const getGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n > = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return addOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return deleteOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}/user`] as const;\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n > = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return addOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return deleteOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"]}
|
package/user/user.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
2
2
|
import { UseQueryOptions, QueryKey, UseQueryResult, UseMutationOptions } from '@tanstack/react-query';
|
|
3
|
-
import { aE as customInstance, v as UserAccountDetail, aF as ErrorType, aA as AsError, au as UsersGetResponse } from '../custom-instance-
|
|
3
|
+
import { aE as customInstance, v as UserAccountDetail, aF as ErrorType, aA as AsError, au as UsersGetResponse } from '../custom-instance-f32f6506.js';
|
|
4
4
|
import 'axios';
|
|
5
5
|
|
|
6
6
|
type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
|
|
@@ -26,9 +26,11 @@ declare const useGetUserAccount: <TData = UserAccountDetail, TError = ErrorType<
|
|
|
26
26
|
queryKey: QueryKey;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* Gets
|
|
29
|
+
* Gets Users in an Organisation.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
You have to be a member of the Organisation or an admin user to use this endpoint
|
|
32
|
+
|
|
33
|
+
* @summary Gets users in an Organisation
|
|
32
34
|
*/
|
|
33
35
|
declare const getOrganisationUsers: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<UsersGetResponse>;
|
|
34
36
|
declare const getGetOrganisationUsersQueryKey: (orgId: string) => readonly ["account-server-api", `/organisation/${string}/user`];
|
|
@@ -47,9 +49,11 @@ declare const useGetOrganisationUsers: <TData = UsersGetResponse, TError = Error
|
|
|
47
49
|
queryKey: QueryKey;
|
|
48
50
|
};
|
|
49
51
|
/**
|
|
50
|
-
* Adds a
|
|
52
|
+
* Adds a User to an **Organisation**.
|
|
53
|
+
|
|
54
|
+
You have to be in the Organisation or an admin user to use this endpoint
|
|
51
55
|
|
|
52
|
-
* @summary Adds a
|
|
56
|
+
* @summary Adds a User to an Organisation
|
|
53
57
|
*/
|
|
54
58
|
declare const addOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
55
59
|
declare const getAddOrganisationUserMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
@@ -75,9 +79,11 @@ declare const useAddOrganisationUser: <TError = ErrorType<AsError>, TContext = u
|
|
|
75
79
|
userId: string;
|
|
76
80
|
}, TContext>;
|
|
77
81
|
/**
|
|
78
|
-
* Removes a
|
|
82
|
+
* Removes a User from an **Organisation**.
|
|
83
|
+
|
|
84
|
+
You have to be in the Organisation or an admin user to use this endpoint
|
|
79
85
|
|
|
80
|
-
* @summary Deletes a
|
|
86
|
+
* @summary Deletes a User from an Organisation
|
|
81
87
|
*/
|
|
82
88
|
declare const deleteOrganisationUser: (orgId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
83
89
|
declare const getDeleteOrganisationUserMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
|
@@ -103,7 +109,9 @@ declare const useDeleteOrganisationUser: <TError = ErrorType<AsError>, TContext
|
|
|
103
109
|
userId: string;
|
|
104
110
|
}, TContext>;
|
|
105
111
|
/**
|
|
106
|
-
* Gets users in an Organisational Unit.
|
|
112
|
+
* Gets users in an Organisational Unit.
|
|
113
|
+
|
|
114
|
+
You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
107
115
|
|
|
108
116
|
* @summary Gets users in an Organisational Unit
|
|
109
117
|
*/
|
|
@@ -156,13 +164,13 @@ declare const useAddOrganisationUnitUser: <TError = ErrorType<AsError>, TContext
|
|
|
156
164
|
userId: string;
|
|
157
165
|
}, TContext>;
|
|
158
166
|
/**
|
|
159
|
-
* Removes a
|
|
167
|
+
* Removes a User from an Organisational Unit.
|
|
160
168
|
|
|
161
169
|
Users cannot be removed from **Personal Units** (Units that are part of the ***Default** Organisation).
|
|
162
170
|
|
|
163
171
|
You have to be in the Organisation or Unit or an Admin user to use this endpoint
|
|
164
172
|
|
|
165
|
-
* @summary Deletes a
|
|
173
|
+
* @summary Deletes a User from an Organisational Unit
|
|
166
174
|
*/
|
|
167
175
|
declare const deleteOrganisationUnitUser: (unitId: string, userId: string, options?: SecondParameter<typeof customInstance>) => Promise<void>;
|
|
168
176
|
declare const getDeleteOrganisationUnitUserMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
|
package/user/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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 **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 2.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [\"account-server-api\", `/user/account`] as const;\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Gets users in an Organisation. You have to be in 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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n\nexport const getGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n > = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n};\n\n/**\n * Adds a user to an organisation. You 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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return addOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getAddOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Removes a user from an organisation. You 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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return deleteOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets users in an Organisational Unit. You 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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}/user`] as const;\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n > = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return addOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return deleteOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA8B/B,IAAM,iBAAiB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AO,2BAA2B,QAAQ,QAAQ,cAAc;AAAA,EAClE;AAEA,SAAO,EAAE,YAAY,GAAG,gBAAgB;AAC1C;AAQO,IAAM,gCAAgC,CAG3C,YAQI;AACJ,QAAM,kBAAkB,6CAA6C,OAAO;AAE5E,SAAO,YAAY,eAAe;AACpC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/user/user.ts"],"sourcesContent":["/**\n * Generated by orval v6.15.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.0\n */\nimport { useQuery, useMutation } from \"@tanstack/react-query\";\nimport type {\n UseQueryOptions,\n UseMutationOptions,\n QueryFunction,\n MutationFunction,\n UseQueryResult,\n QueryKey,\n} from \"@tanstack/react-query\";\nimport type {\n UserAccountGetResponse,\n AsError,\n UsersGetResponse,\n} from \"../account-server-api.schemas\";\nimport { customInstance } from \".././custom-instance\";\nimport type { ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * Returns a summary of your account\n\n * @summary Get information about your account\n */\nexport const getUserAccount = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal\n) => {\n return customInstance<UserAccountGetResponse>(\n { url: `/user/account`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetUserAccountQueryKey = () => [\"account-server-api\", `/user/account`] as const;\n\nexport const getGetUserAccountQueryOptions = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getUserAccount>>> = ({\n signal,\n }) => getUserAccount(requestOptions, signal);\n\n return { queryKey, queryFn, ...queryOptions };\n};\n\nexport type GetUserAccountQueryResult = NonNullable<\n Awaited<ReturnType<typeof getUserAccount>>\n>;\nexport type GetUserAccountQueryError = ErrorType<void | AsError>;\n\nexport const useGetUserAccount = <\n TData = Awaited<ReturnType<typeof getUserAccount>>,\n TError = ErrorType<void | AsError>\n>(options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getUserAccount>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetUserAccountQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/organisation/${orgId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUsersQueryKey = (orgId: string) =>\n [\"account-server-api\", `/organisation/${orgId}/user`] as const;\n\nexport const getGetOrganisationUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n > = ({ signal }) => getOrganisationUsers(orgId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };\n};\n\nexport type GetOrganisationUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUsers>>\n>;\nexport type GetOrganisationUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError = ErrorType<AsError | void>\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return addOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUser>>\n>;\n\nexport type AddOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/organisation/${orgId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n { orgId: string; userId: string }\n > = (props) => {\n const { orgId, userId } = props ?? {};\n\n return deleteOrganisationUser(orgId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUser>>\n>;\n\nexport type DeleteOrganisationUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUser>>,\n TError,\n { orgId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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>,\n signal?: AbortSignal\n) => {\n return customInstance<UsersGetResponse>(\n { url: `/unit/${unitId}/user`, method: \"get\", signal },\n options\n );\n};\n\nexport const getGetOrganisationUnitUsersQueryKey = (unitId: string) =>\n [\"account-server-api\", `/unit/${unitId}/user`] as const;\n\nexport const getGetOrganisationUnitUsersQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey =\n queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitId);\n\n const queryFn: QueryFunction<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n > = ({ signal }) => getOrganisationUnitUsers(unitId, requestOptions, signal);\n\n return { queryKey, queryFn, enabled: !!unitId, ...queryOptions };\n};\n\nexport type GetOrganisationUnitUsersQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>\n>;\nexport type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;\n\nexport const useGetOrganisationUnitUsers = <\n TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError = ErrorType<AsError | void>\n>(\n unitId: string,\n options?: {\n query?: UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisationUnitUsers>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n }\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"put\" },\n options\n );\n};\n\nexport const getAddOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return addOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type AddOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>\n>;\n\nexport type AddOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useAddOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof addOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\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 return customInstance<void>(\n { url: `/unit/${unitId}/user/${userId}`, method: \"delete\" },\n options\n );\n};\n\nexport const getDeleteOrganisationUnitUserMutationOptions = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n> => {\n const { mutation: mutationOptions, request: requestOptions } = options ?? {};\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n { unitId: string; userId: string }\n > = (props) => {\n const { unitId, userId } = props ?? {};\n\n return deleteOrganisationUnitUser(unitId, userId, requestOptions);\n };\n\n return { mutationFn, ...mutationOptions };\n};\n\nexport type DeleteOrganisationUnitUserMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>\n>;\n\nexport type DeleteOrganisationUnitUserMutationError = ErrorType<AsError>;\n\nexport const useDeleteOrganisationUnitUser = <\n TError = ErrorType<AsError>,\n TContext = unknown\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,\n TError,\n { unitId: string; userId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n"],"mappings":";;;;;AAUA,SAAS,UAAU,mBAAmB;AA8B/B,IAAM,iBAAiB,CAC5B,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,QAAQ,OAAO,OAAO;AAAA,IAC9C;AAAA,EACF;AACF;AAEO,IAAM,4BAA4B,MAAM,CAAC,sBAAsB,eAAe;AAE9E,IAAM,gCAAgC,CAG3C,YAW4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AAErE,QAAM,YAAW,6CAAc,aAAY,0BAA0B;AAErE,QAAM,UAAqE,CAAC;AAAA,IAC1E;AAAA,EACF,MAAM,eAAe,gBAAgB,MAAM;AAE3C,SAAO,EAAE,UAAU,SAAS,GAAG,aAAa;AAC9C;AAOO,IAAM,oBAAoB,CAG/B,YAO4D;AAC5D,QAAM,eAAe,8BAA8B,OAAO;AAE1D,QAAM,QAAQ,SAAS,YAAY;AAInC,QAAM,WAAW,aAAa;AAE9B,SAAO;AACT;AASO,IAAM,uBAAuB,CAClC,OACA,SACA,WACG;AACH,SAAO;AAAA,IACL,EAAE,KAAK,iBAAiB,cAAc,QAAQ,OAAO,OAAO;AAAA,IAC5D;AAAA,EACF;AACF;AAEO,IAAM,kCAAkC,CAAC,UAC9C,CAAC,sBAAsB,iBAAiB,YAAY;AAE/C,IAAM,sCAAsC,CAIjD,OACA,YAY4B;AAC5B,QAAM,EAAE,OAAO,cAAc,SAAS,eAAe,IAAI,WAAW,CAAC;AA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