@squonk/account-server-client 4.4.0-4-4.2197467763 → 4.4.0-4-4.2200269934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/actions/actions.cjs +4 -4
- package/dist/api/actions/actions.cjs.map +1 -1
- package/dist/api/actions/actions.d.cts +35 -17
- package/dist/api/actions/actions.d.cts.map +1 -1
- package/dist/api/actions/actions.d.ts +35 -17
- package/dist/api/actions/actions.d.ts.map +1 -1
- package/dist/api/actions/actions.fetch.cjs +4 -4
- package/dist/api/actions/actions.fetch.cjs.map +1 -1
- package/dist/api/actions/actions.fetch.d.cts +35 -17
- package/dist/api/actions/actions.fetch.d.cts.map +1 -1
- package/dist/api/actions/actions.fetch.d.ts +35 -17
- package/dist/api/actions/actions.fetch.d.ts.map +1 -1
- package/dist/api/actions/actions.fetch.js +4 -4
- package/dist/api/actions/actions.fetch.js.map +1 -1
- package/dist/api/actions/actions.js +4 -4
- package/dist/api/actions/actions.js.map +1 -1
- package/dist/api/asset/asset.cjs +22 -22
- package/dist/api/asset/asset.cjs.map +1 -1
- package/dist/api/asset/asset.d.cts +76 -40
- package/dist/api/asset/asset.d.cts.map +1 -1
- package/dist/api/asset/asset.d.ts +76 -40
- package/dist/api/asset/asset.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.cjs +22 -22
- package/dist/api/asset/asset.fetch.cjs.map +1 -1
- package/dist/api/asset/asset.fetch.d.cts +76 -40
- package/dist/api/asset/asset.fetch.d.cts.map +1 -1
- package/dist/api/asset/asset.fetch.d.ts +76 -40
- package/dist/api/asset/asset.fetch.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.js +22 -22
- package/dist/api/asset/asset.fetch.js.map +1 -1
- package/dist/api/asset/asset.js +22 -22
- package/dist/api/asset/asset.js.map +1 -1
- package/dist/api/charges/charges.cjs +16 -16
- package/dist/api/charges/charges.cjs.map +1 -1
- package/dist/api/charges/charges.d.cts +137 -65
- package/dist/api/charges/charges.d.cts.map +1 -1
- package/dist/api/charges/charges.d.ts +137 -65
- package/dist/api/charges/charges.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.cjs +16 -16
- package/dist/api/charges/charges.fetch.cjs.map +1 -1
- package/dist/api/charges/charges.fetch.d.cts +137 -65
- package/dist/api/charges/charges.fetch.d.cts.map +1 -1
- package/dist/api/charges/charges.fetch.d.ts +137 -65
- package/dist/api/charges/charges.fetch.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.js +16 -16
- package/dist/api/charges/charges.fetch.js.map +1 -1
- package/dist/api/charges/charges.js +16 -16
- package/dist/api/charges/charges.js.map +1 -1
- package/dist/api/event-stream/event-stream.cjs +12 -12
- package/dist/api/event-stream/event-stream.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.d.cts +71 -35
- package/dist/api/event-stream/event-stream.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.d.ts +71 -35
- package/dist/api/event-stream/event-stream.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.cjs +12 -12
- package/dist/api/event-stream/event-stream.fetch.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.d.cts +71 -35
- package/dist/api/event-stream/event-stream.fetch.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.d.ts +71 -35
- package/dist/api/event-stream/event-stream.fetch.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.js +12 -12
- package/dist/api/event-stream/event-stream.fetch.js.map +1 -1
- package/dist/api/event-stream/event-stream.js +12 -12
- package/dist/api/event-stream/event-stream.js.map +1 -1
- package/dist/api/merchant/merchant.cjs +8 -8
- package/dist/api/merchant/merchant.cjs.map +1 -1
- package/dist/api/merchant/merchant.d.cts +69 -33
- package/dist/api/merchant/merchant.d.cts.map +1 -1
- package/dist/api/merchant/merchant.d.ts +69 -33
- package/dist/api/merchant/merchant.d.ts.map +1 -1
- package/dist/api/merchant/merchant.fetch.cjs +8 -8
- package/dist/api/merchant/merchant.fetch.cjs.map +1 -1
- package/dist/api/merchant/merchant.fetch.d.cts +69 -33
- package/dist/api/merchant/merchant.fetch.d.cts.map +1 -1
- package/dist/api/merchant/merchant.fetch.d.ts +69 -33
- package/dist/api/merchant/merchant.fetch.d.ts.map +1 -1
- package/dist/api/merchant/merchant.fetch.js +8 -8
- package/dist/api/merchant/merchant.fetch.js.map +1 -1
- package/dist/api/merchant/merchant.js +8 -8
- package/dist/api/merchant/merchant.js.map +1 -1
- package/dist/api/organisation/organisation.cjs +18 -18
- package/dist/api/organisation/organisation.cjs.map +1 -1
- package/dist/api/organisation/organisation.d.cts +106 -52
- package/dist/api/organisation/organisation.d.cts.map +1 -1
- package/dist/api/organisation/organisation.d.ts +106 -52
- package/dist/api/organisation/organisation.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.cjs +18 -18
- package/dist/api/organisation/organisation.fetch.cjs.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.cts +106 -52
- package/dist/api/organisation/organisation.fetch.d.cts.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.ts +106 -52
- package/dist/api/organisation/organisation.fetch.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.js +18 -18
- package/dist/api/organisation/organisation.fetch.js.map +1 -1
- package/dist/api/organisation/organisation.js +18 -18
- package/dist/api/organisation/organisation.js.map +1 -1
- package/dist/api/product/product.cjs +30 -30
- package/dist/api/product/product.cjs.map +1 -1
- package/dist/api/product/product.d.cts +208 -100
- package/dist/api/product/product.d.cts.map +1 -1
- package/dist/api/product/product.d.ts +208 -100
- package/dist/api/product/product.d.ts.map +1 -1
- package/dist/api/product/product.fetch.cjs +30 -30
- package/dist/api/product/product.fetch.cjs.map +1 -1
- package/dist/api/product/product.fetch.d.cts +208 -100
- package/dist/api/product/product.fetch.d.cts.map +1 -1
- package/dist/api/product/product.fetch.d.ts +208 -100
- package/dist/api/product/product.fetch.d.ts.map +1 -1
- package/dist/api/product/product.fetch.js +30 -30
- package/dist/api/product/product.fetch.js.map +1 -1
- package/dist/api/product/product.js +30 -30
- package/dist/api/product/product.js.map +1 -1
- package/dist/api/state/state.cjs +4 -4
- package/dist/api/state/state.cjs.map +1 -1
- package/dist/api/state/state.d.cts +35 -17
- package/dist/api/state/state.d.cts.map +1 -1
- package/dist/api/state/state.d.ts +35 -17
- package/dist/api/state/state.d.ts.map +1 -1
- package/dist/api/state/state.fetch.cjs +4 -4
- package/dist/api/state/state.fetch.cjs.map +1 -1
- package/dist/api/state/state.fetch.d.cts +35 -17
- package/dist/api/state/state.fetch.d.cts.map +1 -1
- package/dist/api/state/state.fetch.d.ts +35 -17
- package/dist/api/state/state.fetch.d.ts.map +1 -1
- package/dist/api/state/state.fetch.js +4 -4
- package/dist/api/state/state.fetch.js.map +1 -1
- package/dist/api/state/state.js +4 -4
- package/dist/api/state/state.js.map +1 -1
- package/dist/api/unit/unit.cjs +30 -30
- package/dist/api/unit/unit.cjs.map +1 -1
- package/dist/api/unit/unit.d.cts +144 -72
- package/dist/api/unit/unit.d.cts.map +1 -1
- package/dist/api/unit/unit.d.ts +144 -72
- package/dist/api/unit/unit.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.cjs +30 -30
- package/dist/api/unit/unit.fetch.cjs.map +1 -1
- package/dist/api/unit/unit.fetch.d.cts +144 -72
- package/dist/api/unit/unit.fetch.d.cts.map +1 -1
- package/dist/api/unit/unit.fetch.d.ts +144 -72
- package/dist/api/unit/unit.fetch.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.js +30 -30
- package/dist/api/unit/unit.fetch.js.map +1 -1
- package/dist/api/unit/unit.js +30 -30
- package/dist/api/unit/unit.js.map +1 -1
- package/dist/api/user/user.cjs +20 -20
- package/dist/api/user/user.cjs.map +1 -1
- package/dist/api/user/user.d.cts +107 -53
- package/dist/api/user/user.d.cts.map +1 -1
- package/dist/api/user/user.d.ts +107 -53
- package/dist/api/user/user.d.ts.map +1 -1
- package/dist/api/user/user.fetch.cjs +20 -20
- package/dist/api/user/user.fetch.cjs.map +1 -1
- package/dist/api/user/user.fetch.d.cts +107 -53
- package/dist/api/user/user.fetch.d.cts.map +1 -1
- package/dist/api/user/user.fetch.d.ts +107 -53
- package/dist/api/user/user.fetch.d.ts.map +1 -1
- package/dist/api/user/user.fetch.js +20 -20
- package/dist/api/user/user.fetch.js.map +1 -1
- package/dist/api/user/user.js +20 -20
- package/dist/api/user/user.js.map +1 -1
- package/package.json +7 -5
- package/src/api/actions/actions.fetch.ts +103 -12
- package/src/api/actions/actions.ts +103 -12
- package/src/api/asset/asset.fetch.ts +303 -94
- package/src/api/asset/asset.ts +303 -94
- package/src/api/charges/charges.fetch.ts +456 -54
- package/src/api/charges/charges.ts +456 -54
- package/src/api/event-stream/event-stream.fetch.ts +262 -58
- package/src/api/event-stream/event-stream.ts +262 -58
- package/src/api/merchant/merchant.fetch.ts +212 -28
- package/src/api/merchant/merchant.ts +212 -28
- package/src/api/organisation/organisation.fetch.ts +381 -86
- package/src/api/organisation/organisation.ts +381 -86
- package/src/api/product/product.fetch.ts +724 -130
- package/src/api/product/product.ts +724 -130
- package/src/api/state/state.fetch.ts +105 -16
- package/src/api/state/state.ts +105 -16
- package/src/api/unit/unit.fetch.ts +521 -146
- package/src/api/unit/unit.ts +521 -146
- package/src/api/user/user.fetch.ts +401 -101
- package/src/api/user/user.ts +401 -101
- package/tests/README.md +98 -0
- package/tests/component.test.tsx +191 -0
- package/tests/tsconfig.json +7 -0
- package/tests/type-tests.tsx +196 -0
|
@@ -10,11 +10,15 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
10
10
|
*/
|
|
11
11
|
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
13
|
+
DataTag,
|
|
14
|
+
DefinedInitialDataOptions,
|
|
15
|
+
DefinedUseQueryResult,
|
|
13
16
|
InvalidateOptions,
|
|
14
17
|
MutationFunction,
|
|
15
18
|
QueryClient,
|
|
16
19
|
QueryFunction,
|
|
17
20
|
QueryKey,
|
|
21
|
+
UndefinedInitialDataOptions,
|
|
18
22
|
UseMutationOptions,
|
|
19
23
|
UseMutationResult,
|
|
20
24
|
UseQueryOptions,
|
|
@@ -65,7 +69,7 @@ export const getGetUserAccountQueryOptions = <
|
|
|
65
69
|
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
66
70
|
TError = ErrorType<void | AsError>,
|
|
67
71
|
>(options?: {
|
|
68
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData
|
|
72
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
|
|
69
73
|
request?: SecondParameter<typeof customFetch>;
|
|
70
74
|
}) => {
|
|
71
75
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -79,12 +83,58 @@ export const getGetUserAccountQueryOptions = <
|
|
|
79
83
|
Awaited<ReturnType<typeof getUserAccount>>,
|
|
80
84
|
TError,
|
|
81
85
|
TData
|
|
82
|
-
> & { queryKey: QueryKey };
|
|
86
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
83
87
|
};
|
|
84
88
|
|
|
85
89
|
export type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
|
|
86
90
|
export type GetUserAccountQueryError = ErrorType<void | AsError>;
|
|
87
91
|
|
|
92
|
+
export function useGetUserAccount<
|
|
93
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
94
|
+
TError = ErrorType<void | AsError>,
|
|
95
|
+
>(
|
|
96
|
+
options: {
|
|
97
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
|
|
98
|
+
Pick<
|
|
99
|
+
DefinedInitialDataOptions<
|
|
100
|
+
Awaited<ReturnType<typeof getUserAccount>>,
|
|
101
|
+
TError,
|
|
102
|
+
Awaited<ReturnType<typeof getUserAccount>>
|
|
103
|
+
>,
|
|
104
|
+
"initialData"
|
|
105
|
+
>;
|
|
106
|
+
request?: SecondParameter<typeof customFetch>;
|
|
107
|
+
},
|
|
108
|
+
queryClient?: QueryClient,
|
|
109
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
110
|
+
export function useGetUserAccount<
|
|
111
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
112
|
+
TError = ErrorType<void | AsError>,
|
|
113
|
+
>(
|
|
114
|
+
options?: {
|
|
115
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
|
|
116
|
+
Pick<
|
|
117
|
+
UndefinedInitialDataOptions<
|
|
118
|
+
Awaited<ReturnType<typeof getUserAccount>>,
|
|
119
|
+
TError,
|
|
120
|
+
Awaited<ReturnType<typeof getUserAccount>>
|
|
121
|
+
>,
|
|
122
|
+
"initialData"
|
|
123
|
+
>;
|
|
124
|
+
request?: SecondParameter<typeof customFetch>;
|
|
125
|
+
},
|
|
126
|
+
queryClient?: QueryClient,
|
|
127
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
128
|
+
export function useGetUserAccount<
|
|
129
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
130
|
+
TError = ErrorType<void | AsError>,
|
|
131
|
+
>(
|
|
132
|
+
options?: {
|
|
133
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
|
|
134
|
+
request?: SecondParameter<typeof customFetch>;
|
|
135
|
+
},
|
|
136
|
+
queryClient?: QueryClient,
|
|
137
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
88
138
|
/**
|
|
89
139
|
* @summary Get information about your account
|
|
90
140
|
*/
|
|
@@ -92,13 +142,18 @@ export type GetUserAccountQueryError = ErrorType<void | AsError>;
|
|
|
92
142
|
export function useGetUserAccount<
|
|
93
143
|
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
94
144
|
TError = ErrorType<void | AsError>,
|
|
95
|
-
>(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
145
|
+
>(
|
|
146
|
+
options?: {
|
|
147
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
|
|
148
|
+
request?: SecondParameter<typeof customFetch>;
|
|
149
|
+
},
|
|
150
|
+
queryClient?: QueryClient,
|
|
151
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
99
152
|
const queryOptions = getGetUserAccountQueryOptions(options);
|
|
100
153
|
|
|
101
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
154
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
155
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
156
|
+
};
|
|
102
157
|
|
|
103
158
|
query.queryKey = queryOptions.queryKey;
|
|
104
159
|
|
|
@@ -121,7 +176,9 @@ export const getGetUserAccountSuspenseQueryOptions = <
|
|
|
121
176
|
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
122
177
|
TError = ErrorType<void | AsError>,
|
|
123
178
|
>(options?: {
|
|
124
|
-
query?:
|
|
179
|
+
query?: Partial<
|
|
180
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
181
|
+
>;
|
|
125
182
|
request?: SecondParameter<typeof customFetch>;
|
|
126
183
|
}) => {
|
|
127
184
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -135,7 +192,7 @@ export const getGetUserAccountSuspenseQueryOptions = <
|
|
|
135
192
|
Awaited<ReturnType<typeof getUserAccount>>,
|
|
136
193
|
TError,
|
|
137
194
|
TData
|
|
138
|
-
> & { queryKey: QueryKey };
|
|
195
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
139
196
|
};
|
|
140
197
|
|
|
141
198
|
export type GetUserAccountSuspenseQueryResult = NonNullable<
|
|
@@ -143,6 +200,42 @@ export type GetUserAccountSuspenseQueryResult = NonNullable<
|
|
|
143
200
|
>;
|
|
144
201
|
export type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;
|
|
145
202
|
|
|
203
|
+
export function useGetUserAccountSuspense<
|
|
204
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
205
|
+
TError = ErrorType<void | AsError>,
|
|
206
|
+
>(
|
|
207
|
+
options: {
|
|
208
|
+
query: Partial<
|
|
209
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
210
|
+
>;
|
|
211
|
+
request?: SecondParameter<typeof customFetch>;
|
|
212
|
+
},
|
|
213
|
+
queryClient?: QueryClient,
|
|
214
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
215
|
+
export function useGetUserAccountSuspense<
|
|
216
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
217
|
+
TError = ErrorType<void | AsError>,
|
|
218
|
+
>(
|
|
219
|
+
options?: {
|
|
220
|
+
query?: Partial<
|
|
221
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
222
|
+
>;
|
|
223
|
+
request?: SecondParameter<typeof customFetch>;
|
|
224
|
+
},
|
|
225
|
+
queryClient?: QueryClient,
|
|
226
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
227
|
+
export function useGetUserAccountSuspense<
|
|
228
|
+
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
229
|
+
TError = ErrorType<void | AsError>,
|
|
230
|
+
>(
|
|
231
|
+
options?: {
|
|
232
|
+
query?: Partial<
|
|
233
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
234
|
+
>;
|
|
235
|
+
request?: SecondParameter<typeof customFetch>;
|
|
236
|
+
},
|
|
237
|
+
queryClient?: QueryClient,
|
|
238
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
146
239
|
/**
|
|
147
240
|
* @summary Get information about your account
|
|
148
241
|
*/
|
|
@@ -150,15 +243,21 @@ export type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
150
243
|
export function useGetUserAccountSuspense<
|
|
151
244
|
TData = Awaited<ReturnType<typeof getUserAccount>>,
|
|
152
245
|
TError = ErrorType<void | AsError>,
|
|
153
|
-
>(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
246
|
+
>(
|
|
247
|
+
options?: {
|
|
248
|
+
query?: Partial<
|
|
249
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
|
|
250
|
+
>;
|
|
251
|
+
request?: SecondParameter<typeof customFetch>;
|
|
252
|
+
},
|
|
253
|
+
queryClient?: QueryClient,
|
|
254
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
157
255
|
const queryOptions = getGetUserAccountSuspenseQueryOptions(options);
|
|
158
256
|
|
|
159
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
160
|
-
|
|
161
|
-
|
|
257
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
258
|
+
TData,
|
|
259
|
+
TError
|
|
260
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
162
261
|
|
|
163
262
|
query.queryKey = queryOptions.queryKey;
|
|
164
263
|
|
|
@@ -219,7 +318,9 @@ export const getGetOrganisationUsersQueryOptions = <
|
|
|
219
318
|
>(
|
|
220
319
|
orgId: string,
|
|
221
320
|
options?: {
|
|
222
|
-
query?:
|
|
321
|
+
query?: Partial<
|
|
322
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
323
|
+
>;
|
|
223
324
|
request?: SecondParameter<typeof customFetch>;
|
|
224
325
|
},
|
|
225
326
|
) => {
|
|
@@ -234,7 +335,7 @@ export const getGetOrganisationUsersQueryOptions = <
|
|
|
234
335
|
Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
235
336
|
TError,
|
|
236
337
|
TData
|
|
237
|
-
> & { queryKey: QueryKey };
|
|
338
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
238
339
|
};
|
|
239
340
|
|
|
240
341
|
export type GetOrganisationUsersQueryResult = NonNullable<
|
|
@@ -242,6 +343,61 @@ export type GetOrganisationUsersQueryResult = NonNullable<
|
|
|
242
343
|
>;
|
|
243
344
|
export type GetOrganisationUsersQueryError = ErrorType<AsError | void>;
|
|
244
345
|
|
|
346
|
+
export function useGetOrganisationUsers<
|
|
347
|
+
TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
348
|
+
TError = ErrorType<AsError | void>,
|
|
349
|
+
>(
|
|
350
|
+
orgId: string,
|
|
351
|
+
options: {
|
|
352
|
+
query: Partial<
|
|
353
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
354
|
+
> &
|
|
355
|
+
Pick<
|
|
356
|
+
DefinedInitialDataOptions<
|
|
357
|
+
Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
358
|
+
TError,
|
|
359
|
+
Awaited<ReturnType<typeof getOrganisationUsers>>
|
|
360
|
+
>,
|
|
361
|
+
"initialData"
|
|
362
|
+
>;
|
|
363
|
+
request?: SecondParameter<typeof customFetch>;
|
|
364
|
+
},
|
|
365
|
+
queryClient?: QueryClient,
|
|
366
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
367
|
+
export function useGetOrganisationUsers<
|
|
368
|
+
TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
369
|
+
TError = ErrorType<AsError | void>,
|
|
370
|
+
>(
|
|
371
|
+
orgId: string,
|
|
372
|
+
options?: {
|
|
373
|
+
query?: Partial<
|
|
374
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
375
|
+
> &
|
|
376
|
+
Pick<
|
|
377
|
+
UndefinedInitialDataOptions<
|
|
378
|
+
Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
379
|
+
TError,
|
|
380
|
+
Awaited<ReturnType<typeof getOrganisationUsers>>
|
|
381
|
+
>,
|
|
382
|
+
"initialData"
|
|
383
|
+
>;
|
|
384
|
+
request?: SecondParameter<typeof customFetch>;
|
|
385
|
+
},
|
|
386
|
+
queryClient?: QueryClient,
|
|
387
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
388
|
+
export function useGetOrganisationUsers<
|
|
389
|
+
TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
390
|
+
TError = ErrorType<AsError | void>,
|
|
391
|
+
>(
|
|
392
|
+
orgId: string,
|
|
393
|
+
options?: {
|
|
394
|
+
query?: Partial<
|
|
395
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
396
|
+
>;
|
|
397
|
+
request?: SecondParameter<typeof customFetch>;
|
|
398
|
+
},
|
|
399
|
+
queryClient?: QueryClient,
|
|
400
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
245
401
|
/**
|
|
246
402
|
* @summary Gets users in an Organisation
|
|
247
403
|
*/
|
|
@@ -252,13 +408,18 @@ export function useGetOrganisationUsers<
|
|
|
252
408
|
>(
|
|
253
409
|
orgId: string,
|
|
254
410
|
options?: {
|
|
255
|
-
query?:
|
|
411
|
+
query?: Partial<
|
|
412
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
413
|
+
>;
|
|
256
414
|
request?: SecondParameter<typeof customFetch>;
|
|
257
415
|
},
|
|
258
|
-
|
|
416
|
+
queryClient?: QueryClient,
|
|
417
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
259
418
|
const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);
|
|
260
419
|
|
|
261
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
420
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
421
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
422
|
+
};
|
|
262
423
|
|
|
263
424
|
query.queryKey = queryOptions.queryKey;
|
|
264
425
|
|
|
@@ -287,10 +448,8 @@ export const getGetOrganisationUsersSuspenseQueryOptions = <
|
|
|
287
448
|
>(
|
|
288
449
|
orgId: string,
|
|
289
450
|
options?: {
|
|
290
|
-
query?:
|
|
291
|
-
Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
292
|
-
TError,
|
|
293
|
-
TData
|
|
451
|
+
query?: Partial<
|
|
452
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
294
453
|
>;
|
|
295
454
|
request?: SecondParameter<typeof customFetch>;
|
|
296
455
|
},
|
|
@@ -306,7 +465,7 @@ export const getGetOrganisationUsersSuspenseQueryOptions = <
|
|
|
306
465
|
Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
307
466
|
TError,
|
|
308
467
|
TData
|
|
309
|
-
> & { queryKey: QueryKey };
|
|
468
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
310
469
|
};
|
|
311
470
|
|
|
312
471
|
export type GetOrganisationUsersSuspenseQueryResult = NonNullable<
|
|
@@ -314,6 +473,45 @@ export type GetOrganisationUsersSuspenseQueryResult = NonNullable<
|
|
|
314
473
|
>;
|
|
315
474
|
export type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>;
|
|
316
475
|
|
|
476
|
+
export function useGetOrganisationUsersSuspense<
|
|
477
|
+
TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
478
|
+
TError = ErrorType<AsError | void>,
|
|
479
|
+
>(
|
|
480
|
+
orgId: string,
|
|
481
|
+
options: {
|
|
482
|
+
query: Partial<
|
|
483
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
484
|
+
>;
|
|
485
|
+
request?: SecondParameter<typeof customFetch>;
|
|
486
|
+
},
|
|
487
|
+
queryClient?: QueryClient,
|
|
488
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
489
|
+
export function useGetOrganisationUsersSuspense<
|
|
490
|
+
TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
491
|
+
TError = ErrorType<AsError | void>,
|
|
492
|
+
>(
|
|
493
|
+
orgId: string,
|
|
494
|
+
options?: {
|
|
495
|
+
query?: Partial<
|
|
496
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
497
|
+
>;
|
|
498
|
+
request?: SecondParameter<typeof customFetch>;
|
|
499
|
+
},
|
|
500
|
+
queryClient?: QueryClient,
|
|
501
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
502
|
+
export function useGetOrganisationUsersSuspense<
|
|
503
|
+
TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
504
|
+
TError = ErrorType<AsError | void>,
|
|
505
|
+
>(
|
|
506
|
+
orgId: string,
|
|
507
|
+
options?: {
|
|
508
|
+
query?: Partial<
|
|
509
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
510
|
+
>;
|
|
511
|
+
request?: SecondParameter<typeof customFetch>;
|
|
512
|
+
},
|
|
513
|
+
queryClient?: QueryClient,
|
|
514
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
317
515
|
/**
|
|
318
516
|
* @summary Gets users in an Organisation
|
|
319
517
|
*/
|
|
@@ -324,19 +522,19 @@ export function useGetOrganisationUsersSuspense<
|
|
|
324
522
|
>(
|
|
325
523
|
orgId: string,
|
|
326
524
|
options?: {
|
|
327
|
-
query?:
|
|
328
|
-
Awaited<ReturnType<typeof getOrganisationUsers>>,
|
|
329
|
-
TError,
|
|
330
|
-
TData
|
|
525
|
+
query?: Partial<
|
|
526
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
|
|
331
527
|
>;
|
|
332
528
|
request?: SecondParameter<typeof customFetch>;
|
|
333
529
|
},
|
|
334
|
-
|
|
530
|
+
queryClient?: QueryClient,
|
|
531
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
335
532
|
const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);
|
|
336
533
|
|
|
337
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
338
|
-
|
|
339
|
-
|
|
534
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
535
|
+
TData,
|
|
536
|
+
TError
|
|
537
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
340
538
|
|
|
341
539
|
query.queryKey = queryOptions.queryKey;
|
|
342
540
|
|
|
@@ -431,18 +629,18 @@ export type AddOrganisationUserMutationError = ErrorType<AsError | void>;
|
|
|
431
629
|
/**
|
|
432
630
|
* @summary Adds a User to an Organisation
|
|
433
631
|
*/
|
|
434
|
-
export const useAddOrganisationUser = <
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
632
|
+
export const useAddOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
633
|
+
options?: {
|
|
634
|
+
mutation?: UseMutationOptions<
|
|
635
|
+
Awaited<ReturnType<typeof addOrganisationUser>>,
|
|
636
|
+
TError,
|
|
637
|
+
{ orgId: string; userId: string },
|
|
638
|
+
TContext
|
|
639
|
+
>;
|
|
640
|
+
request?: SecondParameter<typeof customFetch>;
|
|
641
|
+
},
|
|
642
|
+
queryClient?: QueryClient,
|
|
643
|
+
): UseMutationResult<
|
|
446
644
|
Awaited<ReturnType<typeof addOrganisationUser>>,
|
|
447
645
|
TError,
|
|
448
646
|
{ orgId: string; userId: string },
|
|
@@ -450,7 +648,7 @@ export const useAddOrganisationUser = <
|
|
|
450
648
|
> => {
|
|
451
649
|
const mutationOptions = getAddOrganisationUserMutationOptions(options);
|
|
452
650
|
|
|
453
|
-
return useMutation(mutationOptions);
|
|
651
|
+
return useMutation(mutationOptions, queryClient);
|
|
454
652
|
};
|
|
455
653
|
/**
|
|
456
654
|
* Removes a User from an **Organisation**.
|
|
@@ -540,18 +738,18 @@ export type DeleteOrganisationUserMutationError = ErrorType<AsError | void>;
|
|
|
540
738
|
/**
|
|
541
739
|
* @summary Deletes a User from an Organisation
|
|
542
740
|
*/
|
|
543
|
-
export const useDeleteOrganisationUser = <
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
741
|
+
export const useDeleteOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
742
|
+
options?: {
|
|
743
|
+
mutation?: UseMutationOptions<
|
|
744
|
+
Awaited<ReturnType<typeof deleteOrganisationUser>>,
|
|
745
|
+
TError,
|
|
746
|
+
{ orgId: string; userId: string },
|
|
747
|
+
TContext
|
|
748
|
+
>;
|
|
749
|
+
request?: SecondParameter<typeof customFetch>;
|
|
750
|
+
},
|
|
751
|
+
queryClient?: QueryClient,
|
|
752
|
+
): UseMutationResult<
|
|
555
753
|
Awaited<ReturnType<typeof deleteOrganisationUser>>,
|
|
556
754
|
TError,
|
|
557
755
|
{ orgId: string; userId: string },
|
|
@@ -559,7 +757,7 @@ export const useDeleteOrganisationUser = <
|
|
|
559
757
|
> => {
|
|
560
758
|
const mutationOptions = getDeleteOrganisationUserMutationOptions(options);
|
|
561
759
|
|
|
562
|
-
return useMutation(mutationOptions);
|
|
760
|
+
return useMutation(mutationOptions, queryClient);
|
|
563
761
|
};
|
|
564
762
|
/**
|
|
565
763
|
* Gets users in an Organisational Unit.
|
|
@@ -615,7 +813,9 @@ export const getGetOrganisationUnitUsersQueryOptions = <
|
|
|
615
813
|
>(
|
|
616
814
|
unitId: string,
|
|
617
815
|
options?: {
|
|
618
|
-
query?:
|
|
816
|
+
query?: Partial<
|
|
817
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
818
|
+
>;
|
|
619
819
|
request?: SecondParameter<typeof customFetch>;
|
|
620
820
|
},
|
|
621
821
|
) => {
|
|
@@ -631,7 +831,7 @@ export const getGetOrganisationUnitUsersQueryOptions = <
|
|
|
631
831
|
Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
632
832
|
TError,
|
|
633
833
|
TData
|
|
634
|
-
> & { queryKey: QueryKey };
|
|
834
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
635
835
|
};
|
|
636
836
|
|
|
637
837
|
export type GetOrganisationUnitUsersQueryResult = NonNullable<
|
|
@@ -639,6 +839,61 @@ export type GetOrganisationUnitUsersQueryResult = NonNullable<
|
|
|
639
839
|
>;
|
|
640
840
|
export type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;
|
|
641
841
|
|
|
842
|
+
export function useGetOrganisationUnitUsers<
|
|
843
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
844
|
+
TError = ErrorType<AsError | void>,
|
|
845
|
+
>(
|
|
846
|
+
unitId: string,
|
|
847
|
+
options: {
|
|
848
|
+
query: Partial<
|
|
849
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
850
|
+
> &
|
|
851
|
+
Pick<
|
|
852
|
+
DefinedInitialDataOptions<
|
|
853
|
+
Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
854
|
+
TError,
|
|
855
|
+
Awaited<ReturnType<typeof getOrganisationUnitUsers>>
|
|
856
|
+
>,
|
|
857
|
+
"initialData"
|
|
858
|
+
>;
|
|
859
|
+
request?: SecondParameter<typeof customFetch>;
|
|
860
|
+
},
|
|
861
|
+
queryClient?: QueryClient,
|
|
862
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
863
|
+
export function useGetOrganisationUnitUsers<
|
|
864
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
865
|
+
TError = ErrorType<AsError | void>,
|
|
866
|
+
>(
|
|
867
|
+
unitId: string,
|
|
868
|
+
options?: {
|
|
869
|
+
query?: Partial<
|
|
870
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
871
|
+
> &
|
|
872
|
+
Pick<
|
|
873
|
+
UndefinedInitialDataOptions<
|
|
874
|
+
Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
875
|
+
TError,
|
|
876
|
+
Awaited<ReturnType<typeof getOrganisationUnitUsers>>
|
|
877
|
+
>,
|
|
878
|
+
"initialData"
|
|
879
|
+
>;
|
|
880
|
+
request?: SecondParameter<typeof customFetch>;
|
|
881
|
+
},
|
|
882
|
+
queryClient?: QueryClient,
|
|
883
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
884
|
+
export function useGetOrganisationUnitUsers<
|
|
885
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
886
|
+
TError = ErrorType<AsError | void>,
|
|
887
|
+
>(
|
|
888
|
+
unitId: string,
|
|
889
|
+
options?: {
|
|
890
|
+
query?: Partial<
|
|
891
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
892
|
+
>;
|
|
893
|
+
request?: SecondParameter<typeof customFetch>;
|
|
894
|
+
},
|
|
895
|
+
queryClient?: QueryClient,
|
|
896
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
642
897
|
/**
|
|
643
898
|
* @summary Gets users in an Organisational Unit
|
|
644
899
|
*/
|
|
@@ -649,13 +904,18 @@ export function useGetOrganisationUnitUsers<
|
|
|
649
904
|
>(
|
|
650
905
|
unitId: string,
|
|
651
906
|
options?: {
|
|
652
|
-
query?:
|
|
907
|
+
query?: Partial<
|
|
908
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
909
|
+
>;
|
|
653
910
|
request?: SecondParameter<typeof customFetch>;
|
|
654
911
|
},
|
|
655
|
-
|
|
912
|
+
queryClient?: QueryClient,
|
|
913
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
656
914
|
const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);
|
|
657
915
|
|
|
658
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
916
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
917
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
918
|
+
};
|
|
659
919
|
|
|
660
920
|
query.queryKey = queryOptions.queryKey;
|
|
661
921
|
|
|
@@ -684,10 +944,8 @@ export const getGetOrganisationUnitUsersSuspenseQueryOptions = <
|
|
|
684
944
|
>(
|
|
685
945
|
unitId: string,
|
|
686
946
|
options?: {
|
|
687
|
-
query?:
|
|
688
|
-
Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
689
|
-
TError,
|
|
690
|
-
TData
|
|
947
|
+
query?: Partial<
|
|
948
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
691
949
|
>;
|
|
692
950
|
request?: SecondParameter<typeof customFetch>;
|
|
693
951
|
},
|
|
@@ -704,7 +962,7 @@ export const getGetOrganisationUnitUsersSuspenseQueryOptions = <
|
|
|
704
962
|
Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
705
963
|
TError,
|
|
706
964
|
TData
|
|
707
|
-
> & { queryKey: QueryKey };
|
|
965
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
708
966
|
};
|
|
709
967
|
|
|
710
968
|
export type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<
|
|
@@ -712,6 +970,45 @@ export type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<
|
|
|
712
970
|
>;
|
|
713
971
|
export type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>;
|
|
714
972
|
|
|
973
|
+
export function useGetOrganisationUnitUsersSuspense<
|
|
974
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
975
|
+
TError = ErrorType<AsError | void>,
|
|
976
|
+
>(
|
|
977
|
+
unitId: string,
|
|
978
|
+
options: {
|
|
979
|
+
query: Partial<
|
|
980
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
981
|
+
>;
|
|
982
|
+
request?: SecondParameter<typeof customFetch>;
|
|
983
|
+
},
|
|
984
|
+
queryClient?: QueryClient,
|
|
985
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
986
|
+
export function useGetOrganisationUnitUsersSuspense<
|
|
987
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
988
|
+
TError = ErrorType<AsError | void>,
|
|
989
|
+
>(
|
|
990
|
+
unitId: string,
|
|
991
|
+
options?: {
|
|
992
|
+
query?: Partial<
|
|
993
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
994
|
+
>;
|
|
995
|
+
request?: SecondParameter<typeof customFetch>;
|
|
996
|
+
},
|
|
997
|
+
queryClient?: QueryClient,
|
|
998
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
999
|
+
export function useGetOrganisationUnitUsersSuspense<
|
|
1000
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
1001
|
+
TError = ErrorType<AsError | void>,
|
|
1002
|
+
>(
|
|
1003
|
+
unitId: string,
|
|
1004
|
+
options?: {
|
|
1005
|
+
query?: Partial<
|
|
1006
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
1007
|
+
>;
|
|
1008
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1009
|
+
},
|
|
1010
|
+
queryClient?: QueryClient,
|
|
1011
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
715
1012
|
/**
|
|
716
1013
|
* @summary Gets users in an Organisational Unit
|
|
717
1014
|
*/
|
|
@@ -722,19 +1019,19 @@ export function useGetOrganisationUnitUsersSuspense<
|
|
|
722
1019
|
>(
|
|
723
1020
|
unitId: string,
|
|
724
1021
|
options?: {
|
|
725
|
-
query?:
|
|
726
|
-
Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
|
|
727
|
-
TError,
|
|
728
|
-
TData
|
|
1022
|
+
query?: Partial<
|
|
1023
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
|
|
729
1024
|
>;
|
|
730
1025
|
request?: SecondParameter<typeof customFetch>;
|
|
731
1026
|
},
|
|
732
|
-
|
|
1027
|
+
queryClient?: QueryClient,
|
|
1028
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
733
1029
|
const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);
|
|
734
1030
|
|
|
735
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
736
|
-
|
|
737
|
-
|
|
1031
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1032
|
+
TData,
|
|
1033
|
+
TError
|
|
1034
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
738
1035
|
|
|
739
1036
|
query.queryKey = queryOptions.queryKey;
|
|
740
1037
|
|
|
@@ -831,18 +1128,18 @@ export type AddOrganisationUnitUserMutationError = ErrorType<AsError | void>;
|
|
|
831
1128
|
/**
|
|
832
1129
|
* @summary Adds a user to an Organisational Unit
|
|
833
1130
|
*/
|
|
834
|
-
export const useAddOrganisationUnitUser = <
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
1131
|
+
export const useAddOrganisationUnitUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1132
|
+
options?: {
|
|
1133
|
+
mutation?: UseMutationOptions<
|
|
1134
|
+
Awaited<ReturnType<typeof addOrganisationUnitUser>>,
|
|
1135
|
+
TError,
|
|
1136
|
+
{ unitId: string; userId: string },
|
|
1137
|
+
TContext
|
|
1138
|
+
>;
|
|
1139
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1140
|
+
},
|
|
1141
|
+
queryClient?: QueryClient,
|
|
1142
|
+
): UseMutationResult<
|
|
846
1143
|
Awaited<ReturnType<typeof addOrganisationUnitUser>>,
|
|
847
1144
|
TError,
|
|
848
1145
|
{ unitId: string; userId: string },
|
|
@@ -850,7 +1147,7 @@ export const useAddOrganisationUnitUser = <
|
|
|
850
1147
|
> => {
|
|
851
1148
|
const mutationOptions = getAddOrganisationUnitUserMutationOptions(options);
|
|
852
1149
|
|
|
853
|
-
return useMutation(mutationOptions);
|
|
1150
|
+
return useMutation(mutationOptions, queryClient);
|
|
854
1151
|
};
|
|
855
1152
|
/**
|
|
856
1153
|
* Removes a User from an Organisational Unit.
|
|
@@ -945,15 +1242,18 @@ export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError | void>;
|
|
|
945
1242
|
export const useDeleteOrganisationUnitUser = <
|
|
946
1243
|
TError = ErrorType<AsError | void>,
|
|
947
1244
|
TContext = unknown,
|
|
948
|
-
>(
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1245
|
+
>(
|
|
1246
|
+
options?: {
|
|
1247
|
+
mutation?: UseMutationOptions<
|
|
1248
|
+
Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
|
|
1249
|
+
TError,
|
|
1250
|
+
{ unitId: string; userId: string },
|
|
1251
|
+
TContext
|
|
1252
|
+
>;
|
|
1253
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1254
|
+
},
|
|
1255
|
+
queryClient?: QueryClient,
|
|
1256
|
+
): UseMutationResult<
|
|
957
1257
|
Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
|
|
958
1258
|
TError,
|
|
959
1259
|
{ unitId: string; userId: string },
|
|
@@ -961,5 +1261,5 @@ export const useDeleteOrganisationUnitUser = <
|
|
|
961
1261
|
> => {
|
|
962
1262
|
const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);
|
|
963
1263
|
|
|
964
|
-
return useMutation(mutationOptions);
|
|
1264
|
+
return useMutation(mutationOptions, queryClient);
|
|
965
1265
|
};
|