@squonk/account-server-client 2.1.0-rc.8 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/admin/admin.cjs +19 -4
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +23 -6
- package/admin/admin.d.ts +23 -6
- package/admin/admin.js +19 -4
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +33 -18
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +31 -14
- package/asset/asset.d.ts +31 -14
- package/asset/asset.js +25 -10
- package/asset/asset.js.map +1 -1
- package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
- package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
- package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
- package/chunk-TKLTUR4R.cjs.map +1 -0
- package/event-stream/event-stream.cjs +39 -10
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +51 -17
- package/event-stream/event-stream.d.ts +51 -17
- package/event-stream/event-stream.js +36 -7
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.d.cts +702 -2
- package/index.d.ts +702 -2
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +35 -6
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +42 -8
- package/merchant/merchant.d.ts +42 -8
- package/merchant/merchant.js +34 -5
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +73 -16
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +84 -16
- package/organisation/organisation.d.ts +84 -16
- package/organisation/organisation.js +66 -9
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +121 -22
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +141 -22
- package/product/product.d.ts +141 -22
- package/product/product.js +111 -12
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +4 -2
- package/src/admin/admin.ts +50 -14
- package/src/asset/asset.ts +57 -35
- package/src/custom-instance.ts +3 -4
- package/src/event-stream/event-stream.ts +100 -29
- package/src/merchant/merchant.ts +93 -18
- package/src/organisation/organisation.ts +184 -35
- package/src/product/product.ts +313 -47
- package/src/state/state.ts +50 -14
- package/src/unit/unit.ts +190 -45
- package/src/user/user.ts +140 -34
- package/state/state.cjs +19 -4
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +23 -6
- package/state/state.d.ts +23 -6
- package/state/state.js +19 -4
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +77 -20
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +91 -23
- package/unit/unit.d.ts +91 -23
- package/unit/unit.js +68 -11
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +59 -16
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +66 -15
- package/user/user.d.ts +66 -15
- package/user/user.js +53 -10
- package/user/user.js.map +1 -1
- package/chunk-J22A7LHX.cjs.map +0 -1
- package/custom-instance-6780910b.d.ts +0 -700
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
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.
|
|
@@ -10,7 +10,8 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
10
10
|
*/
|
|
11
11
|
import {
|
|
12
12
|
useMutation,
|
|
13
|
-
useQuery
|
|
13
|
+
useQuery,
|
|
14
|
+
useSuspenseQuery
|
|
14
15
|
} from '@tanstack/react-query'
|
|
15
16
|
import type {
|
|
16
17
|
MutationFunction,
|
|
@@ -18,7 +19,9 @@ import type {
|
|
|
18
19
|
QueryKey,
|
|
19
20
|
UseMutationOptions,
|
|
20
21
|
UseQueryOptions,
|
|
21
|
-
UseQueryResult
|
|
22
|
+
UseQueryResult,
|
|
23
|
+
UseSuspenseQueryOptions,
|
|
24
|
+
UseSuspenseQueryResult
|
|
22
25
|
} from '@tanstack/react-query'
|
|
23
26
|
import type {
|
|
24
27
|
AsError,
|
|
@@ -35,13 +38,7 @@ import { customInstance } from '.././custom-instance';
|
|
|
35
38
|
import type { ErrorType } from '.././custom-instance';
|
|
36
39
|
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
40
|
-
config: any,
|
|
41
|
-
args: infer P,
|
|
42
|
-
) => any
|
|
43
|
-
? P
|
|
44
|
-
: never;
|
|
41
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
45
42
|
|
|
46
43
|
|
|
47
44
|
/**
|
|
@@ -56,19 +53,18 @@ export const getOrganisations = (
|
|
|
56
53
|
|
|
57
54
|
|
|
58
55
|
return customInstance<OrganisationsGetResponse>(
|
|
59
|
-
{url: `/organisation`, method: '
|
|
56
|
+
{url: `/organisation`, method: 'GET', signal
|
|
60
57
|
},
|
|
61
58
|
options);
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
|
|
65
62
|
export const getGetOrganisationsQueryKey = () => {
|
|
66
|
-
|
|
67
63
|
return ["account-server-api", `/organisation`] as const;
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
|
|
71
|
-
export const getGetOrganisationsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData
|
|
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>}
|
|
72
68
|
) => {
|
|
73
69
|
|
|
74
70
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -93,7 +89,7 @@ export type GetOrganisationsQueryError = ErrorType<void | AsError>
|
|
|
93
89
|
* @summary Gets Organisations
|
|
94
90
|
*/
|
|
95
91
|
export const useGetOrganisations = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
96
|
-
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData
|
|
92
|
+
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
97
93
|
|
|
98
94
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
99
95
|
|
|
@@ -108,6 +104,46 @@ export const useGetOrganisations = <TData = Awaited<ReturnType<typeof getOrganis
|
|
|
108
104
|
|
|
109
105
|
|
|
110
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>}
|
|
108
|
+
) => {
|
|
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 ;
|
|
141
|
+
|
|
142
|
+
return query;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
111
147
|
/**
|
|
112
148
|
* Creates a new Organisation
|
|
113
149
|
|
|
@@ -121,7 +157,7 @@ export const createOrganisation = (
|
|
|
121
157
|
|
|
122
158
|
|
|
123
159
|
return customInstance<OrganisationPostResponse>(
|
|
124
|
-
{url: `/organisation`, method: '
|
|
160
|
+
{url: `/organisation`, method: 'POST',
|
|
125
161
|
headers: {'Content-Type': 'application/json', },
|
|
126
162
|
data: organisationPostBodyBody
|
|
127
163
|
},
|
|
@@ -131,7 +167,6 @@ export const createOrganisation = (
|
|
|
131
167
|
|
|
132
168
|
|
|
133
169
|
export const getCreateOrganisationMutationOptions = <TError = ErrorType<AsError | void>,
|
|
134
|
-
|
|
135
170
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
136
171
|
): UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext> => {
|
|
137
172
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -158,7 +193,6 @@ export const getCreateOrganisationMutationOptions = <TError = ErrorType<AsError
|
|
|
158
193
|
* @summary Create a new organisation
|
|
159
194
|
*/
|
|
160
195
|
export const useCreateOrganisation = <TError = ErrorType<AsError | void>,
|
|
161
|
-
|
|
162
196
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
163
197
|
) => {
|
|
164
198
|
|
|
@@ -180,19 +214,18 @@ export const getOrganisation = (
|
|
|
180
214
|
|
|
181
215
|
|
|
182
216
|
return customInstance<OrganisationDetail>(
|
|
183
|
-
{url: `/organisation/${orgId}`, method: '
|
|
217
|
+
{url: `/organisation/${orgId}`, method: 'GET', signal
|
|
184
218
|
},
|
|
185
219
|
options);
|
|
186
220
|
}
|
|
187
221
|
|
|
188
222
|
|
|
189
223
|
export const getGetOrganisationQueryKey = (orgId: string,) => {
|
|
190
|
-
|
|
191
224
|
return ["account-server-api", `/organisation/${orgId}`] as const;
|
|
192
225
|
}
|
|
193
226
|
|
|
194
227
|
|
|
195
|
-
export const getGetOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData
|
|
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>}
|
|
196
229
|
) => {
|
|
197
230
|
|
|
198
231
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -217,7 +250,7 @@ export type GetOrganisationQueryError = ErrorType<void | AsError>
|
|
|
217
250
|
* @summary Gets an Organisation
|
|
218
251
|
*/
|
|
219
252
|
export const useGetOrganisation = <TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
220
|
-
orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData
|
|
253
|
+
orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
221
254
|
|
|
222
255
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
223
256
|
|
|
@@ -232,6 +265,46 @@ export const useGetOrganisation = <TData = Awaited<ReturnType<typeof getOrganisa
|
|
|
232
265
|
|
|
233
266
|
|
|
234
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
|
+
|
|
307
|
+
|
|
235
308
|
/**
|
|
236
309
|
* Used to update existing Organisation.
|
|
237
310
|
|
|
@@ -246,7 +319,7 @@ export const patchOrganisation = (
|
|
|
246
319
|
|
|
247
320
|
|
|
248
321
|
return customInstance<void>(
|
|
249
|
-
{url: `/organisation/${orgId}`, method: '
|
|
322
|
+
{url: `/organisation/${orgId}`, method: 'PATCH',
|
|
250
323
|
headers: {'Content-Type': 'application/json', },
|
|
251
324
|
data: organisationPatchBodyBody
|
|
252
325
|
},
|
|
@@ -256,7 +329,6 @@ export const patchOrganisation = (
|
|
|
256
329
|
|
|
257
330
|
|
|
258
331
|
export const getPatchOrganisationMutationOptions = <TError = ErrorType<AsError>,
|
|
259
|
-
|
|
260
332
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
261
333
|
): UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext> => {
|
|
262
334
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -283,7 +355,6 @@ export const getPatchOrganisationMutationOptions = <TError = ErrorType<AsError>,
|
|
|
283
355
|
* @summary Adjust an existing Organisation
|
|
284
356
|
*/
|
|
285
357
|
export const usePatchOrganisation = <TError = ErrorType<AsError>,
|
|
286
|
-
|
|
287
358
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof patchOrganisation>>, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
288
359
|
) => {
|
|
289
360
|
|
|
@@ -304,7 +375,7 @@ export const deleteOrganisation = (
|
|
|
304
375
|
|
|
305
376
|
|
|
306
377
|
return customInstance<void>(
|
|
307
|
-
{url: `/organisation/${orgId}`, method: '
|
|
378
|
+
{url: `/organisation/${orgId}`, method: 'DELETE'
|
|
308
379
|
},
|
|
309
380
|
options);
|
|
310
381
|
}
|
|
@@ -312,7 +383,6 @@ export const deleteOrganisation = (
|
|
|
312
383
|
|
|
313
384
|
|
|
314
385
|
export const getDeleteOrganisationMutationOptions = <TError = ErrorType<AsError>,
|
|
315
|
-
|
|
316
386
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
317
387
|
): UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext> => {
|
|
318
388
|
const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
@@ -339,7 +409,6 @@ export const getDeleteOrganisationMutationOptions = <TError = ErrorType<AsError>
|
|
|
339
409
|
* @summary Deletes an Organisation
|
|
340
410
|
*/
|
|
341
411
|
export const useDeleteOrganisation = <TError = ErrorType<AsError>,
|
|
342
|
-
|
|
343
412
|
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
344
413
|
) => {
|
|
345
414
|
|
|
@@ -362,7 +431,7 @@ export const getOrganisationCharges = (
|
|
|
362
431
|
|
|
363
432
|
|
|
364
433
|
return customInstance<OrganisationChargesGetResponse>(
|
|
365
|
-
{url: `/organisation/${orgId}/charges`, method: '
|
|
434
|
+
{url: `/organisation/${orgId}/charges`, method: 'GET',
|
|
366
435
|
params, signal
|
|
367
436
|
},
|
|
368
437
|
options);
|
|
@@ -371,13 +440,12 @@ export const getOrganisationCharges = (
|
|
|
371
440
|
|
|
372
441
|
export const getGetOrganisationChargesQueryKey = (orgId: string,
|
|
373
442
|
params?: GetOrganisationChargesParams,) => {
|
|
374
|
-
|
|
375
443
|
return ["account-server-api", `/organisation/${orgId}/charges`, ...(params ? [params]: [])] as const;
|
|
376
444
|
}
|
|
377
445
|
|
|
378
446
|
|
|
379
447
|
export const getGetOrganisationChargesQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,
|
|
380
|
-
params?: GetOrganisationChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData
|
|
448
|
+
params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
381
449
|
) => {
|
|
382
450
|
|
|
383
451
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -403,7 +471,7 @@ export type GetOrganisationChargesQueryError = ErrorType<void | AsError>
|
|
|
403
471
|
*/
|
|
404
472
|
export const useGetOrganisationCharges = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(
|
|
405
473
|
orgId: string,
|
|
406
|
-
params?: GetOrganisationChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData
|
|
474
|
+
params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
407
475
|
|
|
408
476
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
409
477
|
|
|
@@ -418,6 +486,48 @@ export const useGetOrganisationCharges = <TData = Awaited<ReturnType<typeof getO
|
|
|
418
486
|
|
|
419
487
|
|
|
420
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
|
+
|
|
530
|
+
|
|
421
531
|
/**
|
|
422
532
|
* Gets the Default Organisation, a built-in Organisation used exclusively for **Personal Units**.
|
|
423
533
|
|
|
@@ -432,19 +542,18 @@ export const getDefaultOrganisation = (
|
|
|
432
542
|
|
|
433
543
|
|
|
434
544
|
return customInstance<OrganisationGetDefaultResponse>(
|
|
435
|
-
{url: `/organisation/default`, method: '
|
|
545
|
+
{url: `/organisation/default`, method: 'GET', signal
|
|
436
546
|
},
|
|
437
547
|
options);
|
|
438
548
|
}
|
|
439
549
|
|
|
440
550
|
|
|
441
551
|
export const getGetDefaultOrganisationQueryKey = () => {
|
|
442
|
-
|
|
443
552
|
return ["account-server-api", `/organisation/default`] as const;
|
|
444
553
|
}
|
|
445
554
|
|
|
446
555
|
|
|
447
|
-
export const getGetDefaultOrganisationQueryOptions = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData
|
|
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>}
|
|
448
557
|
) => {
|
|
449
558
|
|
|
450
559
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
@@ -469,7 +578,7 @@ export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>
|
|
|
469
578
|
* @summary Gets the Default Organisation
|
|
470
579
|
*/
|
|
471
580
|
export const useGetDefaultOrganisation = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
472
|
-
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData
|
|
581
|
+
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
473
582
|
|
|
474
583
|
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
475
584
|
|
|
@@ -484,3 +593,43 @@ export const useGetDefaultOrganisation = <TData = Awaited<ReturnType<typeof getD
|
|
|
484
593
|
|
|
485
594
|
|
|
486
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 ;
|
|
630
|
+
|
|
631
|
+
return query;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
|
|
635
|
+
|