@squonk/account-server-client 4.4.0-4-4.2175031121 → 4.4.0-4-4.2194834412
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/actions/actions.cjs +5 -5
- package/dist/api/actions/actions.cjs.map +1 -1
- package/dist/api/actions/actions.d.cts +17 -35
- package/dist/api/actions/actions.d.cts.map +1 -1
- package/dist/api/actions/actions.d.ts +17 -35
- package/dist/api/actions/actions.d.ts.map +1 -1
- package/dist/api/actions/actions.js +5 -5
- package/dist/api/actions/actions.js.map +1 -1
- package/dist/api/api.schemas.cjs.map +1 -1
- package/dist/api/api.schemas.d.cts +1 -1
- package/dist/api/api.schemas.d.ts +1 -1
- package/dist/api/api.schemas.js.map +1 -1
- package/dist/api/asset/asset.cjs +23 -23
- package/dist/api/asset/asset.cjs.map +1 -1
- package/dist/api/asset/asset.d.cts +40 -76
- package/dist/api/asset/asset.d.cts.map +1 -1
- package/dist/api/asset/asset.d.ts +40 -76
- package/dist/api/asset/asset.d.ts.map +1 -1
- package/dist/api/asset/asset.js +23 -23
- package/dist/api/asset/asset.js.map +1 -1
- package/dist/api/charges/charges.cjs +17 -17
- package/dist/api/charges/charges.cjs.map +1 -1
- package/dist/api/charges/charges.d.cts +65 -137
- package/dist/api/charges/charges.d.cts.map +1 -1
- package/dist/api/charges/charges.d.ts +65 -137
- package/dist/api/charges/charges.d.ts.map +1 -1
- package/dist/api/charges/charges.js +17 -17
- package/dist/api/charges/charges.js.map +1 -1
- package/dist/api/event-stream/event-stream.cjs +13 -13
- package/dist/api/event-stream/event-stream.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.d.cts +35 -71
- package/dist/api/event-stream/event-stream.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.d.ts +35 -71
- package/dist/api/event-stream/event-stream.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.js +13 -13
- package/dist/api/event-stream/event-stream.js.map +1 -1
- package/dist/api/merchant/merchant.cjs +9 -9
- package/dist/api/merchant/merchant.cjs.map +1 -1
- package/dist/api/merchant/merchant.d.cts +33 -69
- package/dist/api/merchant/merchant.d.cts.map +1 -1
- package/dist/api/merchant/merchant.d.ts +33 -69
- package/dist/api/merchant/merchant.d.ts.map +1 -1
- package/dist/api/merchant/merchant.js +9 -9
- package/dist/api/merchant/merchant.js.map +1 -1
- package/dist/api/organisation/organisation.cjs +19 -19
- package/dist/api/organisation/organisation.cjs.map +1 -1
- package/dist/api/organisation/organisation.d.cts +52 -106
- package/dist/api/organisation/organisation.d.cts.map +1 -1
- package/dist/api/organisation/organisation.d.ts +52 -106
- package/dist/api/organisation/organisation.d.ts.map +1 -1
- package/dist/api/organisation/organisation.js +19 -19
- package/dist/api/organisation/organisation.js.map +1 -1
- package/dist/api/product/product.cjs +31 -31
- package/dist/api/product/product.cjs.map +1 -1
- package/dist/api/product/product.d.cts +100 -208
- package/dist/api/product/product.d.cts.map +1 -1
- package/dist/api/product/product.d.ts +100 -208
- package/dist/api/product/product.d.ts.map +1 -1
- package/dist/api/product/product.js +31 -31
- package/dist/api/product/product.js.map +1 -1
- package/dist/api/state/state.cjs +5 -5
- package/dist/api/state/state.cjs.map +1 -1
- package/dist/api/state/state.d.cts +17 -35
- package/dist/api/state/state.d.cts.map +1 -1
- package/dist/api/state/state.d.ts +17 -35
- package/dist/api/state/state.d.ts.map +1 -1
- package/dist/api/state/state.js +5 -5
- package/dist/api/state/state.js.map +1 -1
- package/dist/api/unit/unit.cjs +31 -31
- package/dist/api/unit/unit.cjs.map +1 -1
- package/dist/api/unit/unit.d.cts +72 -144
- package/dist/api/unit/unit.d.cts.map +1 -1
- package/dist/api/unit/unit.d.ts +72 -144
- package/dist/api/unit/unit.d.ts.map +1 -1
- package/dist/api/unit/unit.js +31 -31
- package/dist/api/unit/unit.js.map +1 -1
- package/dist/api/user/user.cjs +21 -21
- package/dist/api/user/user.cjs.map +1 -1
- package/dist/api/user/user.d.cts +53 -107
- package/dist/api/user/user.d.cts.map +1 -1
- package/dist/api/user/user.d.ts +53 -107
- package/dist/api/user/user.d.ts.map +1 -1
- package/dist/api/user/user.js +21 -21
- package/dist/api/user/user.js.map +1 -1
- package/package.json +4 -7
- package/pnpm-workspace.yaml +1 -3
- package/src/api/actions/actions.ts +13 -105
- package/src/api/api.schemas.ts +1 -1
- package/src/api/asset/asset.ts +95 -305
- package/src/api/charges/charges.ts +55 -458
- package/src/api/event-stream/event-stream.ts +59 -264
- package/src/api/merchant/merchant.ts +29 -214
- package/src/api/organisation/organisation.ts +87 -383
- package/src/api/product/product.ts +131 -726
- package/src/api/state/state.ts +17 -107
- package/src/api/unit/unit.ts +147 -523
- package/src/api/user/user.ts +102 -403
|
@@ -5,7 +5,7 @@ let __tanstack_react_query = require("@tanstack/react-query");
|
|
|
5
5
|
|
|
6
6
|
//#region src/api/organisation/organisation.ts
|
|
7
7
|
/**
|
|
8
|
-
* Generated by orval v7.
|
|
8
|
+
* Generated by orval v7.17.0 🍺
|
|
9
9
|
* Do not edit manually.
|
|
10
10
|
* Account Server API
|
|
11
11
|
* The Informatics Matters Account Server API.
|
|
@@ -45,9 +45,9 @@ const useGetOrganisationsQueryOptions = (params, options) => {
|
|
|
45
45
|
/**
|
|
46
46
|
* @summary Gets Organisations
|
|
47
47
|
*/
|
|
48
|
-
function useGetOrganisations(params, options
|
|
48
|
+
function useGetOrganisations(params, options) {
|
|
49
49
|
const queryOptions = useGetOrganisationsQueryOptions(params, options);
|
|
50
|
-
const query = (0, __tanstack_react_query.useQuery)(queryOptions
|
|
50
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions);
|
|
51
51
|
query.queryKey = queryOptions.queryKey;
|
|
52
52
|
return query;
|
|
53
53
|
}
|
|
@@ -64,9 +64,9 @@ const useGetOrganisationsSuspenseQueryOptions = (params, options) => {
|
|
|
64
64
|
/**
|
|
65
65
|
* @summary Gets Organisations
|
|
66
66
|
*/
|
|
67
|
-
function useGetOrganisationsSuspense(params, options
|
|
67
|
+
function useGetOrganisationsSuspense(params, options) {
|
|
68
68
|
const queryOptions = useGetOrganisationsSuspenseQueryOptions(params, options);
|
|
69
|
-
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions
|
|
69
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions);
|
|
70
70
|
query.queryKey = queryOptions.queryKey;
|
|
71
71
|
return query;
|
|
72
72
|
}
|
|
@@ -112,8 +112,8 @@ const useCreateOrganisationMutationOptions = (options) => {
|
|
|
112
112
|
/**
|
|
113
113
|
* @summary Create a new organisation
|
|
114
114
|
*/
|
|
115
|
-
const useCreateOrganisation = (options
|
|
116
|
-
return (0, __tanstack_react_query.useMutation)(useCreateOrganisationMutationOptions(options)
|
|
115
|
+
const useCreateOrganisation = (options) => {
|
|
116
|
+
return (0, __tanstack_react_query.useMutation)(useCreateOrganisationMutationOptions(options));
|
|
117
117
|
};
|
|
118
118
|
/**
|
|
119
119
|
* Gets an Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation or are its *creator*.
|
|
@@ -145,9 +145,9 @@ const useGetOrganisationQueryOptions = (orgId, options) => {
|
|
|
145
145
|
/**
|
|
146
146
|
* @summary Gets an Organisation
|
|
147
147
|
*/
|
|
148
|
-
function useGetOrganisation(orgId, options
|
|
148
|
+
function useGetOrganisation(orgId, options) {
|
|
149
149
|
const queryOptions = useGetOrganisationQueryOptions(orgId, options);
|
|
150
|
-
const query = (0, __tanstack_react_query.useQuery)(queryOptions
|
|
150
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions);
|
|
151
151
|
query.queryKey = queryOptions.queryKey;
|
|
152
152
|
return query;
|
|
153
153
|
}
|
|
@@ -164,9 +164,9 @@ const useGetOrganisationSuspenseQueryOptions = (orgId, options) => {
|
|
|
164
164
|
/**
|
|
165
165
|
* @summary Gets an Organisation
|
|
166
166
|
*/
|
|
167
|
-
function useGetOrganisationSuspense(orgId, options
|
|
167
|
+
function useGetOrganisationSuspense(orgId, options) {
|
|
168
168
|
const queryOptions = useGetOrganisationSuspenseQueryOptions(orgId, options);
|
|
169
|
-
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions
|
|
169
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions);
|
|
170
170
|
query.queryKey = queryOptions.queryKey;
|
|
171
171
|
return query;
|
|
172
172
|
}
|
|
@@ -211,8 +211,8 @@ const usePatchOrganisationMutationOptions = (options) => {
|
|
|
211
211
|
/**
|
|
212
212
|
* @summary Adjust an existing Organisation
|
|
213
213
|
*/
|
|
214
|
-
const usePatchOrganisation = (options
|
|
215
|
-
return (0, __tanstack_react_query.useMutation)(usePatchOrganisationMutationOptions(options)
|
|
214
|
+
const usePatchOrganisation = (options) => {
|
|
215
|
+
return (0, __tanstack_react_query.useMutation)(usePatchOrganisationMutationOptions(options));
|
|
216
216
|
};
|
|
217
217
|
/**
|
|
218
218
|
* Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.
|
|
@@ -251,8 +251,8 @@ const useDeleteOrganisationMutationOptions = (options) => {
|
|
|
251
251
|
/**
|
|
252
252
|
* @summary Deletes an Organisation
|
|
253
253
|
*/
|
|
254
|
-
const useDeleteOrganisation = (options
|
|
255
|
-
return (0, __tanstack_react_query.useMutation)(useDeleteOrganisationMutationOptions(options)
|
|
254
|
+
const useDeleteOrganisation = (options) => {
|
|
255
|
+
return (0, __tanstack_react_query.useMutation)(useDeleteOrganisationMutationOptions(options));
|
|
256
256
|
};
|
|
257
257
|
/**
|
|
258
258
|
* Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.
|
|
@@ -284,9 +284,9 @@ const useGetDefaultOrganisationQueryOptions = (options) => {
|
|
|
284
284
|
/**
|
|
285
285
|
* @summary Gets the Default Organisation
|
|
286
286
|
*/
|
|
287
|
-
function useGetDefaultOrganisation(options
|
|
287
|
+
function useGetDefaultOrganisation(options) {
|
|
288
288
|
const queryOptions = useGetDefaultOrganisationQueryOptions(options);
|
|
289
|
-
const query = (0, __tanstack_react_query.useQuery)(queryOptions
|
|
289
|
+
const query = (0, __tanstack_react_query.useQuery)(queryOptions);
|
|
290
290
|
query.queryKey = queryOptions.queryKey;
|
|
291
291
|
return query;
|
|
292
292
|
}
|
|
@@ -303,9 +303,9 @@ const useGetDefaultOrganisationSuspenseQueryOptions = (options) => {
|
|
|
303
303
|
/**
|
|
304
304
|
* @summary Gets the Default Organisation
|
|
305
305
|
*/
|
|
306
|
-
function useGetDefaultOrganisationSuspense(options
|
|
306
|
+
function useGetDefaultOrganisationSuspense(options) {
|
|
307
307
|
const queryOptions = useGetDefaultOrganisationSuspenseQueryOptions(options);
|
|
308
|
-
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions
|
|
308
|
+
const query = (0, __tanstack_react_query.useSuspenseQuery)(queryOptions);
|
|
309
309
|
query.queryKey = queryOptions.queryKey;
|
|
310
310
|
return query;
|
|
311
311
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.cjs","names":["customInstance","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>>","queryMutator","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisation>>,\n { data: OrganisationPostBodyBody }\n >","mutationMutator","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchOrganisation>>,\n { orgId: string; data: OrganisationPatchBodyBody }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n { orgId: string }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>>"],"sources":["../../../src/api/organisation/organisation.ts"],"sourcesContent":["/**\n * Generated by orval v7.16.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n DataTag,\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryClient,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n GetOrganisationsParams,\n OrganisationAllDetail,\n OrganisationGetDefaultResponse,\n OrganisationPatchBodyBody,\n OrganisationPostBodyBody,\n OrganisationPostResponse,\n OrganisationsGetResponse,\n} from \"../api.schemas\";\n\nimport { customInstance } from \"../../custom-instance\";\nimport type { ErrorType } from \"../../custom-instance\";\nimport { queryMutator } from \"../../options-mutator\";\nimport { mutationMutator } from \"../../options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets all the Organisations that you are a member of, or a specific Organisation by name.\n\nYou can see an Organisation if you are a member of it, the owner (creator) of it, or if you are an admin user.\n\n * @summary Gets Organisations\n */\nexport const getOrganisations = (\n params?: GetOrganisationsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationsGetResponse>(\n { url: `/organisation`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetOrganisationsQueryKey = (params?: GetOrganisationsParams) => {\n return [`/organisation`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetOrganisationsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) =>\n getOrganisations(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>;\nexport type GetOrganisationsQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisations<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetOrganisationsParams,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n Awaited<ReturnType<typeof getOrganisations>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisations<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n Awaited<ReturnType<typeof getOrganisations>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisations<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets Organisations\n */\n\nexport function useGetOrganisations<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationsQueryOptions(params, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) =>\n getOrganisations(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationsSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisations>>\n>;\nexport type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationsSuspense<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params: undefined | GetOrganisationsParams,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationsSuspense<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationsSuspense<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets Organisations\n */\n\nexport function useGetOrganisationsSuspense<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationsSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates a new Organisation.\n\nThe **User** who creates the Organisation becomes the **Owner** of the Organisation. They are considered a *Member* (**User**) of the Organisation but are not present in the list of users, which a separate list of users explicitly added to the Organisation by the Owner or another Organisation User.\n\nYou need admin rights to use this method\n\n * @summary Create a new organisation\n */\nexport const createOrganisation = (\n organisationPostBodyBody: OrganisationPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationPostResponse>(\n {\n url: `/organisation`,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationPostBodyBody,\n signal,\n },\n options,\n );\n};\n\nexport const useCreateOrganisationMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createOrganisation\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisation>>,\n { data: OrganisationPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createOrganisation(data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type CreateOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisation>>\n>;\nexport type CreateOrganisationMutationBody = OrganisationPostBodyBody;\nexport type CreateOrganisationMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create a new organisation\n */\nexport const useCreateOrganisation = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n> => {\n const mutationOptions = useCreateOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Gets an Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation or are its *creator*.\n\nMembers of an Organisation's **Unit** do not have access to the Organisation.\n\n * @summary Gets an Organisation\n */\nexport const getOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationAllDetail>(\n { url: `/organisation/${orgId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetOrganisationQueryKey = (orgId?: string) => {\n return [`/organisation/${orgId}`] as const;\n};\n\nexport const useGetOrganisationQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) =>\n getOrganisation(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>;\nexport type GetOrganisationQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisation<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n Awaited<ReturnType<typeof getOrganisation>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisation<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n Awaited<ReturnType<typeof getOrganisation>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisation<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation\n */\n\nexport function useGetOrganisation<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) =>\n getOrganisation(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetOrganisationSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisation>>\n>;\nexport type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets an Organisation\n */\n\nexport function useGetOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetOrganisationSuspenseQueryOptions(orgId, options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Used to update existing Organisation. You can change an Organisation's **name** or its **default_product_privacy**.\n\nChanges to the default product privacy may conflict with those settings in any existing Units where the default product privacy of those existing units will be honoured. Any new Organisation value will only apply to new Units.\n\nYou have to be a member of the **Organisation**, its creator, or an administrator to patch an Organisation.\n\n * @summary Adjust an existing Organisation\n */\nexport const patchOrganisation = (\n orgId: string,\n organisationPatchBodyBody: OrganisationPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgId}`,\n method: \"PATCH\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationPatchBodyBody,\n },\n options,\n );\n};\n\nexport const usePatchOrganisationMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchOrganisation\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchOrganisation>>,\n { orgId: string; data: OrganisationPatchBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return patchOrganisation(orgId, data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type PatchOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchOrganisation>>\n>;\nexport type PatchOrganisationMutationBody = OrganisationPatchBodyBody;\nexport type PatchOrganisationMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Organisation\n */\nexport const usePatchOrganisation = <TError = ErrorType<void | AsError>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n> => {\n const mutationOptions = usePatchOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.\n\nYou need admin rights to use this method\n\n * @summary Deletes an Organisation\n */\nexport const deleteOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/organisation/${orgId}`, method: \"DELETE\" }, options);\n};\n\nexport const useDeleteOrganisationMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n> => {\n const mutationKey = [\"deleteOrganisation\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n { orgId: string }\n > = (props) => {\n const { orgId } = props ?? {};\n\n return deleteOrganisation(orgId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DeleteOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisation>>\n>;\n\nexport type DeleteOrganisationMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Organisation\n */\nexport const useDeleteOrganisation = <TError = ErrorType<AsError | void>, TContext = unknown>(\n options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n> => {\n const mutationOptions = useDeleteOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions, queryClient);\n};\n/**\n * Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.\n\nAny authorised user can see the Default Organisation.\n\n * @summary Gets the Default Organisation\n */\nexport const getDefaultOrganisation = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationGetDefaultResponse>(\n { url: `/default/organisation`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetDefaultOrganisationQueryKey = () => {\n return [`/default/organisation`] as const;\n};\n\nexport const useGetDefaultOrganisationQueryOptions = <\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) =>\n getDefaultOrganisation(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetDefaultOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n>;\nexport type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;\n\nexport function useGetDefaultOrganisation<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n > &\n Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetDefaultOrganisation<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n > &\n Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n >,\n \"initialData\"\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetDefaultOrganisation<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Default Organisation\n */\n\nexport function useGetDefaultOrganisation<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetDefaultOrganisationQueryOptions(options);\n\n const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {\n queryKey: DataTag<QueryKey, TData, TError>;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetDefaultOrganisationSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) =>\n getDefaultOrganisation(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n};\n\nexport type GetDefaultOrganisationSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n>;\nexport type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>;\n\nexport function useGetDefaultOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options: {\n query: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetDefaultOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\nexport function useGetDefaultOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };\n/**\n * @summary Gets the Default Organisation\n */\n\nexport function useGetDefaultOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n options?: {\n query?: Partial<\n UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>\n >;\n request?: SecondParameter<typeof customInstance>;\n },\n queryClient?: QueryClient,\n): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {\n const queryOptions = useGetDefaultOrganisationSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<\n TData,\n TError\n > & { queryKey: DataTag<QueryKey, TData, TError> };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAa,oBACX,QACA,SACA,WACG;AACH,QAAOA,uCACL;EAAE,KAAK;EAAiB,QAAQ;EAAO;EAAQ;EAAQ,EACvD,QACD;;AAGH,MAAa,+BAA+B,WAAoC;AAC9E,QAAO,CAAC,iBAAiB,GAAI,SAAS,CAAC,OAAO,GAAG,EAAE,CAAE;;AAGvD,MAAa,mCAIX,QACA,YAIG;CACH,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,4BAA4B,OAAO;CAE9E,MAAMC,WAAwE,EAAE,aAC9E,iBAAiB,QAAQ,gBAAgB,OAA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,EACvD,QACD;;AAGH,MAAa,0CAA0C;AACrD,QAAO,CAAC,wBAAwB;;AAGlC,MAAa,yCAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,mCAAmC;CAE9E,MAAMQ,WAA8E,EAAE,aACpF,uBAAuB,gBAAgB,OAAO;AAIhD,QAFsBN,qCAAa;EAAE,GAAG;EAAc;EAAU;EAAS,CAAC;;;;;AAsE5E,SAAgB,0BAId,SAMA,aACgF;CAChF,MAAM,eAAe,sCAAsC,QAAQ;CAEnE,MAAM,6CAAiB,cAAc,YAAY;AAIjD,OAAM,WAAW,aAAa;AAE9B,QAAO;;AAGT,MAAa,iDAGX,YAKI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,mCAAmC;CAE9E,MAAMM,WAA8E,EAAE,aACpF,uBAAuB,gBAAgB,OAAO;AAIhD,QAFsBN,qCAAa;EAAE,GAAG;EAAc;EAAU;EAAS,CAAC;;;;;AAsD5E,SAAgB,kCAId,SAMA,aACwF;CACxF,MAAM,eAAe,8CAA8C,QAAQ;CAE3E,MAAM,qDAAyB,cAAc,YAAY;AAKzD,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
1
|
+
{"version":3,"file":"organisation.cjs","names":["customInstance","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>>","queryMutator","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisation>>,\n { data: OrganisationPostBodyBody }\n >","mutationMutator","queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>>","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchOrganisation>>,\n { orgId: string; data: OrganisationPatchBodyBody }\n >","mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n { orgId: string }\n >","queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>>"],"sources":["../../../src/api/organisation/organisation.ts"],"sourcesContent":["/**\n * Generated by orval v7.17.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.4\n */\nimport { useMutation, useQuery, useSuspenseQuery } from \"@tanstack/react-query\";\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult,\n} from \"@tanstack/react-query\";\n\nimport type {\n AsError,\n GetOrganisationsParams,\n OrganisationAllDetail,\n OrganisationGetDefaultResponse,\n OrganisationPatchBodyBody,\n OrganisationPostBodyBody,\n OrganisationPostResponse,\n OrganisationsGetResponse,\n} from \"../api.schemas\";\n\nimport { customInstance } from \"../../custom-instance\";\nimport type { ErrorType } from \"../../custom-instance\";\nimport { queryMutator } from \"../../options-mutator\";\nimport { mutationMutator } from \"../../options-mutator\";\n\ntype SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];\n\n/**\n * Gets all the Organisations that you are a member of, or a specific Organisation by name.\n\nYou can see an Organisation if you are a member of it, the owner (creator) of it, or if you are an admin user.\n\n * @summary Gets Organisations\n */\nexport const getOrganisations = (\n params?: GetOrganisationsParams,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationsGetResponse>(\n { url: `/organisation`, method: \"GET\", params, signal },\n options,\n );\n};\n\nexport const getGetOrganisationsQueryKey = (params?: GetOrganisationsParams) => {\n return [`/organisation`, ...(params ? [params] : [])] as const;\n};\n\nexport const useGetOrganisationsQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) =>\n getOrganisations(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>;\nexport type GetOrganisationsQueryError = ErrorType<void | AsError>;\n\n/**\n * @summary Gets Organisations\n */\n\nexport function useGetOrganisations<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = useGetOrganisationsQueryOptions(params, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationsSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) =>\n getOrganisations(params, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisations>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationsSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisations>>\n>;\nexport type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>;\n\n/**\n * @summary Gets Organisations\n */\n\nexport function useGetOrganisationsSuspense<\n TData = Awaited<ReturnType<typeof getOrganisations>>,\n TError = ErrorType<void | AsError>,\n>(\n params?: GetOrganisationsParams,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = useGetOrganisationsSuspenseQueryOptions(params, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Creates a new Organisation.\n\nThe **User** who creates the Organisation becomes the **Owner** of the Organisation. They are considered a *Member* (**User**) of the Organisation but are not present in the list of users, which a separate list of users explicitly added to the Organisation by the Owner or another Organisation User.\n\nYou need admin rights to use this method\n\n * @summary Create a new organisation\n */\nexport const createOrganisation = (\n organisationPostBodyBody: OrganisationPostBodyBody,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationPostResponse>(\n {\n url: `/organisation`,\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationPostBodyBody,\n signal,\n },\n options,\n );\n};\n\nexport const useCreateOrganisationMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n> => {\n const mutationKey = [\"createOrganisation\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof createOrganisation>>,\n { data: OrganisationPostBodyBody }\n > = (props) => {\n const { data } = props ?? {};\n\n return createOrganisation(data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type CreateOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof createOrganisation>>\n>;\nexport type CreateOrganisationMutationBody = OrganisationPostBodyBody;\nexport type CreateOrganisationMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Create a new organisation\n */\nexport const useCreateOrganisation = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof createOrganisation>>,\n TError,\n { data: OrganisationPostBodyBody },\n TContext\n> => {\n const mutationOptions = useCreateOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets an Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation or are its *creator*.\n\nMembers of an Organisation's **Unit** do not have access to the Organisation.\n\n * @summary Gets an Organisation\n */\nexport const getOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationAllDetail>(\n { url: `/organisation/${orgId}`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetOrganisationQueryKey = (orgId?: string) => {\n return [`/organisation/${orgId}`] as const;\n};\n\nexport const useGetOrganisationQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) =>\n getOrganisation(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>;\nexport type GetOrganisationQueryError = ErrorType<void | AsError>;\n\n/**\n * @summary Gets an Organisation\n */\n\nexport function useGetOrganisation<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = useGetOrganisationQueryOptions(orgId, options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetOrganisationSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) =>\n getOrganisation(orgId, requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getOrganisation>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetOrganisationSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getOrganisation>>\n>;\nexport type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>;\n\n/**\n * @summary Gets an Organisation\n */\n\nexport function useGetOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(\n orgId: string,\n options?: {\n query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n },\n): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = useGetOrganisationSuspenseQueryOptions(orgId, options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\n/**\n * Used to update existing Organisation. You can change an Organisation's **name** or its **default_product_privacy**.\n\nChanges to the default product privacy may conflict with those settings in any existing Units where the default product privacy of those existing units will be honoured. Any new Organisation value will only apply to new Units.\n\nYou have to be a member of the **Organisation**, its creator, or an administrator to patch an Organisation.\n\n * @summary Adjust an existing Organisation\n */\nexport const patchOrganisation = (\n orgId: string,\n organisationPatchBodyBody: OrganisationPatchBodyBody,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>(\n {\n url: `/organisation/${orgId}`,\n method: \"PATCH\",\n headers: { \"Content-Type\": \"application/json\" },\n data: organisationPatchBodyBody,\n },\n options,\n );\n};\n\nexport const usePatchOrganisationMutationOptions = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n> => {\n const mutationKey = [\"patchOrganisation\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof patchOrganisation>>,\n { orgId: string; data: OrganisationPatchBodyBody }\n > = (props) => {\n const { orgId, data } = props ?? {};\n\n return patchOrganisation(orgId, data, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type PatchOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof patchOrganisation>>\n>;\nexport type PatchOrganisationMutationBody = OrganisationPatchBodyBody;\nexport type PatchOrganisationMutationError = ErrorType<void | AsError>;\n\n/**\n * @summary Adjust an existing Organisation\n */\nexport const usePatchOrganisation = <\n TError = ErrorType<void | AsError>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof patchOrganisation>>,\n TError,\n { orgId: string; data: OrganisationPatchBodyBody },\n TContext\n> => {\n const mutationOptions = usePatchOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.\n\nYou need admin rights to use this method\n\n * @summary Deletes an Organisation\n */\nexport const deleteOrganisation = (\n orgId: string,\n options?: SecondParameter<typeof customInstance>,\n) => {\n return customInstance<void>({ url: `/organisation/${orgId}`, method: \"DELETE\" }, options);\n};\n\nexport const useDeleteOrganisationMutationOptions = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n> => {\n const mutationKey = [\"deleteOrganisation\"];\n const { mutation: mutationOptions, request: requestOptions } = options\n ? options.mutation && \"mutationKey\" in options.mutation && options.mutation.mutationKey\n ? options\n : { ...options, mutation: { ...options.mutation, mutationKey } }\n : { mutation: { mutationKey }, request: undefined };\n\n const mutationFn: MutationFunction<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n { orgId: string }\n > = (props) => {\n const { orgId } = props ?? {};\n\n return deleteOrganisation(orgId, requestOptions);\n };\n\n const customOptions = mutationMutator({ ...mutationOptions, mutationFn });\n\n return customOptions;\n};\n\nexport type DeleteOrganisationMutationResult = NonNullable<\n Awaited<ReturnType<typeof deleteOrganisation>>\n>;\n\nexport type DeleteOrganisationMutationError = ErrorType<AsError | void>;\n\n/**\n * @summary Deletes an Organisation\n */\nexport const useDeleteOrganisation = <\n TError = ErrorType<AsError | void>,\n TContext = unknown,\n>(options?: {\n mutation?: UseMutationOptions<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseMutationResult<\n Awaited<ReturnType<typeof deleteOrganisation>>,\n TError,\n { orgId: string },\n TContext\n> => {\n const mutationOptions = useDeleteOrganisationMutationOptions(options);\n\n return useMutation(mutationOptions);\n};\n/**\n * Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.\n\nAny authorised user can see the Default Organisation.\n\n * @summary Gets the Default Organisation\n */\nexport const getDefaultOrganisation = (\n options?: SecondParameter<typeof customInstance>,\n signal?: AbortSignal,\n) => {\n return customInstance<OrganisationGetDefaultResponse>(\n { url: `/default/organisation`, method: \"GET\", signal },\n options,\n );\n};\n\nexport const getGetDefaultOrganisationQueryKey = () => {\n return [`/default/organisation`] as const;\n};\n\nexport const useGetDefaultOrganisationQueryOptions = <\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) =>\n getDefaultOrganisation(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetDefaultOrganisationQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n>;\nexport type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;\n\n/**\n * @summary Gets the Default Organisation\n */\n\nexport function useGetDefaultOrganisation<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = useGetDefaultOrganisationQueryOptions(options);\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n\nexport const useGetDefaultOrganisationSuspenseQueryOptions = <\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}) => {\n const { query: queryOptions, request: requestOptions } = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();\n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) =>\n getDefaultOrganisation(requestOptions, signal);\n\n const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });\n\n return customOptions as UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n > & { queryKey: QueryKey };\n};\n\nexport type GetDefaultOrganisationSuspenseQueryResult = NonNullable<\n Awaited<ReturnType<typeof getDefaultOrganisation>>\n>;\nexport type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>;\n\n/**\n * @summary Gets the Default Organisation\n */\n\nexport function useGetDefaultOrganisationSuspense<\n TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError = ErrorType<void | AsError>,\n>(options?: {\n query?: UseSuspenseQueryOptions<\n Awaited<ReturnType<typeof getDefaultOrganisation>>,\n TError,\n TData\n >;\n request?: SecondParameter<typeof customInstance>;\n}): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n const queryOptions = useGetDefaultOrganisationSuspenseQueryOptions(options);\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {\n queryKey: QueryKey;\n };\n\n query.queryKey = queryOptions.queryKey;\n\n return query;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAa,oBACX,QACA,SACA,WACG;AACH,QAAOA,uCACL;EAAE,KAAK;EAAiB,QAAQ;EAAO;EAAQ;EAAQ,EACvD,QACD;;AAGH,MAAa,+BAA+B,WAAoC;AA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AAG;EAAiB;EAAY,CAAC;;;;;AAc3E,MAAa,yBAGX,YAaG;AAGH,gDAFwB,qCAAqC,QAAQ,CAElC;;;;;;;;;AASrC,MAAa,0BACX,SACA,WACG;AACH,QAAOJ,uCACL;EAAE,KAAK;EAAyB,QAAQ;EAAO;EAAQ,EACvD,QACD;;AAGH,MAAa,0CAA0C;AACrD,QAAO,CAAC,wBAAwB;;AAGlC,MAAa,yCAGX,YAGI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,mCAAmC;CAE9E,MAAMQ,WAA8E,EAAE,aACpF,uBAAuB,gBAAgB,OAAO;AAIhD,QAFsBN,qCAAa;EAAE,GAAG;EAAc;EAAU;EAAS,CAAC;;;;;AAkB5E,SAAgB,0BAGd,SAGyD;CACzD,MAAM,eAAe,sCAAsC,QAAQ;CAEnE,MAAM,6CAAiB,aAAa;AAEpC,OAAM,WAAW,aAAa;AAE9B,QAAO;;AAGT,MAAa,iDAGX,YAOI;CACJ,MAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW,EAAE;CAEtE,MAAM,WAAW,cAAc,YAAY,mCAAmC;CAE9E,MAAMM,WAA8E,EAAE,aACpF,uBAAuB,gBAAgB,OAAO;AAIhD,QAFsBN,qCAAa;EAAE,GAAG;EAAc;EAAU;EAAS,CAAC;;;;;AAkB5E,SAAgB,kCAGd,SAOiE;CACjE,MAAM,eAAe,8CAA8C,QAAQ;CAE3E,MAAM,qDAAyB,aAAa;AAI5C,OAAM,WAAW,aAAa;AAE9B,QAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsError, GetOrganisationsParams, OrganisationAllDetail, OrganisationGetDefaultResponse, OrganisationPatchBodyBody, OrganisationPostBodyBody, OrganisationPostResponse, OrganisationsGetResponse } from "../api.schemas.cjs";
|
|
2
2
|
import { ErrorType, customInstance } from "../../custom-instance.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult } from "@tanstack/react-query";
|
|
4
4
|
|
|
5
5
|
//#region src/api/organisation/organisation.d.ts
|
|
6
6
|
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
@@ -14,56 +14,38 @@ You can see an Organisation if you are a member of it, the owner (creator) of it
|
|
|
14
14
|
declare const getOrganisations: (params?: GetOrganisationsParams, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<OrganisationsGetResponse>;
|
|
15
15
|
declare const getGetOrganisationsQueryKey: (params?: GetOrganisationsParams) => readonly ["/organisation", ...GetOrganisationsParams[]];
|
|
16
16
|
declare const useGetOrganisationsQueryOptions: <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: {
|
|
17
|
-
query?:
|
|
17
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;
|
|
18
18
|
request?: SecondParameter<typeof customInstance>;
|
|
19
19
|
}) => UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & {
|
|
20
|
-
queryKey:
|
|
20
|
+
queryKey: QueryKey;
|
|
21
21
|
};
|
|
22
22
|
type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>;
|
|
23
23
|
type GetOrganisationsQueryError = ErrorType<void | AsError>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
28
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
29
|
-
};
|
|
30
|
-
declare function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: {
|
|
31
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, Awaited<ReturnType<typeof getOrganisations>>>, "initialData">;
|
|
32
|
-
request?: SecondParameter<typeof customInstance>;
|
|
33
|
-
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
34
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
35
|
-
};
|
|
24
|
+
/**
|
|
25
|
+
* @summary Gets Organisations
|
|
26
|
+
*/
|
|
36
27
|
declare function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: {
|
|
37
|
-
query?:
|
|
28
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;
|
|
38
29
|
request?: SecondParameter<typeof customInstance>;
|
|
39
|
-
}
|
|
40
|
-
queryKey:
|
|
30
|
+
}): UseQueryResult<TData, TError> & {
|
|
31
|
+
queryKey: QueryKey;
|
|
41
32
|
};
|
|
42
33
|
declare const useGetOrganisationsSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: {
|
|
43
|
-
query?:
|
|
34
|
+
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;
|
|
44
35
|
request?: SecondParameter<typeof customInstance>;
|
|
45
36
|
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & {
|
|
46
|
-
queryKey:
|
|
37
|
+
queryKey: QueryKey;
|
|
47
38
|
};
|
|
48
39
|
type GetOrganisationsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>;
|
|
49
40
|
type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
54
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
55
|
-
};
|
|
56
|
-
declare function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: {
|
|
57
|
-
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;
|
|
58
|
-
request?: SecondParameter<typeof customInstance>;
|
|
59
|
-
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
60
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
61
|
-
};
|
|
41
|
+
/**
|
|
42
|
+
* @summary Gets Organisations
|
|
43
|
+
*/
|
|
62
44
|
declare function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: {
|
|
63
|
-
query?:
|
|
45
|
+
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>;
|
|
64
46
|
request?: SecondParameter<typeof customInstance>;
|
|
65
|
-
}
|
|
66
|
-
queryKey:
|
|
47
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
48
|
+
queryKey: QueryKey;
|
|
67
49
|
};
|
|
68
50
|
/**
|
|
69
51
|
* Creates a new Organisation.
|
|
@@ -94,7 +76,7 @@ declare const useCreateOrganisation: <TError = ErrorType<AsError | void>, TConte
|
|
|
94
76
|
data: OrganisationPostBodyBody;
|
|
95
77
|
}, TContext>;
|
|
96
78
|
request?: SecondParameter<typeof customInstance>;
|
|
97
|
-
}
|
|
79
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof createOrganisation>>, TError, {
|
|
98
80
|
data: OrganisationPostBodyBody;
|
|
99
81
|
}, TContext>;
|
|
100
82
|
/**
|
|
@@ -107,56 +89,38 @@ Members of an Organisation's **Unit** do not have access to the Organisation.
|
|
|
107
89
|
declare const getOrganisation: (orgId: string, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<OrganisationAllDetail>;
|
|
108
90
|
declare const getGetOrganisationQueryKey: (orgId?: string) => readonly [`/organisation/${string}`];
|
|
109
91
|
declare const useGetOrganisationQueryOptions: <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
110
|
-
query?:
|
|
92
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;
|
|
111
93
|
request?: SecondParameter<typeof customInstance>;
|
|
112
94
|
}) => UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & {
|
|
113
|
-
queryKey:
|
|
95
|
+
queryKey: QueryKey;
|
|
114
96
|
};
|
|
115
97
|
type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>;
|
|
116
98
|
type GetOrganisationQueryError = ErrorType<void | AsError>;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
121
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
122
|
-
};
|
|
123
|
-
declare function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
124
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, Awaited<ReturnType<typeof getOrganisation>>>, "initialData">;
|
|
125
|
-
request?: SecondParameter<typeof customInstance>;
|
|
126
|
-
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
127
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
128
|
-
};
|
|
99
|
+
/**
|
|
100
|
+
* @summary Gets an Organisation
|
|
101
|
+
*/
|
|
129
102
|
declare function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
130
|
-
query?:
|
|
103
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;
|
|
131
104
|
request?: SecondParameter<typeof customInstance>;
|
|
132
|
-
}
|
|
133
|
-
queryKey:
|
|
105
|
+
}): UseQueryResult<TData, TError> & {
|
|
106
|
+
queryKey: QueryKey;
|
|
134
107
|
};
|
|
135
108
|
declare const useGetOrganisationSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
136
|
-
query?:
|
|
109
|
+
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;
|
|
137
110
|
request?: SecondParameter<typeof customInstance>;
|
|
138
111
|
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & {
|
|
139
|
-
queryKey:
|
|
112
|
+
queryKey: QueryKey;
|
|
140
113
|
};
|
|
141
114
|
type GetOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>;
|
|
142
115
|
type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
147
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
148
|
-
};
|
|
149
|
-
declare function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
150
|
-
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;
|
|
151
|
-
request?: SecondParameter<typeof customInstance>;
|
|
152
|
-
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
153
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
154
|
-
};
|
|
116
|
+
/**
|
|
117
|
+
* @summary Gets an Organisation
|
|
118
|
+
*/
|
|
155
119
|
declare function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: {
|
|
156
|
-
query?:
|
|
120
|
+
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>;
|
|
157
121
|
request?: SecondParameter<typeof customInstance>;
|
|
158
|
-
}
|
|
159
|
-
queryKey:
|
|
122
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
123
|
+
queryKey: QueryKey;
|
|
160
124
|
};
|
|
161
125
|
/**
|
|
162
126
|
* Used to update existing Organisation. You can change an Organisation's **name** or its **default_product_privacy**.
|
|
@@ -190,7 +154,7 @@ declare const usePatchOrganisation: <TError = ErrorType<void | AsError>, TContex
|
|
|
190
154
|
data: OrganisationPatchBodyBody;
|
|
191
155
|
}, TContext>;
|
|
192
156
|
request?: SecondParameter<typeof customInstance>;
|
|
193
|
-
}
|
|
157
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof patchOrganisation>>, TError, {
|
|
194
158
|
orgId: string;
|
|
195
159
|
data: OrganisationPatchBodyBody;
|
|
196
160
|
}, TContext>;
|
|
@@ -220,7 +184,7 @@ declare const useDeleteOrganisation: <TError = ErrorType<AsError | void>, TConte
|
|
|
220
184
|
orgId: string;
|
|
221
185
|
}, TContext>;
|
|
222
186
|
request?: SecondParameter<typeof customInstance>;
|
|
223
|
-
}
|
|
187
|
+
}) => UseMutationResult<Awaited<ReturnType<typeof deleteOrganisation>>, TError, {
|
|
224
188
|
orgId: string;
|
|
225
189
|
}, TContext>;
|
|
226
190
|
/**
|
|
@@ -233,56 +197,38 @@ Any authorised user can see the Default Organisation.
|
|
|
233
197
|
declare const getDefaultOrganisation: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<OrganisationGetDefaultResponse>;
|
|
234
198
|
declare const getGetDefaultOrganisationQueryKey: () => readonly ["/default/organisation"];
|
|
235
199
|
declare const useGetDefaultOrganisationQueryOptions: <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(options?: {
|
|
236
|
-
query?:
|
|
200
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>;
|
|
237
201
|
request?: SecondParameter<typeof customInstance>;
|
|
238
202
|
}) => UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & {
|
|
239
|
-
queryKey:
|
|
203
|
+
queryKey: QueryKey;
|
|
240
204
|
};
|
|
241
205
|
type GetDefaultOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>;
|
|
242
206
|
type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}, queryClient?: QueryClient): DefinedUseQueryResult<TData, TError> & {
|
|
247
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
248
|
-
};
|
|
249
|
-
declare function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(options?: {
|
|
250
|
-
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, Awaited<ReturnType<typeof getDefaultOrganisation>>>, "initialData">;
|
|
251
|
-
request?: SecondParameter<typeof customInstance>;
|
|
252
|
-
}, queryClient?: QueryClient): UseQueryResult<TData, TError> & {
|
|
253
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
254
|
-
};
|
|
207
|
+
/**
|
|
208
|
+
* @summary Gets the Default Organisation
|
|
209
|
+
*/
|
|
255
210
|
declare function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(options?: {
|
|
256
|
-
query?:
|
|
211
|
+
query?: UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>;
|
|
257
212
|
request?: SecondParameter<typeof customInstance>;
|
|
258
|
-
}
|
|
259
|
-
queryKey:
|
|
213
|
+
}): UseQueryResult<TData, TError> & {
|
|
214
|
+
queryKey: QueryKey;
|
|
260
215
|
};
|
|
261
216
|
declare const useGetDefaultOrganisationSuspenseQueryOptions: <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(options?: {
|
|
262
|
-
query?:
|
|
217
|
+
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>;
|
|
263
218
|
request?: SecondParameter<typeof customInstance>;
|
|
264
219
|
}) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & {
|
|
265
|
-
queryKey:
|
|
220
|
+
queryKey: QueryKey;
|
|
266
221
|
};
|
|
267
222
|
type GetDefaultOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>;
|
|
268
223
|
type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>;
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
273
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
274
|
-
};
|
|
275
|
-
declare function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(options?: {
|
|
276
|
-
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>;
|
|
277
|
-
request?: SecondParameter<typeof customInstance>;
|
|
278
|
-
}, queryClient?: QueryClient): UseSuspenseQueryResult<TData, TError> & {
|
|
279
|
-
queryKey: DataTag<QueryKey, TData, TError>;
|
|
280
|
-
};
|
|
224
|
+
/**
|
|
225
|
+
* @summary Gets the Default Organisation
|
|
226
|
+
*/
|
|
281
227
|
declare function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(options?: {
|
|
282
|
-
query?:
|
|
228
|
+
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>;
|
|
283
229
|
request?: SecondParameter<typeof customInstance>;
|
|
284
|
-
}
|
|
285
|
-
queryKey:
|
|
230
|
+
}): UseSuspenseQueryResult<TData, TError> & {
|
|
231
|
+
queryKey: QueryKey;
|
|
286
232
|
};
|
|
287
233
|
//#endregion
|
|
288
234
|
export { CreateOrganisationMutationBody, CreateOrganisationMutationError, CreateOrganisationMutationResult, DeleteOrganisationMutationError, DeleteOrganisationMutationResult, GetDefaultOrganisationQueryError, GetDefaultOrganisationQueryResult, GetDefaultOrganisationSuspenseQueryError, GetDefaultOrganisationSuspenseQueryResult, GetOrganisationQueryError, GetOrganisationQueryResult, GetOrganisationSuspenseQueryError, GetOrganisationSuspenseQueryResult, GetOrganisationsQueryError, GetOrganisationsQueryResult, GetOrganisationsSuspenseQueryError, GetOrganisationsSuspenseQueryResult, PatchOrganisationMutationBody, PatchOrganisationMutationError, PatchOrganisationMutationResult, createOrganisation, deleteOrganisation, getDefaultOrganisation, getGetDefaultOrganisationQueryKey, getGetOrganisationQueryKey, getGetOrganisationsQueryKey, getOrganisation, getOrganisations, patchOrganisation, useCreateOrganisation, useCreateOrganisationMutationOptions, useDeleteOrganisation, useDeleteOrganisationMutationOptions, useGetDefaultOrganisation, useGetDefaultOrganisationQueryOptions, useGetDefaultOrganisationSuspense, useGetDefaultOrganisationSuspenseQueryOptions, useGetOrganisation, useGetOrganisationQueryOptions, useGetOrganisationSuspense, useGetOrganisationSuspenseQueryOptions, useGetOrganisations, useGetOrganisationsQueryOptions, useGetOrganisationsSuspense, useGetOrganisationsSuspenseQueryOptions, usePatchOrganisation, usePatchOrganisationMutationOptions };
|