@squonk/account-server-client 2.1.0-rc.1 → 2.1.0-rc.11

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 (78) hide show
  1. package/README.md +1 -1
  2. package/admin/admin.cjs +30 -8
  3. package/admin/admin.cjs.map +1 -1
  4. package/admin/admin.d.cts +50 -0
  5. package/admin/admin.d.ts +26 -6
  6. package/admin/admin.js +30 -8
  7. package/admin/admin.js.map +1 -1
  8. package/asset/asset.cjs +62 -22
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +260 -0
  11. package/asset/asset.d.ts +79 -36
  12. package/asset/asset.js +54 -14
  13. package/asset/asset.js.map +1 -1
  14. package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
  15. package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
  16. package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
  17. package/chunk-TKLTUR4R.cjs.map +1 -0
  18. package/event-stream/event-stream.cjs +64 -19
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +142 -0
  21. package/event-stream/event-stream.d.ts +66 -20
  22. package/event-stream/event-stream.js +61 -16
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +10 -10
  25. package/index.cjs.map +1 -1
  26. package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +163 -163
  27. package/index.d.ts +700 -2
  28. package/index.js +9 -9
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +53 -14
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +91 -0
  33. package/merchant/merchant.d.ts +48 -8
  34. package/merchant/merchant.js +52 -13
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +110 -28
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +271 -0
  39. package/organisation/organisation.d.ts +114 -25
  40. package/organisation/organisation.js +103 -21
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +12 -12
  43. package/product/product.cjs +182 -47
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +399 -0
  46. package/product/product.d.ts +180 -31
  47. package/product/product.js +172 -37
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +272 -280
  50. package/src/admin/admin.ts +114 -84
  51. package/src/asset/asset.ts +480 -565
  52. package/src/custom-instance.ts +3 -4
  53. package/src/event-stream/event-stream.ts +300 -275
  54. package/src/merchant/merchant.ts +206 -142
  55. package/src/organisation/organisation.ts +549 -490
  56. package/src/product/product.ts +829 -688
  57. package/src/state/state.ts +112 -75
  58. package/src/unit/unit.ts +645 -599
  59. package/src/user/user.ts +489 -469
  60. package/state/state.cjs +29 -8
  61. package/state/state.cjs.map +1 -1
  62. package/state/state.d.cts +46 -0
  63. package/state/state.d.ts +26 -6
  64. package/state/state.js +29 -8
  65. package/state/state.js.map +1 -1
  66. package/unit/unit.cjs +120 -32
  67. package/unit/unit.cjs.map +1 -1
  68. package/unit/unit.d.cts +322 -0
  69. package/unit/unit.d.ts +133 -38
  70. package/unit/unit.js +112 -24
  71. package/unit/unit.js.map +1 -1
  72. package/user/user.cjs +96 -22
  73. package/user/user.cjs.map +1 -1
  74. package/user/user.d.cts +271 -0
  75. package/user/user.d.ts +96 -24
  76. package/user/user.js +90 -16
  77. package/user/user.js.map +1 -1
  78. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.15.0 🍺
2
+ * Generated by orval v6.25.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,36 +8,38 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 2.1
10
10
  */
11
- import { useQuery, useMutation } from "@tanstack/react-query";
11
+ import {
12
+ useMutation,
13
+ useQuery,
14
+ useSuspenseQuery
15
+ } from '@tanstack/react-query'
12
16
  import type {
13
- UseQueryOptions,
14
- UseMutationOptions,
15
- QueryFunction,
16
17
  MutationFunction,
17
- UseQueryResult,
18
+ QueryFunction,
18
19
  QueryKey,
19
- } from "@tanstack/react-query";
20
+ UseMutationOptions,
21
+ UseQueryOptions,
22
+ UseQueryResult,
23
+ UseSuspenseQueryOptions,
24
+ UseSuspenseQueryResult
25
+ } from '@tanstack/react-query'
20
26
  import type {
21
- OrganisationsGetResponse,
22
27
  AsError,
23
- OrganisationPostResponse,
24
- OrganisationPostBodyBody,
25
- OrganisationGetResponse,
26
- OrganisationPatchBodyBody,
27
- OrganisationChargesGetResponse,
28
28
  GetOrganisationChargesParams,
29
+ OrganisationChargesGetResponse,
30
+ OrganisationDetail,
29
31
  OrganisationGetDefaultResponse,
30
- } from "../account-server-api.schemas";
31
- import { customInstance } from ".././custom-instance";
32
- import type { ErrorType } from ".././custom-instance";
33
-
34
- // eslint-disable-next-line
35
- type SecondParameter<T extends (...args: any) => any> = T extends (
36
- config: any,
37
- args: infer P
38
- ) => any
39
- ? P
40
- : never;
32
+ OrganisationPatchBodyBody,
33
+ OrganisationPostBodyBody,
34
+ OrganisationPostResponse,
35
+ OrganisationsGetResponse
36
+ } from '../account-server-api.schemas'
37
+ import { customInstance } from '.././custom-instance';
38
+ import type { ErrorType } from '.././custom-instance';
39
+
40
+
41
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
42
+
41
43
 
42
44
  /**
43
45
  * Gets all the Organisations that you are a member of or are public. Admin users are members of all Organisations
@@ -45,69 +47,102 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
45
47
  * @summary Gets Organisations
46
48
  */
47
49
  export const getOrganisations = (
48
- options?: SecondParameter<typeof customInstance>,
49
- signal?: AbortSignal
50
+
51
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
52
+ ) => {
53
+
54
+
55
+ return customInstance<OrganisationsGetResponse>(
56
+ {url: `/organisation`, method: 'GET', signal
57
+ },
58
+ options);
59
+ }
60
+
61
+
62
+ export const getGetOrganisationsQueryKey = () => {
63
+ return ["account-server-api", `/organisation`] as const;
64
+ }
65
+
66
+
67
+ export const getGetOrganisationsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
68
+ ) => {
69
+
70
+ const {query: queryOptions, request: requestOptions} = options ?? {};
71
+
72
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();
73
+
74
+
75
+
76
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);
77
+
78
+
79
+
80
+
81
+
82
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: QueryKey }
83
+ }
84
+
85
+ export type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
86
+ export type GetOrganisationsQueryError = ErrorType<void | AsError>
87
+
88
+ /**
89
+ * @summary Gets Organisations
90
+ */
91
+ export const useGetOrganisations = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
92
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
93
+
94
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
95
+
96
+ const queryOptions = getGetOrganisationsQueryOptions(options)
97
+
98
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
99
+
100
+ query.queryKey = queryOptions.queryKey ;
101
+
102
+ return query;
103
+ }
104
+
105
+
106
+
107
+ export const getGetOrganisationsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
50
108
  ) => {
51
- return customInstance<OrganisationsGetResponse>(
52
- { url: `/organisation`, method: "get", signal },
53
- options
54
- );
55
- };
56
-
57
- export const getGetOrganisationsQueryKey = () => ["account-server-api", `/organisation`] as const;
58
-
59
- export const getGetOrganisationsQueryOptions = <
60
- TData = Awaited<ReturnType<typeof getOrganisations>>,
61
- TError = ErrorType<void | AsError>
62
- >(options?: {
63
- query?: UseQueryOptions<
64
- Awaited<ReturnType<typeof getOrganisations>>,
65
- TError,
66
- TData
67
- >;
68
- request?: SecondParameter<typeof customInstance>;
69
- }): UseQueryOptions<
70
- Awaited<ReturnType<typeof getOrganisations>>,
71
- TError,
72
- TData
73
- > & { queryKey: QueryKey } => {
74
- const { query: queryOptions, request: requestOptions } = options ?? {};
75
-
76
- const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();
77
-
78
- const queryFn: QueryFunction<
79
- Awaited<ReturnType<typeof getOrganisations>>
80
- > = ({ signal }) => getOrganisations(requestOptions, signal);
81
-
82
- return { queryKey, queryFn, ...queryOptions };
83
- };
84
-
85
- export type GetOrganisationsQueryResult = NonNullable<
86
- Awaited<ReturnType<typeof getOrganisations>>
87
- >;
88
- export type GetOrganisationsQueryError = ErrorType<void | AsError>;
89
-
90
- export const useGetOrganisations = <
91
- TData = Awaited<ReturnType<typeof getOrganisations>>,
92
- TError = ErrorType<void | AsError>
93
- >(options?: {
94
- query?: UseQueryOptions<
95
- Awaited<ReturnType<typeof getOrganisations>>,
96
- TError,
97
- TData
98
- >;
99
- request?: SecondParameter<typeof customInstance>;
100
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
101
- const queryOptions = getGetOrganisationsQueryOptions(options);
102
-
103
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
104
- queryKey: QueryKey;
105
- };
106
-
107
- query.queryKey = queryOptions.queryKey;
109
+
110
+ const {query: queryOptions, request: requestOptions} = options ?? {};
111
+
112
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();
113
+
114
+
115
+
116
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);
117
+
118
+
119
+
120
+
121
+
122
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: QueryKey }
123
+ }
124
+
125
+ export type GetOrganisationsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
126
+ export type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>
127
+
128
+ /**
129
+ * @summary Gets Organisations
130
+ */
131
+ export const useGetOrganisationsSuspense = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
132
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
133
+
134
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
135
+
136
+ const queryOptions = getGetOrganisationsSuspenseQueryOptions(options)
137
+
138
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
139
+
140
+ query.queryKey = queryOptions.queryKey ;
108
141
 
109
142
  return query;
110
- };
143
+ }
144
+
145
+
111
146
 
112
147
  /**
113
148
  * Creates a new Organisation
@@ -117,74 +152,55 @@ You need admin rights to use this method
117
152
  * @summary Create a new organisation
118
153
  */
119
154
  export const createOrganisation = (
120
- organisationPostBodyBody: OrganisationPostBodyBody,
121
- options?: SecondParameter<typeof customInstance>
122
- ) => {
123
- return customInstance<OrganisationPostResponse>(
124
- {
125
- url: `/organisation`,
126
- method: "post",
127
- headers: { "Content-Type": "application/json" },
128
- data: organisationPostBodyBody,
155
+ organisationPostBodyBody: OrganisationPostBodyBody,
156
+ options?: SecondParameter<typeof customInstance>,) => {
157
+
158
+
159
+ return customInstance<OrganisationPostResponse>(
160
+ {url: `/organisation`, method: 'POST',
161
+ headers: {'Content-Type': 'application/json', },
162
+ data: organisationPostBodyBody
129
163
  },
130
- options
131
- );
132
- };
133
-
134
- export const getCreateOrganisationMutationOptions = <
135
- TError = ErrorType<AsError | void>,
136
- TContext = unknown
137
- >(options?: {
138
- mutation?: UseMutationOptions<
139
- Awaited<ReturnType<typeof createOrganisation>>,
140
- TError,
141
- { data: OrganisationPostBodyBody },
142
- TContext
143
- >;
144
- request?: SecondParameter<typeof customInstance>;
145
- }): UseMutationOptions<
146
- Awaited<ReturnType<typeof createOrganisation>>,
147
- TError,
148
- { data: OrganisationPostBodyBody },
149
- TContext
150
- > => {
151
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
152
-
153
- const mutationFn: MutationFunction<
154
- Awaited<ReturnType<typeof createOrganisation>>,
155
- { data: OrganisationPostBodyBody }
156
- > = (props) => {
157
- const { data } = props ?? {};
158
-
159
- return createOrganisation(data, requestOptions);
160
- };
161
-
162
- return { mutationFn, ...mutationOptions };
163
- };
164
-
165
- export type CreateOrganisationMutationResult = NonNullable<
166
- Awaited<ReturnType<typeof createOrganisation>>
167
- >;
168
- export type CreateOrganisationMutationBody = OrganisationPostBodyBody;
169
- export type CreateOrganisationMutationError = ErrorType<AsError | void>;
170
-
171
- export const useCreateOrganisation = <
172
- TError = ErrorType<AsError | void>,
173
- TContext = unknown
174
- >(options?: {
175
- mutation?: UseMutationOptions<
176
- Awaited<ReturnType<typeof createOrganisation>>,
177
- TError,
178
- { data: OrganisationPostBodyBody },
179
- TContext
180
- >;
181
- request?: SecondParameter<typeof customInstance>;
182
- }) => {
183
- const mutationOptions = getCreateOrganisationMutationOptions(options);
184
-
185
- return useMutation(mutationOptions);
186
- };
187
- /**
164
+ options);
165
+ }
166
+
167
+
168
+
169
+ export const getCreateOrganisationMutationOptions = <TError = ErrorType<AsError | void>,
170
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
171
+ ): UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext> => {
172
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
173
+
174
+
175
+
176
+
177
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisation>>, {data: OrganisationPostBodyBody}> = (props) => {
178
+ const {data} = props ?? {};
179
+
180
+ return createOrganisation(data,requestOptions)
181
+ }
182
+
183
+
184
+
185
+
186
+ return { mutationFn, ...mutationOptions }}
187
+
188
+ export type CreateOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisation>>>
189
+ export type CreateOrganisationMutationBody = OrganisationPostBodyBody
190
+ export type CreateOrganisationMutationError = ErrorType<AsError | void>
191
+
192
+ /**
193
+ * @summary Create a new organisation
194
+ */
195
+ export const useCreateOrganisation = <TError = ErrorType<AsError | void>,
196
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
197
+ ) => {
198
+
199
+ const mutationOptions = getCreateOrganisationMutationOptions(options);
200
+
201
+ return useMutation(mutationOptions);
202
+ }
203
+ /**
188
204
  * Gets a specific Organisation. To see the Organisation you need admin rights or need to be a member of the Organisation.
189
205
 
190
206
  Members of an Organisation's **Unit** do not necessarily have access to the Organisation.
@@ -192,77 +208,102 @@ Members of an Organisation's **Unit** do not necessarily have access to the Orga
192
208
  * @summary Gets an Organisation
193
209
  */
194
210
  export const getOrganisation = (
195
- orgId: string,
196
- options?: SecondParameter<typeof customInstance>,
197
- signal?: AbortSignal
211
+ orgId: string,
212
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
213
+ ) => {
214
+
215
+
216
+ return customInstance<OrganisationDetail>(
217
+ {url: `/organisation/${orgId}`, method: 'GET', signal
218
+ },
219
+ options);
220
+ }
221
+
222
+
223
+ export const getGetOrganisationQueryKey = (orgId: string,) => {
224
+ return ["account-server-api", `/organisation/${orgId}`] as const;
225
+ }
226
+
227
+
228
+ 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>}
198
229
  ) => {
199
- return customInstance<OrganisationGetResponse>(
200
- { url: `/organisation/${orgId}`, method: "get", signal },
201
- options
202
- );
203
- };
204
-
205
- export const getGetOrganisationQueryKey = (orgId: string) =>
206
- ["account-server-api", `/organisation/${orgId}`] as const;
207
-
208
- export const getGetOrganisationQueryOptions = <
209
- TData = Awaited<ReturnType<typeof getOrganisation>>,
210
- TError = ErrorType<void | AsError>
211
- >(
212
- orgId: string,
213
- options?: {
214
- query?: UseQueryOptions<
215
- Awaited<ReturnType<typeof getOrganisation>>,
216
- TError,
217
- TData
218
- >;
219
- request?: SecondParameter<typeof customInstance>;
220
- }
221
- ): UseQueryOptions<
222
- Awaited<ReturnType<typeof getOrganisation>>,
223
- TError,
224
- TData
225
- > & { queryKey: QueryKey } => {
226
- const { query: queryOptions, request: requestOptions } = options ?? {};
227
-
228
- const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
229
-
230
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({
231
- signal,
232
- }) => getOrganisation(orgId, requestOptions, signal);
233
-
234
- return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
235
- };
236
-
237
- export type GetOrganisationQueryResult = NonNullable<
238
- Awaited<ReturnType<typeof getOrganisation>>
239
- >;
240
- export type GetOrganisationQueryError = ErrorType<void | AsError>;
241
-
242
- export const useGetOrganisation = <
243
- TData = Awaited<ReturnType<typeof getOrganisation>>,
244
- TError = ErrorType<void | AsError>
245
- >(
246
- orgId: string,
247
- options?: {
248
- query?: UseQueryOptions<
249
- Awaited<ReturnType<typeof getOrganisation>>,
250
- TError,
251
- TData
252
- >;
253
- request?: SecondParameter<typeof customInstance>;
254
- }
255
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
256
- const queryOptions = getGetOrganisationQueryOptions(orgId, options);
257
-
258
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
259
- queryKey: QueryKey;
260
- };
261
-
262
- query.queryKey = queryOptions.queryKey;
230
+
231
+ const {query: queryOptions, request: requestOptions} = options ?? {};
232
+
233
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
234
+
235
+
236
+
237
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) => getOrganisation(orgId, requestOptions, signal);
238
+
239
+
240
+
241
+
242
+
243
+ return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: QueryKey }
244
+ }
245
+
246
+ export type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>
247
+ export type GetOrganisationQueryError = ErrorType<void | AsError>
248
+
249
+ /**
250
+ * @summary Gets an Organisation
251
+ */
252
+ export const useGetOrganisation = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
253
+ orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
254
+
255
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
256
+
257
+ const queryOptions = getGetOrganisationQueryOptions(orgId,options)
258
+
259
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
260
+
261
+ query.queryKey = queryOptions.queryKey ;
263
262
 
264
263
  return query;
265
- };
264
+ }
265
+
266
+
267
+
268
+ 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>}
269
+ ) => {
270
+
271
+ const {query: queryOptions, request: requestOptions} = options ?? {};
272
+
273
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationQueryKey(orgId);
274
+
275
+
276
+
277
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisation>>> = ({ signal }) => getOrganisation(orgId, requestOptions, signal);
278
+
279
+
280
+
281
+
282
+
283
+ return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: QueryKey }
284
+ }
285
+
286
+ export type GetOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>
287
+ export type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>
288
+
289
+ /**
290
+ * @summary Gets an Organisation
291
+ */
292
+ export const useGetOrganisationSuspense = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
293
+ orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
294
+
295
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
296
+
297
+ const queryOptions = getGetOrganisationSuspenseQueryOptions(orgId,options)
298
+
299
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
300
+
301
+ query.queryKey = queryOptions.queryKey ;
302
+
303
+ return query;
304
+ }
305
+
306
+
266
307
 
267
308
  /**
268
309
  * Used to update existing Organisation.
@@ -272,75 +313,56 @@ You have to be the Organisation owner (or an administrator) to patch an Organisa
272
313
  * @summary Adjust an existing Organisation
273
314
  */
274
315
  export const patchOrganisation = (
275
- orgId: string,
276
- organisationPatchBodyBody: OrganisationPatchBodyBody,
277
- options?: SecondParameter<typeof customInstance>
278
- ) => {
279
- return customInstance<void>(
280
- {
281
- url: `/organisation/${orgId}`,
282
- method: "patch",
283
- headers: { "Content-Type": "application/json" },
284
- data: organisationPatchBodyBody,
316
+ orgId: string,
317
+ organisationPatchBodyBody: OrganisationPatchBodyBody,
318
+ options?: SecondParameter<typeof customInstance>,) => {
319
+
320
+
321
+ return customInstance<void>(
322
+ {url: `/organisation/${orgId}`, method: 'PATCH',
323
+ headers: {'Content-Type': 'application/json', },
324
+ data: organisationPatchBodyBody
285
325
  },
286
- options
287
- );
288
- };
289
-
290
- export const getPatchOrganisationMutationOptions = <
291
- TError = ErrorType<AsError>,
292
- TContext = unknown
293
- >(options?: {
294
- mutation?: UseMutationOptions<
295
- Awaited<ReturnType<typeof patchOrganisation>>,
296
- TError,
297
- { orgId: string; data: OrganisationPatchBodyBody },
298
- TContext
299
- >;
300
- request?: SecondParameter<typeof customInstance>;
301
- }): UseMutationOptions<
302
- Awaited<ReturnType<typeof patchOrganisation>>,
303
- TError,
304
- { orgId: string; data: OrganisationPatchBodyBody },
305
- TContext
306
- > => {
307
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
308
-
309
- const mutationFn: MutationFunction<
310
- Awaited<ReturnType<typeof patchOrganisation>>,
311
- { orgId: string; data: OrganisationPatchBodyBody }
312
- > = (props) => {
313
- const { orgId, data } = props ?? {};
314
-
315
- return patchOrganisation(orgId, data, requestOptions);
316
- };
317
-
318
- return { mutationFn, ...mutationOptions };
319
- };
320
-
321
- export type PatchOrganisationMutationResult = NonNullable<
322
- Awaited<ReturnType<typeof patchOrganisation>>
323
- >;
324
- export type PatchOrganisationMutationBody = OrganisationPatchBodyBody;
325
- export type PatchOrganisationMutationError = ErrorType<AsError>;
326
-
327
- export const usePatchOrganisation = <
328
- TError = ErrorType<AsError>,
329
- TContext = unknown
330
- >(options?: {
331
- mutation?: UseMutationOptions<
332
- Awaited<ReturnType<typeof patchOrganisation>>,
333
- TError,
334
- { orgId: string; data: OrganisationPatchBodyBody },
335
- TContext
336
- >;
337
- request?: SecondParameter<typeof customInstance>;
338
- }) => {
339
- const mutationOptions = getPatchOrganisationMutationOptions(options);
340
-
341
- return useMutation(mutationOptions);
342
- };
343
- /**
326
+ options);
327
+ }
328
+
329
+
330
+
331
+ export const getPatchOrganisationMutationOptions = <TError = ErrorType<AsError>,
332
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
333
+ ): UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext> => {
334
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
335
+
336
+
337
+
338
+
339
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof patchOrganisation>>, {orgId: string;data: OrganisationPatchBodyBody}> = (props) => {
340
+ const {orgId,data} = props ?? {};
341
+
342
+ return patchOrganisation(orgId,data,requestOptions)
343
+ }
344
+
345
+
346
+
347
+
348
+ return { mutationFn, ...mutationOptions }}
349
+
350
+ export type PatchOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof patchOrganisation>>>
351
+ export type PatchOrganisationMutationBody = OrganisationPatchBodyBody
352
+ export type PatchOrganisationMutationError = ErrorType<AsError>
353
+
354
+ /**
355
+ * @summary Adjust an existing Organisation
356
+ */
357
+ export const usePatchOrganisation = <TError = ErrorType<AsError>,
358
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
359
+ ) => {
360
+
361
+ const mutationOptions = getPatchOrganisationMutationOptions(options);
362
+
363
+ return useMutation(mutationOptions);
364
+ }
365
+ /**
344
366
  * Before an Organisation can be deleted all its underlying **Units** must also be deleted, remembering that **Units** that have undeleted **Products** cannot be deleted.
345
367
 
346
368
  You need admin rights to use this method
@@ -348,69 +370,53 @@ You need admin rights to use this method
348
370
  * @summary Deletes an Organisation
349
371
  */
350
372
  export const deleteOrganisation = (
351
- orgId: string,
352
- options?: SecondParameter<typeof customInstance>
373
+ orgId: string,
374
+ options?: SecondParameter<typeof customInstance>,) => {
375
+
376
+
377
+ return customInstance<void>(
378
+ {url: `/organisation/${orgId}`, method: 'DELETE'
379
+ },
380
+ options);
381
+ }
382
+
383
+
384
+
385
+ export const getDeleteOrganisationMutationOptions = <TError = ErrorType<AsError>,
386
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
387
+ ): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext> => {
388
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
389
+
390
+
391
+
392
+
393
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisation>>, {orgId: string}> = (props) => {
394
+ const {orgId} = props ?? {};
395
+
396
+ return deleteOrganisation(orgId,requestOptions)
397
+ }
398
+
399
+
400
+
401
+
402
+ return { mutationFn, ...mutationOptions }}
403
+
404
+ export type DeleteOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisation>>>
405
+
406
+ export type DeleteOrganisationMutationError = ErrorType<AsError>
407
+
408
+ /**
409
+ * @summary Deletes an Organisation
410
+ */
411
+ export const useDeleteOrganisation = <TError = ErrorType<AsError>,
412
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
353
413
  ) => {
354
- return customInstance<void>(
355
- { url: `/organisation/${orgId}`, method: "delete" },
356
- options
357
- );
358
- };
359
-
360
- export const getDeleteOrganisationMutationOptions = <
361
- TError = ErrorType<AsError>,
362
- TContext = unknown
363
- >(options?: {
364
- mutation?: UseMutationOptions<
365
- Awaited<ReturnType<typeof deleteOrganisation>>,
366
- TError,
367
- { orgId: string },
368
- TContext
369
- >;
370
- request?: SecondParameter<typeof customInstance>;
371
- }): UseMutationOptions<
372
- Awaited<ReturnType<typeof deleteOrganisation>>,
373
- TError,
374
- { orgId: string },
375
- TContext
376
- > => {
377
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
378
-
379
- const mutationFn: MutationFunction<
380
- Awaited<ReturnType<typeof deleteOrganisation>>,
381
- { orgId: string }
382
- > = (props) => {
383
- const { orgId } = props ?? {};
384
-
385
- return deleteOrganisation(orgId, requestOptions);
386
- };
387
-
388
- return { mutationFn, ...mutationOptions };
389
- };
390
-
391
- export type DeleteOrganisationMutationResult = NonNullable<
392
- Awaited<ReturnType<typeof deleteOrganisation>>
393
- >;
394
-
395
- export type DeleteOrganisationMutationError = ErrorType<AsError>;
396
-
397
- export const useDeleteOrganisation = <
398
- TError = ErrorType<AsError>,
399
- TContext = unknown
400
- >(options?: {
401
- mutation?: UseMutationOptions<
402
- Awaited<ReturnType<typeof deleteOrganisation>>,
403
- TError,
404
- { orgId: string },
405
- TContext
406
- >;
407
- request?: SecondParameter<typeof customInstance>;
408
- }) => {
409
- const mutationOptions = getDeleteOrganisationMutationOptions(options);
410
-
411
- return useMutation(mutationOptions);
412
- };
413
- /**
414
+
415
+ const mutationOptions = getDeleteOrganisationMutationOptions(options);
416
+
417
+ return useMutation(mutationOptions);
418
+ }
419
+ /**
414
420
  * Gets a Organisation charges.
415
421
 
416
422
  The Organisation cannot be the **Default Organisation** and you need to be a member of the Organisation to use this endpoint
@@ -418,88 +424,109 @@ The Organisation cannot be the **Default Organisation** and you need to be a mem
418
424
  * @summary Gets charges for all Units in an Organisation
419
425
  */
420
426
  export const getOrganisationCharges = (
421
- orgId: string,
422
- params?: GetOrganisationChargesParams,
423
- options?: SecondParameter<typeof customInstance>,
424
- signal?: AbortSignal
427
+ orgId: string,
428
+ params?: GetOrganisationChargesParams,
429
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
430
+ ) => {
431
+
432
+
433
+ return customInstance<OrganisationChargesGetResponse>(
434
+ {url: `/organisation/${orgId}/charges`, method: 'GET',
435
+ params, signal
436
+ },
437
+ options);
438
+ }
439
+
440
+
441
+ export const getGetOrganisationChargesQueryKey = (orgId: string,
442
+ params?: GetOrganisationChargesParams,) => {
443
+ return ["account-server-api", `/organisation/${orgId}/charges`, ...(params ? [params]: [])] as const;
444
+ }
445
+
446
+
447
+ export const getGetOrganisationChargesQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,
448
+ params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
425
449
  ) => {
426
- return customInstance<OrganisationChargesGetResponse>(
427
- { url: `/organisation/${orgId}/charges`, method: "get", params, signal },
428
- options
429
- );
430
- };
431
-
432
- export const getGetOrganisationChargesQueryKey = (
433
- orgId: string,
434
- params?: GetOrganisationChargesParams
435
- ) => ["account-server-api", `/organisation/${orgId}/charges`, ...(params ? [params] : [])] as const;
436
-
437
- export const getGetOrganisationChargesQueryOptions = <
438
- TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
439
- TError = ErrorType<void | AsError>
440
- >(
441
- orgId: string,
442
- params?: GetOrganisationChargesParams,
443
- options?: {
444
- query?: UseQueryOptions<
445
- Awaited<ReturnType<typeof getOrganisationCharges>>,
446
- TError,
447
- TData
448
- >;
449
- request?: SecondParameter<typeof customInstance>;
450
- }
451
- ): UseQueryOptions<
452
- Awaited<ReturnType<typeof getOrganisationCharges>>,
453
- TError,
454
- TData
455
- > & { queryKey: QueryKey } => {
456
- const { query: queryOptions, request: requestOptions } = options ?? {};
457
-
458
- const queryKey =
459
- queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
460
-
461
- const queryFn: QueryFunction<
462
- Awaited<ReturnType<typeof getOrganisationCharges>>
463
- > = ({ signal }) =>
464
- getOrganisationCharges(orgId, params, requestOptions, signal);
465
-
466
- return { queryKey, queryFn, enabled: !!orgId, ...queryOptions };
467
- };
468
-
469
- export type GetOrganisationChargesQueryResult = NonNullable<
470
- Awaited<ReturnType<typeof getOrganisationCharges>>
471
- >;
472
- export type GetOrganisationChargesQueryError = ErrorType<void | AsError>;
473
-
474
- export const useGetOrganisationCharges = <
475
- TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
476
- TError = ErrorType<void | AsError>
477
- >(
478
- orgId: string,
479
- params?: GetOrganisationChargesParams,
480
- options?: {
481
- query?: UseQueryOptions<
482
- Awaited<ReturnType<typeof getOrganisationCharges>>,
483
- TError,
484
- TData
485
- >;
486
- request?: SecondParameter<typeof customInstance>;
487
- }
488
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
489
- const queryOptions = getGetOrganisationChargesQueryOptions(
490
- orgId,
491
- params,
492
- options
493
- );
494
-
495
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
496
- queryKey: QueryKey;
497
- };
498
-
499
- query.queryKey = queryOptions.queryKey;
450
+
451
+ const {query: queryOptions, request: requestOptions} = options ?? {};
452
+
453
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId,params);
454
+
455
+
456
+
457
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) => getOrganisationCharges(orgId,params, requestOptions, signal);
458
+
459
+
460
+
461
+
462
+
463
+ return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData> & { queryKey: QueryKey }
464
+ }
465
+
466
+ export type GetOrganisationChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationCharges>>>
467
+ export type GetOrganisationChargesQueryError = ErrorType<void | AsError>
468
+
469
+ /**
470
+ * @summary Gets charges for all Units in an Organisation
471
+ */
472
+ export const useGetOrganisationCharges = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(
473
+ orgId: string,
474
+ params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
475
+
476
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
477
+
478
+ const queryOptions = getGetOrganisationChargesQueryOptions(orgId,params,options)
479
+
480
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
481
+
482
+ query.queryKey = queryOptions.queryKey ;
500
483
 
501
484
  return query;
502
- };
485
+ }
486
+
487
+
488
+
489
+ export const getGetOrganisationChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,
490
+ params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
491
+ ) => {
492
+
493
+ const {query: queryOptions, request: requestOptions} = options ?? {};
494
+
495
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId,params);
496
+
497
+
498
+
499
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) => getOrganisationCharges(orgId,params, requestOptions, signal);
500
+
501
+
502
+
503
+
504
+
505
+ return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData> & { queryKey: QueryKey }
506
+ }
507
+
508
+ export type GetOrganisationChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationCharges>>>
509
+ export type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>
510
+
511
+ /**
512
+ * @summary Gets charges for all Units in an Organisation
513
+ */
514
+ export const useGetOrganisationChargesSuspense = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(
515
+ orgId: string,
516
+ params?: GetOrganisationChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
517
+
518
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
519
+
520
+ const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId,params,options)
521
+
522
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
523
+
524
+ query.queryKey = queryOptions.queryKey ;
525
+
526
+ return query;
527
+ }
528
+
529
+
503
530
 
504
531
  /**
505
532
  * Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.
@@ -509,68 +536,100 @@ Any authorised user can see the Default Organisation.
509
536
  * @summary Gets the Default Organisation
510
537
  */
511
538
  export const getDefaultOrganisation = (
512
- options?: SecondParameter<typeof customInstance>,
513
- signal?: AbortSignal
539
+
540
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
514
541
  ) => {
515
- return customInstance<OrganisationGetDefaultResponse>(
516
- { url: `/organisation/default`, method: "get", signal },
517
- options
518
- );
519
- };
520
-
521
- export const getGetDefaultOrganisationQueryKey = () =>
522
- ["account-server-api", `/organisation/default`] as const;
523
-
524
- export const getGetDefaultOrganisationQueryOptions = <
525
- TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
526
- TError = ErrorType<void | AsError>
527
- >(options?: {
528
- query?: UseQueryOptions<
529
- Awaited<ReturnType<typeof getDefaultOrganisation>>,
530
- TError,
531
- TData
532
- >;
533
- request?: SecondParameter<typeof customInstance>;
534
- }): UseQueryOptions<
535
- Awaited<ReturnType<typeof getDefaultOrganisation>>,
536
- TError,
537
- TData
538
- > & { queryKey: QueryKey } => {
539
- const { query: queryOptions, request: requestOptions } = options ?? {};
540
-
541
- const queryKey =
542
- queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
543
-
544
- const queryFn: QueryFunction<
545
- Awaited<ReturnType<typeof getDefaultOrganisation>>
546
- > = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
547
-
548
- return { queryKey, queryFn, ...queryOptions };
549
- };
550
-
551
- export type GetDefaultOrganisationQueryResult = NonNullable<
552
- Awaited<ReturnType<typeof getDefaultOrganisation>>
553
- >;
554
- export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;
555
-
556
- export const useGetDefaultOrganisation = <
557
- TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
558
- TError = ErrorType<void | AsError>
559
- >(options?: {
560
- query?: UseQueryOptions<
561
- Awaited<ReturnType<typeof getDefaultOrganisation>>,
562
- TError,
563
- TData
564
- >;
565
- request?: SecondParameter<typeof customInstance>;
566
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
567
- const queryOptions = getGetDefaultOrganisationQueryOptions(options);
568
-
569
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
570
- queryKey: QueryKey;
571
- };
572
-
573
- query.queryKey = queryOptions.queryKey;
542
+
543
+
544
+ return customInstance<OrganisationGetDefaultResponse>(
545
+ {url: `/organisation/default`, method: 'GET', signal
546
+ },
547
+ options);
548
+ }
549
+
550
+
551
+ export const getGetDefaultOrganisationQueryKey = () => {
552
+ return ["account-server-api", `/organisation/default`] as const;
553
+ }
554
+
555
+
556
+ 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>}
557
+ ) => {
558
+
559
+ const {query: queryOptions, request: requestOptions} = options ?? {};
560
+
561
+ const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
562
+
563
+
564
+
565
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
566
+
567
+
568
+
569
+
570
+
571
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: QueryKey }
572
+ }
573
+
574
+ export type GetDefaultOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
575
+ export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>
576
+
577
+ /**
578
+ * @summary Gets the Default Organisation
579
+ */
580
+ export const useGetDefaultOrganisation = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
581
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
582
+
583
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
584
+
585
+ const queryOptions = getGetDefaultOrganisationQueryOptions(options)
586
+
587
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
588
+
589
+ query.queryKey = queryOptions.queryKey ;
590
+
591
+ return query;
592
+ }
593
+
594
+
595
+
596
+ 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>}
597
+ ) => {
598
+
599
+ const {query: queryOptions, request: requestOptions} = options ?? {};
600
+
601
+ const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
602
+
603
+
604
+
605
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
606
+
607
+
608
+
609
+
610
+
611
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: QueryKey }
612
+ }
613
+
614
+ export type GetDefaultOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
615
+ export type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>
616
+
617
+ /**
618
+ * @summary Gets the Default Organisation
619
+ */
620
+ export const useGetDefaultOrganisationSuspense = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
621
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
622
+
623
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
624
+
625
+ const queryOptions = getGetDefaultOrganisationSuspenseQueryOptions(options)
626
+
627
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
628
+
629
+ query.queryKey = queryOptions.queryKey ;
574
630
 
575
631
  return query;
576
- };
632
+ }
633
+
634
+
635
+