@squonk/account-server-client 4.2.5 → 4.3.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.
Files changed (84) hide show
  1. package/asset/asset.cjs +99 -126
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.cts +99 -99
  4. package/asset/asset.d.ts +99 -99
  5. package/asset/asset.js +107 -134
  6. package/asset/asset.js.map +1 -1
  7. package/charges/charges.cjs +73 -85
  8. package/charges/charges.cjs.map +1 -1
  9. package/charges/charges.d.cts +47 -47
  10. package/charges/charges.d.ts +47 -47
  11. package/charges/charges.js +78 -90
  12. package/charges/charges.js.map +1 -1
  13. package/chunk-3WKSNKHE.js +25 -0
  14. package/chunk-3WKSNKHE.js.map +1 -0
  15. package/chunk-NY2VJJG7.cjs +25 -0
  16. package/chunk-NY2VJJG7.cjs.map +1 -0
  17. package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
  18. package/chunk-RB2KVIEK.cjs.map +1 -0
  19. package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
  20. package/chunk-XYDLYMQ2.js.map +1 -0
  21. package/event-stream/event-stream.cjs +53 -61
  22. package/event-stream/event-stream.cjs.map +1 -1
  23. package/event-stream/event-stream.d.cts +44 -44
  24. package/event-stream/event-stream.d.ts +44 -44
  25. package/event-stream/event-stream.js +58 -66
  26. package/event-stream/event-stream.js.map +1 -1
  27. package/index.cjs +49 -58
  28. package/index.cjs.map +1 -1
  29. package/index.d.cts +783 -765
  30. package/index.d.ts +783 -765
  31. package/index.js +48 -57
  32. package/index.js.map +1 -1
  33. package/merchant/merchant.cjs +38 -45
  34. package/merchant/merchant.cjs.map +1 -1
  35. package/merchant/merchant.d.cts +25 -25
  36. package/merchant/merchant.d.ts +25 -25
  37. package/merchant/merchant.js +42 -49
  38. package/merchant/merchant.js.map +1 -1
  39. package/organisation/organisation.cjs +77 -87
  40. package/organisation/organisation.cjs.map +1 -1
  41. package/organisation/organisation.d.cts +72 -70
  42. package/organisation/organisation.d.ts +72 -70
  43. package/organisation/organisation.js +83 -93
  44. package/organisation/organisation.js.map +1 -1
  45. package/package.json +13 -16
  46. package/product/product.cjs +143 -153
  47. package/product/product.cjs.map +1 -1
  48. package/product/product.d.cts +100 -100
  49. package/product/product.d.ts +100 -100
  50. package/product/product.js +153 -163
  51. package/product/product.js.map +1 -1
  52. package/src/account-server-api.schemas.ts +862 -860
  53. package/src/asset/asset.ts +899 -634
  54. package/src/charges/charges.ts +822 -498
  55. package/src/custom-instance.ts +3 -3
  56. package/src/event-stream/event-stream.ts +530 -344
  57. package/src/index.ts +2 -2
  58. package/src/merchant/merchant.ts +355 -234
  59. package/src/options-mutator.ts +27 -0
  60. package/src/organisation/organisation.ts +812 -504
  61. package/src/product/product.ts +1373 -841
  62. package/src/state/state.ts +174 -127
  63. package/src/unit/unit.ts +1273 -603
  64. package/src/user/user.ts +895 -564
  65. package/state/state.cjs +22 -24
  66. package/state/state.cjs.map +1 -1
  67. package/state/state.d.cts +14 -14
  68. package/state/state.d.ts +14 -14
  69. package/state/state.js +24 -26
  70. package/state/state.js.map +1 -1
  71. package/unit/unit.cjs +171 -106
  72. package/unit/unit.cjs.map +1 -1
  73. package/unit/unit.d.cts +200 -90
  74. package/unit/unit.d.ts +200 -90
  75. package/unit/unit.js +179 -114
  76. package/unit/unit.js.map +1 -1
  77. package/user/user.cjs +94 -110
  78. package/user/user.cjs.map +1 -1
  79. package/user/user.d.cts +77 -77
  80. package/user/user.d.ts +77 -77
  81. package/user/user.js +101 -117
  82. package/user/user.js.map +1 -1
  83. package/chunk-EBOQPVLG.js.map +0 -1
  84. package/chunk-TKLTUR4R.cjs.map +0 -1
@@ -1,24 +1,20 @@
1
- // @ts-nocheck
2
1
  /**
3
- * Generated by orval v7.4.1 🍺
2
+ * Generated by orval v7.10.0 🍺
4
3
  * Do not edit manually.
5
4
  * Account Server API
6
5
  * The Informatics Matters Account Server API.
7
6
 
8
7
  A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
9
8
 
10
- * OpenAPI spec version: 4.2
9
+ * OpenAPI spec version: 4.3
11
10
  */
12
- import {
13
- useMutation,
14
- useQuery,
15
- useSuspenseQuery
16
- } from '@tanstack/react-query'
11
+ import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
17
12
  import type {
18
13
  DataTag,
19
14
  DefinedInitialDataOptions,
20
15
  DefinedUseQueryResult,
21
16
  MutationFunction,
17
+ QueryClient,
22
18
  QueryFunction,
23
19
  QueryKey,
24
20
  UndefinedInitialDataOptions,
@@ -27,8 +23,9 @@ import type {
27
23
  UseQueryOptions,
28
24
  UseQueryResult,
29
25
  UseSuspenseQueryOptions,
30
- UseSuspenseQueryResult
31
- } from '@tanstack/react-query'
26
+ UseSuspenseQueryResult,
27
+ } from "@tanstack/react-query";
28
+
32
29
  import type {
33
30
  AsError,
34
31
  GetOrganisationsParams,
@@ -37,14 +34,15 @@ import type {
37
34
  OrganisationPatchBodyBody,
38
35
  OrganisationPostBodyBody,
39
36
  OrganisationPostResponse,
40
- OrganisationsGetResponse
41
- } from '../account-server-api.schemas'
42
- import { customInstance } from '.././custom-instance';
43
- import type { ErrorType } from '.././custom-instance';
44
-
37
+ OrganisationsGetResponse,
38
+ } from "../account-server-api.schemas";
45
39
 
46
- type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
40
+ import { customInstance } from ".././custom-instance";
41
+ import type { ErrorType } from ".././custom-instance";
42
+ import { queryMutator } from ".././options-mutator";
43
+ import { mutationMutator } from ".././options-mutator";
47
44
 
45
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
48
46
 
49
47
  /**
50
48
  * Gets all the Organisations that you are a member of, or a specific Organisation by name.
@@ -54,144 +52,225 @@ You can see an Organisation if you are a member of it, the owner (creator) of it
54
52
  * @summary Gets Organisations
55
53
  */
56
54
  export const getOrganisations = (
57
- params?: GetOrganisationsParams,
58
- options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
55
+ params?: GetOrganisationsParams,
56
+ options?: SecondParameter<typeof customInstance>,
57
+ signal?: AbortSignal,
59
58
  ) => {
60
-
61
-
62
- return customInstance<OrganisationsGetResponse>(
63
- {url: `/organisation`, method: 'GET',
64
- params, signal
65
- },
66
- options);
67
- }
68
-
69
-
70
- export const getGetOrganisationsQueryKey = (params?: GetOrganisationsParams,) => {
71
- return ["account-server-api", `/organisation`, ...(params ? [params]: [])] as const;
72
- }
73
-
74
-
75
- export const getGetOrganisationsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
59
+ return customInstance<OrganisationsGetResponse>(
60
+ { url: `/organisation`, method: "GET", params, signal },
61
+ options,
62
+ );
63
+ };
64
+
65
+ export const getGetOrganisationsQueryKey = (params?: GetOrganisationsParams) => {
66
+ return [`/organisation`, ...(params ? [params] : [])] as const;
67
+ };
68
+
69
+ export const useGetOrganisationsQueryOptions = <
70
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
71
+ TError = ErrorType<void | AsError>,
72
+ >(
73
+ params?: GetOrganisationsParams,
74
+ options?: {
75
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;
76
+ request?: SecondParameter<typeof customInstance>;
77
+ },
76
78
  ) => {
79
+ const { query: queryOptions, request: requestOptions } = options ?? {};
77
80
 
78
- const {query: queryOptions, request: requestOptions} = options ?? {};
79
-
80
- const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);
81
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);
81
82
 
82
-
83
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) =>
84
+ getOrganisations(params, requestOptions, signal);
83
85
 
84
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(params, requestOptions, signal);
86
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
85
87
 
86
-
88
+ return customOptions as UseQueryOptions<
89
+ Awaited<ReturnType<typeof getOrganisations>>,
90
+ TError,
91
+ TData
92
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
93
+ };
87
94
 
88
-
95
+ export type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>;
96
+ export type GetOrganisationsQueryError = ErrorType<void | AsError>;
89
97
 
90
- return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
91
- }
92
-
93
- export type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
94
- export type GetOrganisationsQueryError = ErrorType<void | AsError>
95
-
96
-
97
- export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
98
- params: undefined | GetOrganisationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> & Pick<
98
+ export function useGetOrganisations<
99
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
100
+ TError = ErrorType<void | AsError>,
101
+ >(
102
+ params: undefined | GetOrganisationsParams,
103
+ options: {
104
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> &
105
+ Pick<
99
106
  DefinedInitialDataOptions<
100
107
  Awaited<ReturnType<typeof getOrganisations>>,
101
108
  TError,
102
- TData
103
- > , 'initialData'
104
- >, request?: SecondParameter<typeof customInstance>}
105
-
106
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
107
- export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
108
- params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> & Pick<
109
+ Awaited<ReturnType<typeof getOrganisations>>
110
+ >,
111
+ "initialData"
112
+ >;
113
+ request?: SecondParameter<typeof customInstance>;
114
+ },
115
+ queryClient?: QueryClient,
116
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
117
+ export function useGetOrganisations<
118
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
119
+ TError = ErrorType<void | AsError>,
120
+ >(
121
+ params?: GetOrganisationsParams,
122
+ options?: {
123
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> &
124
+ Pick<
109
125
  UndefinedInitialDataOptions<
110
126
  Awaited<ReturnType<typeof getOrganisations>>,
111
127
  TError,
112
- TData
113
- > , 'initialData'
114
- >, request?: SecondParameter<typeof customInstance>}
115
-
116
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
117
- export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
118
- params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
119
-
120
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
128
+ Awaited<ReturnType<typeof getOrganisations>>
129
+ >,
130
+ "initialData"
131
+ >;
132
+ request?: SecondParameter<typeof customInstance>;
133
+ },
134
+ queryClient?: QueryClient,
135
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
136
+ export function useGetOrganisations<
137
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
138
+ TError = ErrorType<void | AsError>,
139
+ >(
140
+ params?: GetOrganisationsParams,
141
+ options?: {
142
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;
143
+ request?: SecondParameter<typeof customInstance>;
144
+ },
145
+ queryClient?: QueryClient,
146
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
121
147
  /**
122
148
  * @summary Gets Organisations
123
149
  */
124
150
 
125
- export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
126
- params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
127
-
128
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
129
-
130
- const queryOptions = getGetOrganisationsQueryOptions(params,options)
131
-
132
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
133
-
134
- query.queryKey = queryOptions.queryKey ;
151
+ export function useGetOrganisations<
152
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
153
+ TError = ErrorType<void | AsError>,
154
+ >(
155
+ params?: GetOrganisationsParams,
156
+ options?: {
157
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>;
158
+ request?: SecondParameter<typeof customInstance>;
159
+ },
160
+ queryClient?: QueryClient,
161
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
162
+ const queryOptions = useGetOrganisationsQueryOptions(params, options);
163
+
164
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
165
+ queryKey: DataTag<QueryKey, TData, TError>;
166
+ };
167
+
168
+ query.queryKey = queryOptions.queryKey;
135
169
 
136
170
  return query;
137
171
  }
138
172
 
139
-
140
-
141
- export const getGetOrganisationsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
173
+ export const useGetOrganisationsSuspenseQueryOptions = <
174
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
175
+ TError = ErrorType<void | AsError>,
176
+ >(
177
+ params?: GetOrganisationsParams,
178
+ options?: {
179
+ query?: Partial<
180
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>
181
+ >;
182
+ request?: SecondParameter<typeof customInstance>;
183
+ },
142
184
  ) => {
143
-
144
- const {query: queryOptions, request: requestOptions} = options ?? {};
145
-
146
- const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);
147
-
148
-
149
-
150
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(params, requestOptions, signal);
151
-
152
-
153
-
154
-
155
-
156
- return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
157
- }
158
-
159
- export type GetOrganisationsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
160
- export type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>
161
-
162
-
163
- export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
164
- params: undefined | GetOrganisationsParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
165
-
166
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
167
- export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
168
- params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
169
-
170
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
171
- export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
172
- params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
173
-
174
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
185
+ const { query: queryOptions, request: requestOptions } = options ?? {};
186
+
187
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);
188
+
189
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) =>
190
+ getOrganisations(params, requestOptions, signal);
191
+
192
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
193
+
194
+ return customOptions as UseSuspenseQueryOptions<
195
+ Awaited<ReturnType<typeof getOrganisations>>,
196
+ TError,
197
+ TData
198
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
199
+ };
200
+
201
+ export type GetOrganisationsSuspenseQueryResult = NonNullable<
202
+ Awaited<ReturnType<typeof getOrganisations>>
203
+ >;
204
+ export type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>;
205
+
206
+ export function useGetOrganisationsSuspense<
207
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
208
+ TError = ErrorType<void | AsError>,
209
+ >(
210
+ params: undefined | GetOrganisationsParams,
211
+ options: {
212
+ query: Partial<
213
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>
214
+ >;
215
+ request?: SecondParameter<typeof customInstance>;
216
+ },
217
+ queryClient?: QueryClient,
218
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
219
+ export function useGetOrganisationsSuspense<
220
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
221
+ TError = ErrorType<void | AsError>,
222
+ >(
223
+ params?: GetOrganisationsParams,
224
+ options?: {
225
+ query?: Partial<
226
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>
227
+ >;
228
+ request?: SecondParameter<typeof customInstance>;
229
+ },
230
+ queryClient?: QueryClient,
231
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
232
+ export function useGetOrganisationsSuspense<
233
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
234
+ TError = ErrorType<void | AsError>,
235
+ >(
236
+ params?: GetOrganisationsParams,
237
+ options?: {
238
+ query?: Partial<
239
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>
240
+ >;
241
+ request?: SecondParameter<typeof customInstance>;
242
+ },
243
+ queryClient?: QueryClient,
244
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
175
245
  /**
176
246
  * @summary Gets Organisations
177
247
  */
178
248
 
179
- export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
180
- params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
181
-
182
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
183
-
184
- const queryOptions = getGetOrganisationsSuspenseQueryOptions(params,options)
185
-
186
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
187
-
188
- query.queryKey = queryOptions.queryKey ;
249
+ export function useGetOrganisationsSuspense<
250
+ TData = Awaited<ReturnType<typeof getOrganisations>>,
251
+ TError = ErrorType<void | AsError>,
252
+ >(
253
+ params?: GetOrganisationsParams,
254
+ options?: {
255
+ query?: Partial<
256
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>
257
+ >;
258
+ request?: SecondParameter<typeof customInstance>;
259
+ },
260
+ queryClient?: QueryClient,
261
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
262
+ const queryOptions = useGetOrganisationsSuspenseQueryOptions(params, options);
263
+
264
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
265
+ TData,
266
+ TError
267
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
268
+
269
+ query.queryKey = queryOptions.queryKey;
189
270
 
190
271
  return query;
191
272
  }
192
273
 
193
-
194
-
195
274
  /**
196
275
  * Creates a new Organisation.
197
276
 
@@ -202,66 +281,91 @@ You need admin rights to use this method
202
281
  * @summary Create a new organisation
203
282
  */
204
283
  export const createOrganisation = (
205
- organisationPostBodyBody: OrganisationPostBodyBody,
206
- options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
284
+ organisationPostBodyBody: OrganisationPostBodyBody,
285
+ options?: SecondParameter<typeof customInstance>,
286
+ signal?: AbortSignal,
207
287
  ) => {
208
-
209
-
210
- return customInstance<OrganisationPostResponse>(
211
- {url: `/organisation`, method: 'POST',
212
- headers: {'Content-Type': 'application/json', },
213
- data: organisationPostBodyBody, signal
288
+ return customInstance<OrganisationPostResponse>(
289
+ {
290
+ url: `/organisation`,
291
+ method: "POST",
292
+ headers: { "Content-Type": "application/json" },
293
+ data: organisationPostBodyBody,
294
+ signal,
214
295
  },
215
- options);
216
- }
217
-
218
-
219
-
220
- export const getCreateOrganisationMutationOptions = <TData = Awaited<ReturnType<typeof createOrganisation>>, TError = ErrorType<AsError | void>,
221
- TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
222
- ) => {
223
- const mutationKey = ['createOrganisation'];
224
- const {mutation: mutationOptions, request: requestOptions} = options ?
225
- options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
226
- options
227
- : {...options, mutation: {...options.mutation, mutationKey}}
228
- : {mutation: { mutationKey, }, request: undefined};
296
+ options,
297
+ );
298
+ };
299
+
300
+ export const useCreateOrganisationMutationOptions = <
301
+ TError = ErrorType<AsError | void>,
302
+ TContext = unknown,
303
+ >(options?: {
304
+ mutation?: UseMutationOptions<
305
+ Awaited<ReturnType<typeof createOrganisation>>,
306
+ TError,
307
+ { data: OrganisationPostBodyBody },
308
+ TContext
309
+ >;
310
+ request?: SecondParameter<typeof customInstance>;
311
+ }): UseMutationOptions<
312
+ Awaited<ReturnType<typeof createOrganisation>>,
313
+ TError,
314
+ { data: OrganisationPostBodyBody },
315
+ TContext
316
+ > => {
317
+ const mutationKey = ["createOrganisation"];
318
+ const { mutation: mutationOptions, request: requestOptions } = options
319
+ ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
320
+ ? options
321
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
322
+ : { mutation: { mutationKey }, request: undefined };
323
+
324
+ const mutationFn: MutationFunction<
325
+ Awaited<ReturnType<typeof createOrganisation>>,
326
+ { data: OrganisationPostBodyBody }
327
+ > = (props) => {
328
+ const { data } = props ?? {};
329
+
330
+ return createOrganisation(data, requestOptions);
331
+ };
332
+
333
+ const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
334
+
335
+ return customOptions;
336
+ };
337
+
338
+ export type CreateOrganisationMutationResult = NonNullable<
339
+ Awaited<ReturnType<typeof createOrganisation>>
340
+ >;
341
+ export type CreateOrganisationMutationBody = OrganisationPostBodyBody;
342
+ export type CreateOrganisationMutationError = ErrorType<AsError | void>;
229
343
 
230
-
231
-
232
-
233
- const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisation>>, {data: OrganisationPostBodyBody}> = (props) => {
234
- const {data} = props ?? {};
235
-
236
- return createOrganisation(data,requestOptions)
237
- }
238
-
239
-
240
-
241
-
242
- return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{data: OrganisationPostBodyBody}, TContext>}
243
-
244
- export type CreateOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisation>>>
245
- export type CreateOrganisationMutationBody = OrganisationPostBodyBody
246
- export type CreateOrganisationMutationError = ErrorType<AsError | void>
247
-
248
- /**
344
+ /**
249
345
  * @summary Create a new organisation
250
346
  */
251
- export const useCreateOrganisation = <TData = Awaited<ReturnType<typeof createOrganisation>>, TError = ErrorType<AsError | void>,
252
- TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
347
+ export const useCreateOrganisation = <TError = ErrorType<AsError | void>, TContext = unknown>(
348
+ options?: {
349
+ mutation?: UseMutationOptions<
350
+ Awaited<ReturnType<typeof createOrganisation>>,
351
+ TError,
352
+ { data: OrganisationPostBodyBody },
353
+ TContext
354
+ >;
355
+ request?: SecondParameter<typeof customInstance>;
356
+ },
357
+ queryClient?: QueryClient,
253
358
  ): UseMutationResult<
254
- TData,
255
- TError,
256
- {data: OrganisationPostBodyBody},
257
- TContext
258
- > => {
259
-
260
- const mutationOptions = getCreateOrganisationMutationOptions(options);
261
-
262
- return useMutation(mutationOptions);
263
- }
264
- /**
359
+ Awaited<ReturnType<typeof createOrganisation>>,
360
+ TError,
361
+ { data: OrganisationPostBodyBody },
362
+ TContext
363
+ > => {
364
+ const mutationOptions = useCreateOrganisationMutationOptions(options);
365
+
366
+ return useMutation(mutationOptions, queryClient);
367
+ };
368
+ /**
265
369
  * Gets an Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation or are its *creator*.
266
370
 
267
371
  Members of an Organisation's **Unit** do not have access to the Organisation.
@@ -269,211 +373,319 @@ Members of an Organisation's **Unit** do not have access to the Organisation.
269
373
  * @summary Gets an Organisation
270
374
  */
271
375
  export const getOrganisation = (
272
- orgId: string,
273
- options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
376
+ orgId: string,
377
+ options?: SecondParameter<typeof customInstance>,
378
+ signal?: AbortSignal,
274
379
  ) => {
275
-
276
-
277
- return customInstance<OrganisationAllDetail>(
278
- {url: `/organisation/${orgId}`, method: 'GET', signal
279
- },
280
- options);
281
- }
282
-
283
-
284
- export const getGetOrganisationQueryKey = (orgId: string,) => {
285
- return ["account-server-api", `/organisation/${orgId}`] as const;
286
- }
287
-
288
-
289
- export const getGetOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
380
+ return customInstance<OrganisationAllDetail>(
381
+ { url: `/organisation/${orgId}`, method: "GET", signal },
382
+ options,
383
+ );
384
+ };
385
+
386
+ export const getGetOrganisationQueryKey = (orgId: string) => {
387
+ return [`/organisation/${orgId}`] as const;
388
+ };
389
+
390
+ export const useGetOrganisationQueryOptions = <
391
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
392
+ TError = ErrorType<void | AsError>,
393
+ >(
394
+ orgId: string,
395
+ options?: {
396
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;
397
+ request?: SecondParameter<typeof customInstance>;
398
+ },
290
399
  ) => {
400
+ const { query: queryOptions, request: requestOptions } = options ?? {};
291
401
 
292
- const {query: queryOptions, request: requestOptions} = options ?? {};
293
-
294
- const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
402
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
295
403
 
296
-
404
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) =>
405
+ getOrganisation(orgId, requestOptions, signal);
297
406
 
298
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) => getOrganisation(orgId, requestOptions, signal);
407
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
299
408
 
300
-
409
+ return customOptions as UseQueryOptions<
410
+ Awaited<ReturnType<typeof getOrganisation>>,
411
+ TError,
412
+ TData
413
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
414
+ };
301
415
 
302
-
416
+ export type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>;
417
+ export type GetOrganisationQueryError = ErrorType<void | AsError>;
303
418
 
304
- return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
305
- }
306
-
307
- export type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>
308
- export type GetOrganisationQueryError = ErrorType<void | AsError>
309
-
310
-
311
- export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
312
- orgId: string, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> & Pick<
419
+ export function useGetOrganisation<
420
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
421
+ TError = ErrorType<void | AsError>,
422
+ >(
423
+ orgId: string,
424
+ options: {
425
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> &
426
+ Pick<
313
427
  DefinedInitialDataOptions<
314
428
  Awaited<ReturnType<typeof getOrganisation>>,
315
429
  TError,
316
- TData
317
- > , 'initialData'
318
- >, request?: SecondParameter<typeof customInstance>}
319
-
320
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
321
- export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
322
- orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> & Pick<
430
+ Awaited<ReturnType<typeof getOrganisation>>
431
+ >,
432
+ "initialData"
433
+ >;
434
+ request?: SecondParameter<typeof customInstance>;
435
+ },
436
+ queryClient?: QueryClient,
437
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
438
+ export function useGetOrganisation<
439
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
440
+ TError = ErrorType<void | AsError>,
441
+ >(
442
+ orgId: string,
443
+ options?: {
444
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> &
445
+ Pick<
323
446
  UndefinedInitialDataOptions<
324
447
  Awaited<ReturnType<typeof getOrganisation>>,
325
448
  TError,
326
- TData
327
- > , 'initialData'
328
- >, request?: SecondParameter<typeof customInstance>}
329
-
330
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
331
- export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
332
- orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
333
-
334
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
449
+ Awaited<ReturnType<typeof getOrganisation>>
450
+ >,
451
+ "initialData"
452
+ >;
453
+ request?: SecondParameter<typeof customInstance>;
454
+ },
455
+ queryClient?: QueryClient,
456
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
457
+ export function useGetOrganisation<
458
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
459
+ TError = ErrorType<void | AsError>,
460
+ >(
461
+ orgId: string,
462
+ options?: {
463
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;
464
+ request?: SecondParameter<typeof customInstance>;
465
+ },
466
+ queryClient?: QueryClient,
467
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
335
468
  /**
336
469
  * @summary Gets an Organisation
337
470
  */
338
471
 
339
- export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
340
- orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
341
-
342
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
343
-
344
- const queryOptions = getGetOrganisationQueryOptions(orgId,options)
345
-
346
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
347
-
348
- query.queryKey = queryOptions.queryKey ;
472
+ export function useGetOrganisation<
473
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
474
+ TError = ErrorType<void | AsError>,
475
+ >(
476
+ orgId: string,
477
+ options?: {
478
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>;
479
+ request?: SecondParameter<typeof customInstance>;
480
+ },
481
+ queryClient?: QueryClient,
482
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
483
+ const queryOptions = useGetOrganisationQueryOptions(orgId, options);
484
+
485
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
486
+ queryKey: DataTag<QueryKey, TData, TError>;
487
+ };
488
+
489
+ query.queryKey = queryOptions.queryKey;
349
490
 
350
491
  return query;
351
492
  }
352
493
 
353
-
354
-
355
- export const getGetOrganisationSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
494
+ export const useGetOrganisationSuspenseQueryOptions = <
495
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
496
+ TError = ErrorType<void | AsError>,
497
+ >(
498
+ orgId: string,
499
+ options?: {
500
+ query?: Partial<
501
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>
502
+ >;
503
+ request?: SecondParameter<typeof customInstance>;
504
+ },
356
505
  ) => {
357
-
358
- const {query: queryOptions, request: requestOptions} = options ?? {};
359
-
360
- const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
361
-
362
-
363
-
364
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) => getOrganisation(orgId, requestOptions, signal);
365
-
366
-
367
-
368
-
369
-
370
- return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
371
- }
372
-
373
- export type GetOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>
374
- export type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>
375
-
376
-
377
- export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
378
- orgId: string, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
379
-
380
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
381
- export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
382
- orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
383
-
384
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
385
- export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
386
- orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
387
-
388
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
506
+ const { query: queryOptions, request: requestOptions } = options ?? {};
507
+
508
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
509
+
510
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) =>
511
+ getOrganisation(orgId, requestOptions, signal);
512
+
513
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
514
+
515
+ return customOptions as UseSuspenseQueryOptions<
516
+ Awaited<ReturnType<typeof getOrganisation>>,
517
+ TError,
518
+ TData
519
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
520
+ };
521
+
522
+ export type GetOrganisationSuspenseQueryResult = NonNullable<
523
+ Awaited<ReturnType<typeof getOrganisation>>
524
+ >;
525
+ export type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>;
526
+
527
+ export function useGetOrganisationSuspense<
528
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
529
+ TError = ErrorType<void | AsError>,
530
+ >(
531
+ orgId: string,
532
+ options: {
533
+ query: Partial<
534
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>
535
+ >;
536
+ request?: SecondParameter<typeof customInstance>;
537
+ },
538
+ queryClient?: QueryClient,
539
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
540
+ export function useGetOrganisationSuspense<
541
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
542
+ TError = ErrorType<void | AsError>,
543
+ >(
544
+ orgId: string,
545
+ options?: {
546
+ query?: Partial<
547
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>
548
+ >;
549
+ request?: SecondParameter<typeof customInstance>;
550
+ },
551
+ queryClient?: QueryClient,
552
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
553
+ export function useGetOrganisationSuspense<
554
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
555
+ TError = ErrorType<void | AsError>,
556
+ >(
557
+ orgId: string,
558
+ options?: {
559
+ query?: Partial<
560
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>
561
+ >;
562
+ request?: SecondParameter<typeof customInstance>;
563
+ },
564
+ queryClient?: QueryClient,
565
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
389
566
  /**
390
567
  * @summary Gets an Organisation
391
568
  */
392
569
 
393
- export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
394
- orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
395
-
396
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
397
-
398
- const queryOptions = getGetOrganisationSuspenseQueryOptions(orgId,options)
399
-
400
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
401
-
402
- query.queryKey = queryOptions.queryKey ;
570
+ export function useGetOrganisationSuspense<
571
+ TData = Awaited<ReturnType<typeof getOrganisation>>,
572
+ TError = ErrorType<void | AsError>,
573
+ >(
574
+ orgId: string,
575
+ options?: {
576
+ query?: Partial<
577
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>
578
+ >;
579
+ request?: SecondParameter<typeof customInstance>;
580
+ },
581
+ queryClient?: QueryClient,
582
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
583
+ const queryOptions = useGetOrganisationSuspenseQueryOptions(orgId, options);
584
+
585
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
586
+ TData,
587
+ TError
588
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
589
+
590
+ query.queryKey = queryOptions.queryKey;
403
591
 
404
592
  return query;
405
593
  }
406
594
 
407
-
408
-
409
595
  /**
410
- * Used to update existing Organisation.
596
+ * Used to update existing Organisation. You can change an Organisation's **name** or its **default_product_privacy**.
597
+
598
+ Changes 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.
411
599
 
412
600
  You have to be a member of the **Organisation**, its creator, or an administrator to patch an Organisation.
413
601
 
414
602
  * @summary Adjust an existing Organisation
415
603
  */
416
604
  export const patchOrganisation = (
417
- orgId: string,
418
- organisationPatchBodyBody: OrganisationPatchBodyBody,
419
- options?: SecondParameter<typeof customInstance>,) => {
420
-
421
-
422
- return customInstance<void>(
423
- {url: `/organisation/${orgId}`, method: 'PATCH',
424
- headers: {'Content-Type': 'application/json', },
425
- data: organisationPatchBodyBody
426
- },
427
- options);
428
- }
429
-
430
-
431
-
432
- export const getPatchOrganisationMutationOptions = <TData = Awaited<ReturnType<typeof patchOrganisation>>, TError = ErrorType<void | AsError>,
433
- TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
605
+ orgId: string,
606
+ organisationPatchBodyBody: OrganisationPatchBodyBody,
607
+ options?: SecondParameter<typeof customInstance>,
434
608
  ) => {
435
- const mutationKey = ['patchOrganisation'];
436
- const {mutation: mutationOptions, request: requestOptions} = options ?
437
- options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
438
- options
439
- : {...options, mutation: {...options.mutation, mutationKey}}
440
- : {mutation: { mutationKey, }, request: undefined};
441
-
442
-
443
-
444
-
445
- const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchOrganisation>>, {orgId: string;data: OrganisationPatchBodyBody}> = (props) => {
446
- const {orgId,data} = props ?? {};
447
-
448
- return patchOrganisation(orgId,data,requestOptions)
449
- }
450
-
451
-
452
-
453
-
454
- return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>}
455
-
456
- export type PatchOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof patchOrganisation>>>
457
- export type PatchOrganisationMutationBody = OrganisationPatchBodyBody
458
- export type PatchOrganisationMutationError = ErrorType<void | AsError>
609
+ return customInstance<void>(
610
+ {
611
+ url: `/organisation/${orgId}`,
612
+ method: "PATCH",
613
+ headers: { "Content-Type": "application/json" },
614
+ data: organisationPatchBodyBody,
615
+ },
616
+ options,
617
+ );
618
+ };
619
+
620
+ export const usePatchOrganisationMutationOptions = <
621
+ TError = ErrorType<void | AsError>,
622
+ TContext = unknown,
623
+ >(options?: {
624
+ mutation?: UseMutationOptions<
625
+ Awaited<ReturnType<typeof patchOrganisation>>,
626
+ TError,
627
+ { orgId: string; data: OrganisationPatchBodyBody },
628
+ TContext
629
+ >;
630
+ request?: SecondParameter<typeof customInstance>;
631
+ }): UseMutationOptions<
632
+ Awaited<ReturnType<typeof patchOrganisation>>,
633
+ TError,
634
+ { orgId: string; data: OrganisationPatchBodyBody },
635
+ TContext
636
+ > => {
637
+ const mutationKey = ["patchOrganisation"];
638
+ const { mutation: mutationOptions, request: requestOptions } = options
639
+ ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
640
+ ? options
641
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
642
+ : { mutation: { mutationKey }, request: undefined };
643
+
644
+ const mutationFn: MutationFunction<
645
+ Awaited<ReturnType<typeof patchOrganisation>>,
646
+ { orgId: string; data: OrganisationPatchBodyBody }
647
+ > = (props) => {
648
+ const { orgId, data } = props ?? {};
649
+
650
+ return patchOrganisation(orgId, data, requestOptions);
651
+ };
652
+
653
+ const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
654
+
655
+ return customOptions;
656
+ };
657
+
658
+ export type PatchOrganisationMutationResult = NonNullable<
659
+ Awaited<ReturnType<typeof patchOrganisation>>
660
+ >;
661
+ export type PatchOrganisationMutationBody = OrganisationPatchBodyBody;
662
+ export type PatchOrganisationMutationError = ErrorType<void | AsError>;
459
663
 
460
- /**
664
+ /**
461
665
  * @summary Adjust an existing Organisation
462
666
  */
463
- export const usePatchOrganisation = <TData = Awaited<ReturnType<typeof patchOrganisation>>, TError = ErrorType<void | AsError>,
464
- TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
667
+ export const usePatchOrganisation = <TError = ErrorType<void | AsError>, TContext = unknown>(
668
+ options?: {
669
+ mutation?: UseMutationOptions<
670
+ Awaited<ReturnType<typeof patchOrganisation>>,
671
+ TError,
672
+ { orgId: string; data: OrganisationPatchBodyBody },
673
+ TContext
674
+ >;
675
+ request?: SecondParameter<typeof customInstance>;
676
+ },
677
+ queryClient?: QueryClient,
465
678
  ): UseMutationResult<
466
- TData,
467
- TError,
468
- {orgId: string;data: OrganisationPatchBodyBody},
469
- TContext
470
- > => {
471
-
472
- const mutationOptions = getPatchOrganisationMutationOptions(options);
473
-
474
- return useMutation(mutationOptions);
475
- }
476
- /**
679
+ Awaited<ReturnType<typeof patchOrganisation>>,
680
+ TError,
681
+ { orgId: string; data: OrganisationPatchBodyBody },
682
+ TContext
683
+ > => {
684
+ const mutationOptions = usePatchOrganisationMutationOptions(options);
685
+
686
+ return useMutation(mutationOptions, queryClient);
687
+ };
688
+ /**
477
689
  * Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.
478
690
 
479
691
  You need admin rights to use this method
@@ -481,63 +693,81 @@ You need admin rights to use this method
481
693
  * @summary Deletes an Organisation
482
694
  */
483
695
  export const deleteOrganisation = (
484
- orgId: string,
485
- options?: SecondParameter<typeof customInstance>,) => {
486
-
487
-
488
- return customInstance<void>(
489
- {url: `/organisation/${orgId}`, method: 'DELETE'
490
- },
491
- options);
492
- }
493
-
494
-
495
-
496
- export const getDeleteOrganisationMutationOptions = <TData = Awaited<ReturnType<typeof deleteOrganisation>>, TError = ErrorType<AsError | void>,
497
- TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
696
+ orgId: string,
697
+ options?: SecondParameter<typeof customInstance>,
498
698
  ) => {
499
- const mutationKey = ['deleteOrganisation'];
500
- const {mutation: mutationOptions, request: requestOptions} = options ?
501
- options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
502
- options
503
- : {...options, mutation: {...options.mutation, mutationKey}}
504
- : {mutation: { mutationKey, }, request: undefined};
505
-
506
-
507
-
508
-
509
- const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisation>>, {orgId: string}> = (props) => {
510
- const {orgId} = props ?? {};
511
-
512
- return deleteOrganisation(orgId,requestOptions)
513
- }
514
-
515
-
699
+ return customInstance<void>({ url: `/organisation/${orgId}`, method: "DELETE" }, options);
700
+ };
701
+
702
+ export const useDeleteOrganisationMutationOptions = <
703
+ TError = ErrorType<AsError | void>,
704
+ TContext = unknown,
705
+ >(options?: {
706
+ mutation?: UseMutationOptions<
707
+ Awaited<ReturnType<typeof deleteOrganisation>>,
708
+ TError,
709
+ { orgId: string },
710
+ TContext
711
+ >;
712
+ request?: SecondParameter<typeof customInstance>;
713
+ }): UseMutationOptions<
714
+ Awaited<ReturnType<typeof deleteOrganisation>>,
715
+ TError,
716
+ { orgId: string },
717
+ TContext
718
+ > => {
719
+ const mutationKey = ["deleteOrganisation"];
720
+ const { mutation: mutationOptions, request: requestOptions } = options
721
+ ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
722
+ ? options
723
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
724
+ : { mutation: { mutationKey }, request: undefined };
725
+
726
+ const mutationFn: MutationFunction<
727
+ Awaited<ReturnType<typeof deleteOrganisation>>,
728
+ { orgId: string }
729
+ > = (props) => {
730
+ const { orgId } = props ?? {};
731
+
732
+ return deleteOrganisation(orgId, requestOptions);
733
+ };
734
+
735
+ const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
736
+
737
+ return customOptions;
738
+ };
739
+
740
+ export type DeleteOrganisationMutationResult = NonNullable<
741
+ Awaited<ReturnType<typeof deleteOrganisation>>
742
+ >;
743
+
744
+ export type DeleteOrganisationMutationError = ErrorType<AsError | void>;
516
745
 
517
-
518
- return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{orgId: string}, TContext>}
519
-
520
- export type DeleteOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisation>>>
521
-
522
- export type DeleteOrganisationMutationError = ErrorType<AsError | void>
523
-
524
- /**
746
+ /**
525
747
  * @summary Deletes an Organisation
526
748
  */
527
- export const useDeleteOrganisation = <TData = Awaited<ReturnType<typeof deleteOrganisation>>, TError = ErrorType<AsError | void>,
528
- TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
749
+ export const useDeleteOrganisation = <TError = ErrorType<AsError | void>, TContext = unknown>(
750
+ options?: {
751
+ mutation?: UseMutationOptions<
752
+ Awaited<ReturnType<typeof deleteOrganisation>>,
753
+ TError,
754
+ { orgId: string },
755
+ TContext
756
+ >;
757
+ request?: SecondParameter<typeof customInstance>;
758
+ },
759
+ queryClient?: QueryClient,
529
760
  ): UseMutationResult<
530
- TData,
531
- TError,
532
- {orgId: string},
533
- TContext
534
- > => {
535
-
536
- const mutationOptions = getDeleteOrganisationMutationOptions(options);
537
-
538
- return useMutation(mutationOptions);
539
- }
540
- /**
761
+ Awaited<ReturnType<typeof deleteOrganisation>>,
762
+ TError,
763
+ { orgId: string },
764
+ TContext
765
+ > => {
766
+ const mutationOptions = useDeleteOrganisationMutationOptions(options);
767
+
768
+ return useMutation(mutationOptions, queryClient);
769
+ };
770
+ /**
541
771
  * Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.
542
772
 
543
773
  Any authorised user can see the Default Organisation.
@@ -545,140 +775,218 @@ Any authorised user can see the Default Organisation.
545
775
  * @summary Gets the Default Organisation
546
776
  */
547
777
  export const getDefaultOrganisation = (
548
-
549
- options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
778
+ options?: SecondParameter<typeof customInstance>,
779
+ signal?: AbortSignal,
550
780
  ) => {
551
-
552
-
553
- return customInstance<OrganisationGetDefaultResponse>(
554
- {url: `/default/organisation`, method: 'GET', signal
555
- },
556
- options);
557
- }
558
-
781
+ return customInstance<OrganisationGetDefaultResponse>(
782
+ { url: `/default/organisation`, method: "GET", signal },
783
+ options,
784
+ );
785
+ };
559
786
 
560
787
  export const getGetDefaultOrganisationQueryKey = () => {
561
- return ["account-server-api", `/default/organisation`] as const;
562
- }
563
-
564
-
565
- export const getGetDefaultOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
566
- ) => {
567
-
568
- const {query: queryOptions, request: requestOptions} = options ?? {};
569
-
570
- const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
571
-
572
-
573
-
574
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
575
-
576
-
577
-
578
-
579
-
580
- return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
581
- }
582
-
583
- export type GetDefaultOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
584
- export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>
585
-
586
-
587
- export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
588
- options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>> & Pick<
788
+ return [`/default/organisation`] as const;
789
+ };
790
+
791
+ export const useGetDefaultOrganisationQueryOptions = <
792
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
793
+ TError = ErrorType<void | AsError>,
794
+ >(options?: {
795
+ query?: Partial<
796
+ UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
797
+ >;
798
+ request?: SecondParameter<typeof customInstance>;
799
+ }) => {
800
+ const { query: queryOptions, request: requestOptions } = options ?? {};
801
+
802
+ const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
803
+
804
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) =>
805
+ getDefaultOrganisation(requestOptions, signal);
806
+
807
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
808
+
809
+ return customOptions as UseQueryOptions<
810
+ Awaited<ReturnType<typeof getDefaultOrganisation>>,
811
+ TError,
812
+ TData
813
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
814
+ };
815
+
816
+ export type GetDefaultOrganisationQueryResult = NonNullable<
817
+ Awaited<ReturnType<typeof getDefaultOrganisation>>
818
+ >;
819
+ export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;
820
+
821
+ export function useGetDefaultOrganisation<
822
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
823
+ TError = ErrorType<void | AsError>,
824
+ >(
825
+ options: {
826
+ query: Partial<
827
+ UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
828
+ > &
829
+ Pick<
589
830
  DefinedInitialDataOptions<
590
831
  Awaited<ReturnType<typeof getDefaultOrganisation>>,
591
832
  TError,
592
- TData
593
- > , 'initialData'
594
- >, request?: SecondParameter<typeof customInstance>}
595
-
596
- ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
597
- export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
598
- options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>> & Pick<
833
+ Awaited<ReturnType<typeof getDefaultOrganisation>>
834
+ >,
835
+ "initialData"
836
+ >;
837
+ request?: SecondParameter<typeof customInstance>;
838
+ },
839
+ queryClient?: QueryClient,
840
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
841
+ export function useGetDefaultOrganisation<
842
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
843
+ TError = ErrorType<void | AsError>,
844
+ >(
845
+ options?: {
846
+ query?: Partial<
847
+ UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
848
+ > &
849
+ Pick<
599
850
  UndefinedInitialDataOptions<
600
851
  Awaited<ReturnType<typeof getDefaultOrganisation>>,
601
852
  TError,
602
- TData
603
- > , 'initialData'
604
- >, request?: SecondParameter<typeof customInstance>}
605
-
606
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
607
- export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
608
- options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
609
-
610
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
853
+ Awaited<ReturnType<typeof getDefaultOrganisation>>
854
+ >,
855
+ "initialData"
856
+ >;
857
+ request?: SecondParameter<typeof customInstance>;
858
+ },
859
+ queryClient?: QueryClient,
860
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
861
+ export function useGetDefaultOrganisation<
862
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
863
+ TError = ErrorType<void | AsError>,
864
+ >(
865
+ options?: {
866
+ query?: Partial<
867
+ UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
868
+ >;
869
+ request?: SecondParameter<typeof customInstance>;
870
+ },
871
+ queryClient?: QueryClient,
872
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
611
873
  /**
612
874
  * @summary Gets the Default Organisation
613
875
  */
614
876
 
615
- export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
616
- options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
617
-
618
- ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
619
-
620
- const queryOptions = getGetDefaultOrganisationQueryOptions(options)
621
-
622
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
623
-
624
- query.queryKey = queryOptions.queryKey ;
877
+ export function useGetDefaultOrganisation<
878
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
879
+ TError = ErrorType<void | AsError>,
880
+ >(
881
+ options?: {
882
+ query?: Partial<
883
+ UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
884
+ >;
885
+ request?: SecondParameter<typeof customInstance>;
886
+ },
887
+ queryClient?: QueryClient,
888
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
889
+ const queryOptions = useGetDefaultOrganisationQueryOptions(options);
890
+
891
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
892
+ queryKey: DataTag<QueryKey, TData, TError>;
893
+ };
894
+
895
+ query.queryKey = queryOptions.queryKey;
625
896
 
626
897
  return query;
627
898
  }
628
899
 
629
-
630
-
631
- export const getGetDefaultOrganisationSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
632
- ) => {
633
-
634
- const {query: queryOptions, request: requestOptions} = options ?? {};
635
-
636
- const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
637
-
638
-
639
-
640
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
641
-
642
-
643
-
644
-
645
-
646
- return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
647
- }
648
-
649
- export type GetDefaultOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
650
- export type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>
651
-
652
-
653
- export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
654
- options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
655
-
656
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
657
- export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
658
- options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
659
-
660
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
661
- export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
662
- options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
663
-
664
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
900
+ export const useGetDefaultOrganisationSuspenseQueryOptions = <
901
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
902
+ TError = ErrorType<void | AsError>,
903
+ >(options?: {
904
+ query?: Partial<
905
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
906
+ >;
907
+ request?: SecondParameter<typeof customInstance>;
908
+ }) => {
909
+ const { query: queryOptions, request: requestOptions } = options ?? {};
910
+
911
+ const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
912
+
913
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) =>
914
+ getDefaultOrganisation(requestOptions, signal);
915
+
916
+ const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
917
+
918
+ return customOptions as UseSuspenseQueryOptions<
919
+ Awaited<ReturnType<typeof getDefaultOrganisation>>,
920
+ TError,
921
+ TData
922
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
923
+ };
924
+
925
+ export type GetDefaultOrganisationSuspenseQueryResult = NonNullable<
926
+ Awaited<ReturnType<typeof getDefaultOrganisation>>
927
+ >;
928
+ export type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>;
929
+
930
+ export function useGetDefaultOrganisationSuspense<
931
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
932
+ TError = ErrorType<void | AsError>,
933
+ >(
934
+ options: {
935
+ query: Partial<
936
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
937
+ >;
938
+ request?: SecondParameter<typeof customInstance>;
939
+ },
940
+ queryClient?: QueryClient,
941
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
942
+ export function useGetDefaultOrganisationSuspense<
943
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
944
+ TError = ErrorType<void | AsError>,
945
+ >(
946
+ options?: {
947
+ query?: Partial<
948
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
949
+ >;
950
+ request?: SecondParameter<typeof customInstance>;
951
+ },
952
+ queryClient?: QueryClient,
953
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
954
+ export function useGetDefaultOrganisationSuspense<
955
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
956
+ TError = ErrorType<void | AsError>,
957
+ >(
958
+ options?: {
959
+ query?: Partial<
960
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
961
+ >;
962
+ request?: SecondParameter<typeof customInstance>;
963
+ },
964
+ queryClient?: QueryClient,
965
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
665
966
  /**
666
967
  * @summary Gets the Default Organisation
667
968
  */
668
969
 
669
- export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
670
- options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
671
-
672
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
673
-
674
- const queryOptions = getGetDefaultOrganisationSuspenseQueryOptions(options)
675
-
676
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
677
-
678
- query.queryKey = queryOptions.queryKey ;
970
+ export function useGetDefaultOrganisationSuspense<
971
+ TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
972
+ TError = ErrorType<void | AsError>,
973
+ >(
974
+ options?: {
975
+ query?: Partial<
976
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>
977
+ >;
978
+ request?: SecondParameter<typeof customInstance>;
979
+ },
980
+ queryClient?: QueryClient,
981
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
982
+ const queryOptions = useGetDefaultOrganisationSuspenseQueryOptions(options);
983
+
984
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
985
+ TData,
986
+ TError
987
+ > & { queryKey: DataTag<QueryKey, TData, TError> };
988
+
989
+ query.queryKey = queryOptions.queryKey;
679
990
 
680
991
  return query;
681
992
  }
682
-
683
-
684
-