@squonk/account-server-client 4.2.1 → 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.
- package/asset/asset.cjs +99 -126
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +99 -99
- package/asset/asset.d.ts +99 -99
- package/asset/asset.js +107 -134
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +73 -85
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +47 -47
- package/charges/charges.d.ts +47 -47
- package/charges/charges.js +78 -90
- package/charges/charges.js.map +1 -1
- package/chunk-3WKSNKHE.js +25 -0
- package/chunk-3WKSNKHE.js.map +1 -0
- package/chunk-NY2VJJG7.cjs +25 -0
- package/chunk-NY2VJJG7.cjs.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/event-stream/event-stream.cjs +53 -61
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +45 -45
- package/event-stream/event-stream.d.ts +45 -45
- package/event-stream/event-stream.js +58 -66
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +49 -57
- package/index.cjs.map +1 -1
- package/index.d.cts +796 -773
- package/index.d.ts +796 -773
- package/index.js +48 -56
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +38 -45
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +25 -25
- package/merchant/merchant.d.ts +25 -25
- package/merchant/merchant.js +42 -49
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +77 -87
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +72 -70
- package/organisation/organisation.d.ts +72 -70
- package/organisation/organisation.js +83 -93
- package/organisation/organisation.js.map +1 -1
- package/package.json +13 -16
- package/product/product.cjs +143 -153
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +100 -100
- package/product/product.d.ts +100 -100
- package/product/product.js +153 -163
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +863 -856
- package/src/asset/asset.ts +899 -634
- package/src/charges/charges.ts +822 -498
- package/src/custom-instance.ts +3 -3
- package/src/event-stream/event-stream.ts +531 -345
- package/src/index.ts +2 -2
- package/src/merchant/merchant.ts +355 -234
- package/src/options-mutator.ts +27 -0
- package/src/organisation/organisation.ts +812 -504
- package/src/product/product.ts +1373 -841
- package/src/state/state.ts +174 -127
- package/src/unit/unit.ts +1273 -603
- package/src/user/user.ts +895 -564
- package/state/state.cjs +22 -24
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +14 -14
- package/state/state.d.ts +14 -14
- package/state/state.js +24 -26
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +171 -106
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +200 -90
- package/unit/unit.d.ts +200 -90
- package/unit/unit.js +179 -114
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +94 -110
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +77 -77
- package/user/user.d.ts +77 -77
- package/user/user.js +101 -117
- package/user/user.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
|
-
* Generated by orval v7.
|
|
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.
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
58
|
-
|
|
55
|
+
params?: GetOrganisationsParams,
|
|
56
|
+
options?: SecondParameter<typeof customInstance>,
|
|
57
|
+
signal?: AbortSignal,
|
|
59
58
|
) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
export const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export type GetOrganisationsSuspenseQueryResult = NonNullable<
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
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
|
-
|
|
206
|
-
|
|
284
|
+
organisationPostBodyBody: OrganisationPostBodyBody,
|
|
285
|
+
options?: SecondParameter<typeof customInstance>,
|
|
286
|
+
signal?: AbortSignal,
|
|
207
287
|
) => {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
headers: {
|
|
213
|
-
data: organisationPostBodyBody,
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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 = <
|
|
252
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
273
|
-
|
|
376
|
+
orgId: string,
|
|
377
|
+
options?: SecondParameter<typeof customInstance>,
|
|
378
|
+
signal?: AbortSignal,
|
|
274
379
|
) => {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
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
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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<
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
-
|
|
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
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export type GetOrganisationSuspenseQueryResult = NonNullable<
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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<
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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
|
-
|
|
418
|
-
|
|
419
|
-
|
|
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
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
: {
|
|
440
|
-
:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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 = <
|
|
464
|
-
|
|
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
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
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
|
-
|
|
485
|
-
|
|
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
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
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 = <
|
|
528
|
-
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
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
|
-
|
|
778
|
+
options?: SecondParameter<typeof customInstance>,
|
|
779
|
+
signal?: AbortSignal,
|
|
550
780
|
) => {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
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
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
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
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
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
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
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<
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
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
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
export
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
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<
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
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
|
-
|