@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,
|
|
@@ -91,7 +95,9 @@ export const getGetOrganisationUnitsQueryOptions = <
|
|
|
91
95
|
>(
|
|
92
96
|
orgId: string,
|
|
93
97
|
options?: {
|
|
94
|
-
query?:
|
|
98
|
+
query?: Partial<
|
|
99
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
100
|
+
>;
|
|
95
101
|
request?: SecondParameter<typeof customFetch>;
|
|
96
102
|
},
|
|
97
103
|
) => {
|
|
@@ -106,7 +112,7 @@ export const getGetOrganisationUnitsQueryOptions = <
|
|
|
106
112
|
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
107
113
|
TError,
|
|
108
114
|
TData
|
|
109
|
-
> & { queryKey: QueryKey };
|
|
115
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
110
116
|
};
|
|
111
117
|
|
|
112
118
|
export type GetOrganisationUnitsQueryResult = NonNullable<
|
|
@@ -114,6 +120,61 @@ export type GetOrganisationUnitsQueryResult = NonNullable<
|
|
|
114
120
|
>;
|
|
115
121
|
export type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;
|
|
116
122
|
|
|
123
|
+
export function useGetOrganisationUnits<
|
|
124
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
125
|
+
TError = ErrorType<void | AsError>,
|
|
126
|
+
>(
|
|
127
|
+
orgId: string,
|
|
128
|
+
options: {
|
|
129
|
+
query: Partial<
|
|
130
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
131
|
+
> &
|
|
132
|
+
Pick<
|
|
133
|
+
DefinedInitialDataOptions<
|
|
134
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
135
|
+
TError,
|
|
136
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>
|
|
137
|
+
>,
|
|
138
|
+
"initialData"
|
|
139
|
+
>;
|
|
140
|
+
request?: SecondParameter<typeof customFetch>;
|
|
141
|
+
},
|
|
142
|
+
queryClient?: QueryClient,
|
|
143
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
144
|
+
export function useGetOrganisationUnits<
|
|
145
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
146
|
+
TError = ErrorType<void | AsError>,
|
|
147
|
+
>(
|
|
148
|
+
orgId: string,
|
|
149
|
+
options?: {
|
|
150
|
+
query?: Partial<
|
|
151
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
152
|
+
> &
|
|
153
|
+
Pick<
|
|
154
|
+
UndefinedInitialDataOptions<
|
|
155
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
156
|
+
TError,
|
|
157
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>
|
|
158
|
+
>,
|
|
159
|
+
"initialData"
|
|
160
|
+
>;
|
|
161
|
+
request?: SecondParameter<typeof customFetch>;
|
|
162
|
+
},
|
|
163
|
+
queryClient?: QueryClient,
|
|
164
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
165
|
+
export function useGetOrganisationUnits<
|
|
166
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
167
|
+
TError = ErrorType<void | AsError>,
|
|
168
|
+
>(
|
|
169
|
+
orgId: string,
|
|
170
|
+
options?: {
|
|
171
|
+
query?: Partial<
|
|
172
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
173
|
+
>;
|
|
174
|
+
request?: SecondParameter<typeof customFetch>;
|
|
175
|
+
},
|
|
176
|
+
queryClient?: QueryClient,
|
|
177
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
117
178
|
/**
|
|
118
179
|
* @summary Gets Organisational Units
|
|
119
180
|
*/
|
|
@@ -124,13 +185,18 @@ export function useGetOrganisationUnits<
|
|
|
124
185
|
>(
|
|
125
186
|
orgId: string,
|
|
126
187
|
options?: {
|
|
127
|
-
query?:
|
|
188
|
+
query?: Partial<
|
|
189
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
190
|
+
>;
|
|
128
191
|
request?: SecondParameter<typeof customFetch>;
|
|
129
192
|
},
|
|
130
|
-
|
|
193
|
+
queryClient?: QueryClient,
|
|
194
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
131
195
|
const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);
|
|
132
196
|
|
|
133
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
197
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
198
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
199
|
+
};
|
|
134
200
|
|
|
135
201
|
query.queryKey = queryOptions.queryKey;
|
|
136
202
|
|
|
@@ -159,10 +225,8 @@ export const getGetOrganisationUnitsSuspenseQueryOptions = <
|
|
|
159
225
|
>(
|
|
160
226
|
orgId: string,
|
|
161
227
|
options?: {
|
|
162
|
-
query?:
|
|
163
|
-
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
164
|
-
TError,
|
|
165
|
-
TData
|
|
228
|
+
query?: Partial<
|
|
229
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
166
230
|
>;
|
|
167
231
|
request?: SecondParameter<typeof customFetch>;
|
|
168
232
|
},
|
|
@@ -178,7 +242,7 @@ export const getGetOrganisationUnitsSuspenseQueryOptions = <
|
|
|
178
242
|
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
179
243
|
TError,
|
|
180
244
|
TData
|
|
181
|
-
> & { queryKey: QueryKey };
|
|
245
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
182
246
|
};
|
|
183
247
|
|
|
184
248
|
export type GetOrganisationUnitsSuspenseQueryResult = NonNullable<
|
|
@@ -186,6 +250,45 @@ export type GetOrganisationUnitsSuspenseQueryResult = NonNullable<
|
|
|
186
250
|
>;
|
|
187
251
|
export type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>;
|
|
188
252
|
|
|
253
|
+
export function useGetOrganisationUnitsSuspense<
|
|
254
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
255
|
+
TError = ErrorType<void | AsError>,
|
|
256
|
+
>(
|
|
257
|
+
orgId: string,
|
|
258
|
+
options: {
|
|
259
|
+
query: Partial<
|
|
260
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
261
|
+
>;
|
|
262
|
+
request?: SecondParameter<typeof customFetch>;
|
|
263
|
+
},
|
|
264
|
+
queryClient?: QueryClient,
|
|
265
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
266
|
+
export function useGetOrganisationUnitsSuspense<
|
|
267
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
268
|
+
TError = ErrorType<void | AsError>,
|
|
269
|
+
>(
|
|
270
|
+
orgId: string,
|
|
271
|
+
options?: {
|
|
272
|
+
query?: Partial<
|
|
273
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
274
|
+
>;
|
|
275
|
+
request?: SecondParameter<typeof customFetch>;
|
|
276
|
+
},
|
|
277
|
+
queryClient?: QueryClient,
|
|
278
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
279
|
+
export function useGetOrganisationUnitsSuspense<
|
|
280
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
281
|
+
TError = ErrorType<void | AsError>,
|
|
282
|
+
>(
|
|
283
|
+
orgId: string,
|
|
284
|
+
options?: {
|
|
285
|
+
query?: Partial<
|
|
286
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
287
|
+
>;
|
|
288
|
+
request?: SecondParameter<typeof customFetch>;
|
|
289
|
+
},
|
|
290
|
+
queryClient?: QueryClient,
|
|
291
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
189
292
|
/**
|
|
190
293
|
* @summary Gets Organisational Units
|
|
191
294
|
*/
|
|
@@ -196,19 +299,19 @@ export function useGetOrganisationUnitsSuspense<
|
|
|
196
299
|
>(
|
|
197
300
|
orgId: string,
|
|
198
301
|
options?: {
|
|
199
|
-
query?:
|
|
200
|
-
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
201
|
-
TError,
|
|
202
|
-
TData
|
|
302
|
+
query?: Partial<
|
|
303
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
203
304
|
>;
|
|
204
305
|
request?: SecondParameter<typeof customFetch>;
|
|
205
306
|
},
|
|
206
|
-
|
|
307
|
+
queryClient?: QueryClient,
|
|
308
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
207
309
|
const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId, options);
|
|
208
310
|
|
|
209
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
210
|
-
|
|
211
|
-
|
|
311
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
312
|
+
TData,
|
|
313
|
+
TError
|
|
314
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
212
315
|
|
|
213
316
|
query.queryKey = queryOptions.queryKey;
|
|
214
317
|
|
|
@@ -307,18 +410,18 @@ export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;
|
|
|
307
410
|
/**
|
|
308
411
|
* @summary Create a new Organisational Unit
|
|
309
412
|
*/
|
|
310
|
-
export const useCreateOrganisationUnit = <
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
413
|
+
export const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
414
|
+
options?: {
|
|
415
|
+
mutation?: UseMutationOptions<
|
|
416
|
+
Awaited<ReturnType<typeof createOrganisationUnit>>,
|
|
417
|
+
TError,
|
|
418
|
+
{ orgId: string; data: OrganisationUnitPostBodyBody },
|
|
419
|
+
TContext
|
|
420
|
+
>;
|
|
421
|
+
request?: SecondParameter<typeof customFetch>;
|
|
422
|
+
},
|
|
423
|
+
queryClient?: QueryClient,
|
|
424
|
+
): UseMutationResult<
|
|
322
425
|
Awaited<ReturnType<typeof createOrganisationUnit>>,
|
|
323
426
|
TError,
|
|
324
427
|
{ orgId: string; data: OrganisationUnitPostBodyBody },
|
|
@@ -326,7 +429,7 @@ export const useCreateOrganisationUnit = <
|
|
|
326
429
|
> => {
|
|
327
430
|
const mutationOptions = getCreateOrganisationUnitMutationOptions(options);
|
|
328
431
|
|
|
329
|
-
return useMutation(mutationOptions);
|
|
432
|
+
return useMutation(mutationOptions, queryClient);
|
|
330
433
|
};
|
|
331
434
|
/**
|
|
332
435
|
* Gets a Unit. You can get a Unit if you are a member of it or are its creator. You can also get a Unit if you are a member of its **Organisation**, or its creator or an admin user.
|
|
@@ -368,7 +471,7 @@ export const getGetUnitQueryOptions = <
|
|
|
368
471
|
>(
|
|
369
472
|
unitId: string,
|
|
370
473
|
options?: {
|
|
371
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
474
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
372
475
|
request?: SecondParameter<typeof customFetch>;
|
|
373
476
|
},
|
|
374
477
|
) => {
|
|
@@ -383,12 +486,61 @@ export const getGetUnitQueryOptions = <
|
|
|
383
486
|
Awaited<ReturnType<typeof getUnit>>,
|
|
384
487
|
TError,
|
|
385
488
|
TData
|
|
386
|
-
> & { queryKey: QueryKey };
|
|
489
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
387
490
|
};
|
|
388
491
|
|
|
389
492
|
export type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
|
|
390
493
|
export type GetUnitQueryError = ErrorType<void | AsError>;
|
|
391
494
|
|
|
495
|
+
export function useGetUnit<
|
|
496
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
497
|
+
TError = ErrorType<void | AsError>,
|
|
498
|
+
>(
|
|
499
|
+
unitId: string,
|
|
500
|
+
options: {
|
|
501
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>> &
|
|
502
|
+
Pick<
|
|
503
|
+
DefinedInitialDataOptions<
|
|
504
|
+
Awaited<ReturnType<typeof getUnit>>,
|
|
505
|
+
TError,
|
|
506
|
+
Awaited<ReturnType<typeof getUnit>>
|
|
507
|
+
>,
|
|
508
|
+
"initialData"
|
|
509
|
+
>;
|
|
510
|
+
request?: SecondParameter<typeof customFetch>;
|
|
511
|
+
},
|
|
512
|
+
queryClient?: QueryClient,
|
|
513
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
514
|
+
export function useGetUnit<
|
|
515
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
516
|
+
TError = ErrorType<void | AsError>,
|
|
517
|
+
>(
|
|
518
|
+
unitId: string,
|
|
519
|
+
options?: {
|
|
520
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>> &
|
|
521
|
+
Pick<
|
|
522
|
+
UndefinedInitialDataOptions<
|
|
523
|
+
Awaited<ReturnType<typeof getUnit>>,
|
|
524
|
+
TError,
|
|
525
|
+
Awaited<ReturnType<typeof getUnit>>
|
|
526
|
+
>,
|
|
527
|
+
"initialData"
|
|
528
|
+
>;
|
|
529
|
+
request?: SecondParameter<typeof customFetch>;
|
|
530
|
+
},
|
|
531
|
+
queryClient?: QueryClient,
|
|
532
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
533
|
+
export function useGetUnit<
|
|
534
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
535
|
+
TError = ErrorType<void | AsError>,
|
|
536
|
+
>(
|
|
537
|
+
unitId: string,
|
|
538
|
+
options?: {
|
|
539
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
540
|
+
request?: SecondParameter<typeof customFetch>;
|
|
541
|
+
},
|
|
542
|
+
queryClient?: QueryClient,
|
|
543
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
392
544
|
/**
|
|
393
545
|
* @summary Gets an Organisational Unit
|
|
394
546
|
*/
|
|
@@ -399,13 +551,16 @@ export function useGetUnit<
|
|
|
399
551
|
>(
|
|
400
552
|
unitId: string,
|
|
401
553
|
options?: {
|
|
402
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
554
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
403
555
|
request?: SecondParameter<typeof customFetch>;
|
|
404
556
|
},
|
|
405
|
-
|
|
557
|
+
queryClient?: QueryClient,
|
|
558
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
406
559
|
const queryOptions = getGetUnitQueryOptions(unitId, options);
|
|
407
560
|
|
|
408
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
561
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
562
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
563
|
+
};
|
|
409
564
|
|
|
410
565
|
query.queryKey = queryOptions.queryKey;
|
|
411
566
|
|
|
@@ -431,7 +586,7 @@ export const getGetUnitSuspenseQueryOptions = <
|
|
|
431
586
|
>(
|
|
432
587
|
unitId: string,
|
|
433
588
|
options?: {
|
|
434
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
589
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
435
590
|
request?: SecondParameter<typeof customFetch>;
|
|
436
591
|
},
|
|
437
592
|
) => {
|
|
@@ -446,12 +601,45 @@ export const getGetUnitSuspenseQueryOptions = <
|
|
|
446
601
|
Awaited<ReturnType<typeof getUnit>>,
|
|
447
602
|
TError,
|
|
448
603
|
TData
|
|
449
|
-
> & { queryKey: QueryKey };
|
|
604
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
450
605
|
};
|
|
451
606
|
|
|
452
607
|
export type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
|
|
453
608
|
export type GetUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
454
609
|
|
|
610
|
+
export function useGetUnitSuspense<
|
|
611
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
612
|
+
TError = ErrorType<void | AsError>,
|
|
613
|
+
>(
|
|
614
|
+
unitId: string,
|
|
615
|
+
options: {
|
|
616
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
617
|
+
request?: SecondParameter<typeof customFetch>;
|
|
618
|
+
},
|
|
619
|
+
queryClient?: QueryClient,
|
|
620
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
621
|
+
export function useGetUnitSuspense<
|
|
622
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
623
|
+
TError = ErrorType<void | AsError>,
|
|
624
|
+
>(
|
|
625
|
+
unitId: string,
|
|
626
|
+
options?: {
|
|
627
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
628
|
+
request?: SecondParameter<typeof customFetch>;
|
|
629
|
+
},
|
|
630
|
+
queryClient?: QueryClient,
|
|
631
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
632
|
+
export function useGetUnitSuspense<
|
|
633
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
634
|
+
TError = ErrorType<void | AsError>,
|
|
635
|
+
>(
|
|
636
|
+
unitId: string,
|
|
637
|
+
options?: {
|
|
638
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
639
|
+
request?: SecondParameter<typeof customFetch>;
|
|
640
|
+
},
|
|
641
|
+
queryClient?: QueryClient,
|
|
642
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
455
643
|
/**
|
|
456
644
|
* @summary Gets an Organisational Unit
|
|
457
645
|
*/
|
|
@@ -462,15 +650,17 @@ export function useGetUnitSuspense<
|
|
|
462
650
|
>(
|
|
463
651
|
unitId: string,
|
|
464
652
|
options?: {
|
|
465
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
653
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
466
654
|
request?: SecondParameter<typeof customFetch>;
|
|
467
655
|
},
|
|
468
|
-
|
|
656
|
+
queryClient?: QueryClient,
|
|
657
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
469
658
|
const queryOptions = getGetUnitSuspenseQueryOptions(unitId, options);
|
|
470
659
|
|
|
471
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
472
|
-
|
|
473
|
-
|
|
660
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
661
|
+
TData,
|
|
662
|
+
TError
|
|
663
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
474
664
|
|
|
475
665
|
query.queryKey = queryOptions.queryKey;
|
|
476
666
|
|
|
@@ -561,15 +751,18 @@ export type PatchUnitMutationError = ErrorType<void | AsError>;
|
|
|
561
751
|
/**
|
|
562
752
|
* @summary Adjust an existing Unit
|
|
563
753
|
*/
|
|
564
|
-
export const usePatchUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
754
|
+
export const usePatchUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
755
|
+
options?: {
|
|
756
|
+
mutation?: UseMutationOptions<
|
|
757
|
+
Awaited<ReturnType<typeof patchUnit>>,
|
|
758
|
+
TError,
|
|
759
|
+
{ unitId: string; data: UnitPatchBodyBody },
|
|
760
|
+
TContext
|
|
761
|
+
>;
|
|
762
|
+
request?: SecondParameter<typeof customFetch>;
|
|
763
|
+
},
|
|
764
|
+
queryClient?: QueryClient,
|
|
765
|
+
): UseMutationResult<
|
|
573
766
|
Awaited<ReturnType<typeof patchUnit>>,
|
|
574
767
|
TError,
|
|
575
768
|
{ unitId: string; data: UnitPatchBodyBody },
|
|
@@ -577,7 +770,7 @@ export const usePatchUnit = <TError = ErrorType<void | AsError>, TContext = unkn
|
|
|
577
770
|
> => {
|
|
578
771
|
const mutationOptions = getPatchUnitMutationOptions(options);
|
|
579
772
|
|
|
580
|
-
return useMutation(mutationOptions);
|
|
773
|
+
return useMutation(mutationOptions, queryClient);
|
|
581
774
|
};
|
|
582
775
|
/**
|
|
583
776
|
* Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.
|
|
@@ -668,18 +861,18 @@ export type DeleteOrganisationUnitMutationError = ErrorType<void | AsError>;
|
|
|
668
861
|
/**
|
|
669
862
|
* @summary Deletes an Organisational Unit
|
|
670
863
|
*/
|
|
671
|
-
export const useDeleteOrganisationUnit = <
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
864
|
+
export const useDeleteOrganisationUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
865
|
+
options?: {
|
|
866
|
+
mutation?: UseMutationOptions<
|
|
867
|
+
Awaited<ReturnType<typeof deleteOrganisationUnit>>,
|
|
868
|
+
TError,
|
|
869
|
+
{ unitId: string },
|
|
870
|
+
TContext
|
|
871
|
+
>;
|
|
872
|
+
request?: SecondParameter<typeof customFetch>;
|
|
873
|
+
},
|
|
874
|
+
queryClient?: QueryClient,
|
|
875
|
+
): UseMutationResult<
|
|
683
876
|
Awaited<ReturnType<typeof deleteOrganisationUnit>>,
|
|
684
877
|
TError,
|
|
685
878
|
{ unitId: string },
|
|
@@ -687,7 +880,7 @@ export const useDeleteOrganisationUnit = <
|
|
|
687
880
|
> => {
|
|
688
881
|
const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);
|
|
689
882
|
|
|
690
|
-
return useMutation(mutationOptions);
|
|
883
|
+
return useMutation(mutationOptions, queryClient);
|
|
691
884
|
};
|
|
692
885
|
/**
|
|
693
886
|
* @summary Gets your Personal Unit (if you have one)
|
|
@@ -728,7 +921,7 @@ export const getGetPersonalUnitQueryOptions = <
|
|
|
728
921
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
729
922
|
TError = ErrorType<void | AsError>,
|
|
730
923
|
>(options?: {
|
|
731
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData
|
|
924
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>>;
|
|
732
925
|
request?: SecondParameter<typeof customFetch>;
|
|
733
926
|
}) => {
|
|
734
927
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -742,12 +935,58 @@ export const getGetPersonalUnitQueryOptions = <
|
|
|
742
935
|
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
743
936
|
TError,
|
|
744
937
|
TData
|
|
745
|
-
> & { queryKey: QueryKey };
|
|
938
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
746
939
|
};
|
|
747
940
|
|
|
748
941
|
export type GetPersonalUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getPersonalUnit>>>;
|
|
749
942
|
export type GetPersonalUnitQueryError = ErrorType<void | AsError>;
|
|
750
943
|
|
|
944
|
+
export function useGetPersonalUnit<
|
|
945
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
946
|
+
TError = ErrorType<void | AsError>,
|
|
947
|
+
>(
|
|
948
|
+
options: {
|
|
949
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>> &
|
|
950
|
+
Pick<
|
|
951
|
+
DefinedInitialDataOptions<
|
|
952
|
+
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
953
|
+
TError,
|
|
954
|
+
Awaited<ReturnType<typeof getPersonalUnit>>
|
|
955
|
+
>,
|
|
956
|
+
"initialData"
|
|
957
|
+
>;
|
|
958
|
+
request?: SecondParameter<typeof customFetch>;
|
|
959
|
+
},
|
|
960
|
+
queryClient?: QueryClient,
|
|
961
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
962
|
+
export function useGetPersonalUnit<
|
|
963
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
964
|
+
TError = ErrorType<void | AsError>,
|
|
965
|
+
>(
|
|
966
|
+
options?: {
|
|
967
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>> &
|
|
968
|
+
Pick<
|
|
969
|
+
UndefinedInitialDataOptions<
|
|
970
|
+
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
971
|
+
TError,
|
|
972
|
+
Awaited<ReturnType<typeof getPersonalUnit>>
|
|
973
|
+
>,
|
|
974
|
+
"initialData"
|
|
975
|
+
>;
|
|
976
|
+
request?: SecondParameter<typeof customFetch>;
|
|
977
|
+
},
|
|
978
|
+
queryClient?: QueryClient,
|
|
979
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
980
|
+
export function useGetPersonalUnit<
|
|
981
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
982
|
+
TError = ErrorType<void | AsError>,
|
|
983
|
+
>(
|
|
984
|
+
options?: {
|
|
985
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>>;
|
|
986
|
+
request?: SecondParameter<typeof customFetch>;
|
|
987
|
+
},
|
|
988
|
+
queryClient?: QueryClient,
|
|
989
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
751
990
|
/**
|
|
752
991
|
* @summary Gets your Personal Unit (if you have one)
|
|
753
992
|
*/
|
|
@@ -755,13 +994,18 @@ export type GetPersonalUnitQueryError = ErrorType<void | AsError>;
|
|
|
755
994
|
export function useGetPersonalUnit<
|
|
756
995
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
757
996
|
TError = ErrorType<void | AsError>,
|
|
758
|
-
>(
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
997
|
+
>(
|
|
998
|
+
options?: {
|
|
999
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>>;
|
|
1000
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1001
|
+
},
|
|
1002
|
+
queryClient?: QueryClient,
|
|
1003
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
762
1004
|
const queryOptions = getGetPersonalUnitQueryOptions(options);
|
|
763
1005
|
|
|
764
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
1006
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1007
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
1008
|
+
};
|
|
765
1009
|
|
|
766
1010
|
query.queryKey = queryOptions.queryKey;
|
|
767
1011
|
|
|
@@ -784,7 +1028,9 @@ export const getGetPersonalUnitSuspenseQueryOptions = <
|
|
|
784
1028
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
785
1029
|
TError = ErrorType<void | AsError>,
|
|
786
1030
|
>(options?: {
|
|
787
|
-
query?:
|
|
1031
|
+
query?: Partial<
|
|
1032
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
1033
|
+
>;
|
|
788
1034
|
request?: SecondParameter<typeof customFetch>;
|
|
789
1035
|
}) => {
|
|
790
1036
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -798,7 +1044,7 @@ export const getGetPersonalUnitSuspenseQueryOptions = <
|
|
|
798
1044
|
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
799
1045
|
TError,
|
|
800
1046
|
TData
|
|
801
|
-
> & { queryKey: QueryKey };
|
|
1047
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
802
1048
|
};
|
|
803
1049
|
|
|
804
1050
|
export type GetPersonalUnitSuspenseQueryResult = NonNullable<
|
|
@@ -806,6 +1052,42 @@ export type GetPersonalUnitSuspenseQueryResult = NonNullable<
|
|
|
806
1052
|
>;
|
|
807
1053
|
export type GetPersonalUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
808
1054
|
|
|
1055
|
+
export function useGetPersonalUnitSuspense<
|
|
1056
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
1057
|
+
TError = ErrorType<void | AsError>,
|
|
1058
|
+
>(
|
|
1059
|
+
options: {
|
|
1060
|
+
query: Partial<
|
|
1061
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
1062
|
+
>;
|
|
1063
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1064
|
+
},
|
|
1065
|
+
queryClient?: QueryClient,
|
|
1066
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1067
|
+
export function useGetPersonalUnitSuspense<
|
|
1068
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
1069
|
+
TError = ErrorType<void | AsError>,
|
|
1070
|
+
>(
|
|
1071
|
+
options?: {
|
|
1072
|
+
query?: Partial<
|
|
1073
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
1074
|
+
>;
|
|
1075
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1076
|
+
},
|
|
1077
|
+
queryClient?: QueryClient,
|
|
1078
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1079
|
+
export function useGetPersonalUnitSuspense<
|
|
1080
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
1081
|
+
TError = ErrorType<void | AsError>,
|
|
1082
|
+
>(
|
|
1083
|
+
options?: {
|
|
1084
|
+
query?: Partial<
|
|
1085
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
1086
|
+
>;
|
|
1087
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1088
|
+
},
|
|
1089
|
+
queryClient?: QueryClient,
|
|
1090
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
809
1091
|
/**
|
|
810
1092
|
* @summary Gets your Personal Unit (if you have one)
|
|
811
1093
|
*/
|
|
@@ -813,15 +1095,21 @@ export type GetPersonalUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
813
1095
|
export function useGetPersonalUnitSuspense<
|
|
814
1096
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
815
1097
|
TError = ErrorType<void | AsError>,
|
|
816
|
-
>(
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
1098
|
+
>(
|
|
1099
|
+
options?: {
|
|
1100
|
+
query?: Partial<
|
|
1101
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
1102
|
+
>;
|
|
1103
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1104
|
+
},
|
|
1105
|
+
queryClient?: QueryClient,
|
|
1106
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
820
1107
|
const queryOptions = getGetPersonalUnitSuspenseQueryOptions(options);
|
|
821
1108
|
|
|
822
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
823
|
-
|
|
824
|
-
|
|
1109
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1110
|
+
TData,
|
|
1111
|
+
TError
|
|
1112
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
825
1113
|
|
|
826
1114
|
query.queryKey = queryOptions.queryKey;
|
|
827
1115
|
|
|
@@ -917,18 +1205,18 @@ export type CreatePersonalUnitMutationError = ErrorType<AsError | void>;
|
|
|
917
1205
|
/**
|
|
918
1206
|
* @summary Create a new Personal Unit
|
|
919
1207
|
*/
|
|
920
|
-
export const useCreatePersonalUnit = <
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
1208
|
+
export const useCreatePersonalUnit = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1209
|
+
options?: {
|
|
1210
|
+
mutation?: UseMutationOptions<
|
|
1211
|
+
Awaited<ReturnType<typeof createPersonalUnit>>,
|
|
1212
|
+
TError,
|
|
1213
|
+
{ data: PersonalUnitPutBodyBody },
|
|
1214
|
+
TContext
|
|
1215
|
+
>;
|
|
1216
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1217
|
+
},
|
|
1218
|
+
queryClient?: QueryClient,
|
|
1219
|
+
): UseMutationResult<
|
|
932
1220
|
Awaited<ReturnType<typeof createPersonalUnit>>,
|
|
933
1221
|
TError,
|
|
934
1222
|
{ data: PersonalUnitPutBodyBody },
|
|
@@ -936,7 +1224,7 @@ export const useCreatePersonalUnit = <
|
|
|
936
1224
|
> => {
|
|
937
1225
|
const mutationOptions = getCreatePersonalUnitMutationOptions(options);
|
|
938
1226
|
|
|
939
|
-
return useMutation(mutationOptions);
|
|
1227
|
+
return useMutation(mutationOptions, queryClient);
|
|
940
1228
|
};
|
|
941
1229
|
/**
|
|
942
1230
|
* Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**
|
|
@@ -1012,21 +1300,21 @@ export type DeletePersonalUnitMutationError = ErrorType<void | AsError>;
|
|
|
1012
1300
|
/**
|
|
1013
1301
|
* @summary Deletes a Personal Unit
|
|
1014
1302
|
*/
|
|
1015
|
-
export const useDeletePersonalUnit = <
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1303
|
+
export const useDeletePersonalUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
1304
|
+
options?: {
|
|
1305
|
+
mutation?: UseMutationOptions<
|
|
1306
|
+
Awaited<ReturnType<typeof deletePersonalUnit>>,
|
|
1307
|
+
TError,
|
|
1308
|
+
void,
|
|
1309
|
+
TContext
|
|
1310
|
+
>;
|
|
1311
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1312
|
+
},
|
|
1313
|
+
queryClient?: QueryClient,
|
|
1314
|
+
): UseMutationResult<Awaited<ReturnType<typeof deletePersonalUnit>>, TError, void, TContext> => {
|
|
1027
1315
|
const mutationOptions = getDeletePersonalUnitMutationOptions(options);
|
|
1028
1316
|
|
|
1029
|
-
return useMutation(mutationOptions);
|
|
1317
|
+
return useMutation(mutationOptions, queryClient);
|
|
1030
1318
|
};
|
|
1031
1319
|
/**
|
|
1032
1320
|
* Gets all the Units that you are a member of, or a specific Unit by name.
|
|
@@ -1083,7 +1371,7 @@ export const getGetUnitsQueryOptions = <
|
|
|
1083
1371
|
>(
|
|
1084
1372
|
params?: GetUnitsParams,
|
|
1085
1373
|
options?: {
|
|
1086
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1374
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1087
1375
|
request?: SecondParameter<typeof customFetch>;
|
|
1088
1376
|
},
|
|
1089
1377
|
) => {
|
|
@@ -1098,12 +1386,61 @@ export const getGetUnitsQueryOptions = <
|
|
|
1098
1386
|
Awaited<ReturnType<typeof getUnits>>,
|
|
1099
1387
|
TError,
|
|
1100
1388
|
TData
|
|
1101
|
-
> & { queryKey: QueryKey };
|
|
1389
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
1102
1390
|
};
|
|
1103
1391
|
|
|
1104
1392
|
export type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>;
|
|
1105
1393
|
export type GetUnitsQueryError = ErrorType<void | AsError>;
|
|
1106
1394
|
|
|
1395
|
+
export function useGetUnits<
|
|
1396
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1397
|
+
TError = ErrorType<void | AsError>,
|
|
1398
|
+
>(
|
|
1399
|
+
params: undefined | GetUnitsParams,
|
|
1400
|
+
options: {
|
|
1401
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>> &
|
|
1402
|
+
Pick<
|
|
1403
|
+
DefinedInitialDataOptions<
|
|
1404
|
+
Awaited<ReturnType<typeof getUnits>>,
|
|
1405
|
+
TError,
|
|
1406
|
+
Awaited<ReturnType<typeof getUnits>>
|
|
1407
|
+
>,
|
|
1408
|
+
"initialData"
|
|
1409
|
+
>;
|
|
1410
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1411
|
+
},
|
|
1412
|
+
queryClient?: QueryClient,
|
|
1413
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1414
|
+
export function useGetUnits<
|
|
1415
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1416
|
+
TError = ErrorType<void | AsError>,
|
|
1417
|
+
>(
|
|
1418
|
+
params?: GetUnitsParams,
|
|
1419
|
+
options?: {
|
|
1420
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>> &
|
|
1421
|
+
Pick<
|
|
1422
|
+
UndefinedInitialDataOptions<
|
|
1423
|
+
Awaited<ReturnType<typeof getUnits>>,
|
|
1424
|
+
TError,
|
|
1425
|
+
Awaited<ReturnType<typeof getUnits>>
|
|
1426
|
+
>,
|
|
1427
|
+
"initialData"
|
|
1428
|
+
>;
|
|
1429
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1430
|
+
},
|
|
1431
|
+
queryClient?: QueryClient,
|
|
1432
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1433
|
+
export function useGetUnits<
|
|
1434
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1435
|
+
TError = ErrorType<void | AsError>,
|
|
1436
|
+
>(
|
|
1437
|
+
params?: GetUnitsParams,
|
|
1438
|
+
options?: {
|
|
1439
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1440
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1441
|
+
},
|
|
1442
|
+
queryClient?: QueryClient,
|
|
1443
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1107
1444
|
/**
|
|
1108
1445
|
* @summary Gets Units
|
|
1109
1446
|
*/
|
|
@@ -1114,13 +1451,16 @@ export function useGetUnits<
|
|
|
1114
1451
|
>(
|
|
1115
1452
|
params?: GetUnitsParams,
|
|
1116
1453
|
options?: {
|
|
1117
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1454
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1118
1455
|
request?: SecondParameter<typeof customFetch>;
|
|
1119
1456
|
},
|
|
1120
|
-
|
|
1457
|
+
queryClient?: QueryClient,
|
|
1458
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
1121
1459
|
const queryOptions = getGetUnitsQueryOptions(params, options);
|
|
1122
1460
|
|
|
1123
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
1461
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1462
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
1463
|
+
};
|
|
1124
1464
|
|
|
1125
1465
|
query.queryKey = queryOptions.queryKey;
|
|
1126
1466
|
|
|
@@ -1146,7 +1486,7 @@ export const getGetUnitsSuspenseQueryOptions = <
|
|
|
1146
1486
|
>(
|
|
1147
1487
|
params?: GetUnitsParams,
|
|
1148
1488
|
options?: {
|
|
1149
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1489
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1150
1490
|
request?: SecondParameter<typeof customFetch>;
|
|
1151
1491
|
},
|
|
1152
1492
|
) => {
|
|
@@ -1161,12 +1501,45 @@ export const getGetUnitsSuspenseQueryOptions = <
|
|
|
1161
1501
|
Awaited<ReturnType<typeof getUnits>>,
|
|
1162
1502
|
TError,
|
|
1163
1503
|
TData
|
|
1164
|
-
> & { queryKey: QueryKey };
|
|
1504
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
1165
1505
|
};
|
|
1166
1506
|
|
|
1167
1507
|
export type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>;
|
|
1168
1508
|
export type GetUnitsSuspenseQueryError = ErrorType<void | AsError>;
|
|
1169
1509
|
|
|
1510
|
+
export function useGetUnitsSuspense<
|
|
1511
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1512
|
+
TError = ErrorType<void | AsError>,
|
|
1513
|
+
>(
|
|
1514
|
+
params: undefined | GetUnitsParams,
|
|
1515
|
+
options: {
|
|
1516
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1517
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1518
|
+
},
|
|
1519
|
+
queryClient?: QueryClient,
|
|
1520
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1521
|
+
export function useGetUnitsSuspense<
|
|
1522
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1523
|
+
TError = ErrorType<void | AsError>,
|
|
1524
|
+
>(
|
|
1525
|
+
params?: GetUnitsParams,
|
|
1526
|
+
options?: {
|
|
1527
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1528
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1529
|
+
},
|
|
1530
|
+
queryClient?: QueryClient,
|
|
1531
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1532
|
+
export function useGetUnitsSuspense<
|
|
1533
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1534
|
+
TError = ErrorType<void | AsError>,
|
|
1535
|
+
>(
|
|
1536
|
+
params?: GetUnitsParams,
|
|
1537
|
+
options?: {
|
|
1538
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1539
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1540
|
+
},
|
|
1541
|
+
queryClient?: QueryClient,
|
|
1542
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1170
1543
|
/**
|
|
1171
1544
|
* @summary Gets Units
|
|
1172
1545
|
*/
|
|
@@ -1177,15 +1550,17 @@ export function useGetUnitsSuspense<
|
|
|
1177
1550
|
>(
|
|
1178
1551
|
params?: GetUnitsParams,
|
|
1179
1552
|
options?: {
|
|
1180
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1553
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1181
1554
|
request?: SecondParameter<typeof customFetch>;
|
|
1182
1555
|
},
|
|
1183
|
-
|
|
1556
|
+
queryClient?: QueryClient,
|
|
1557
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
1184
1558
|
const queryOptions = getGetUnitsSuspenseQueryOptions(params, options);
|
|
1185
1559
|
|
|
1186
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
1187
|
-
|
|
1188
|
-
|
|
1560
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1561
|
+
TData,
|
|
1562
|
+
TError
|
|
1563
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
1189
1564
|
|
|
1190
1565
|
query.queryKey = queryOptions.queryKey;
|
|
1191
1566
|
|
|
@@ -1281,18 +1656,18 @@ export type CreateDefaultUnitMutationError = ErrorType<AsError | void>;
|
|
|
1281
1656
|
/**
|
|
1282
1657
|
* @summary Create a new Personal Unit
|
|
1283
1658
|
*/
|
|
1284
|
-
export const useCreateDefaultUnit = <
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1659
|
+
export const useCreateDefaultUnit = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1660
|
+
options?: {
|
|
1661
|
+
mutation?: UseMutationOptions<
|
|
1662
|
+
Awaited<ReturnType<typeof createDefaultUnit>>,
|
|
1663
|
+
TError,
|
|
1664
|
+
{ data: PersonalUnitPutBodyBody },
|
|
1665
|
+
TContext
|
|
1666
|
+
>;
|
|
1667
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1668
|
+
},
|
|
1669
|
+
queryClient?: QueryClient,
|
|
1670
|
+
): UseMutationResult<
|
|
1296
1671
|
Awaited<ReturnType<typeof createDefaultUnit>>,
|
|
1297
1672
|
TError,
|
|
1298
1673
|
{ data: PersonalUnitPutBodyBody },
|
|
@@ -1300,7 +1675,7 @@ export const useCreateDefaultUnit = <
|
|
|
1300
1675
|
> => {
|
|
1301
1676
|
const mutationOptions = getCreateDefaultUnitMutationOptions(options);
|
|
1302
1677
|
|
|
1303
|
-
return useMutation(mutationOptions);
|
|
1678
|
+
return useMutation(mutationOptions, queryClient);
|
|
1304
1679
|
};
|
|
1305
1680
|
/**
|
|
1306
1681
|
* Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**
|
|
@@ -1376,19 +1751,19 @@ export type DeleteDefaultUnitMutationError = ErrorType<void | AsError>;
|
|
|
1376
1751
|
/**
|
|
1377
1752
|
* @summary Deletes a Personal Unit
|
|
1378
1753
|
*/
|
|
1379
|
-
export const useDeleteDefaultUnit = <
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1754
|
+
export const useDeleteDefaultUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
1755
|
+
options?: {
|
|
1756
|
+
mutation?: UseMutationOptions<
|
|
1757
|
+
Awaited<ReturnType<typeof deleteDefaultUnit>>,
|
|
1758
|
+
TError,
|
|
1759
|
+
void,
|
|
1760
|
+
TContext
|
|
1761
|
+
>;
|
|
1762
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1763
|
+
},
|
|
1764
|
+
queryClient?: QueryClient,
|
|
1765
|
+
): UseMutationResult<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, void, TContext> => {
|
|
1391
1766
|
const mutationOptions = getDeleteDefaultUnitMutationOptions(options);
|
|
1392
1767
|
|
|
1393
|
-
return useMutation(mutationOptions);
|
|
1768
|
+
return useMutation(mutationOptions, queryClient);
|
|
1394
1769
|
};
|