@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
package/src/api/unit/unit.ts
CHANGED
|
@@ -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,
|
|
@@ -67,7 +71,9 @@ export const getGetOrganisationUnitsQueryOptions = <
|
|
|
67
71
|
>(
|
|
68
72
|
orgId: string,
|
|
69
73
|
options?: {
|
|
70
|
-
query?:
|
|
74
|
+
query?: Partial<
|
|
75
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
76
|
+
>;
|
|
71
77
|
request?: SecondParameter<typeof customInstance>;
|
|
72
78
|
},
|
|
73
79
|
) => {
|
|
@@ -82,7 +88,7 @@ export const getGetOrganisationUnitsQueryOptions = <
|
|
|
82
88
|
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
83
89
|
TError,
|
|
84
90
|
TData
|
|
85
|
-
> & { queryKey: QueryKey };
|
|
91
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
86
92
|
};
|
|
87
93
|
|
|
88
94
|
export type GetOrganisationUnitsQueryResult = NonNullable<
|
|
@@ -90,6 +96,61 @@ export type GetOrganisationUnitsQueryResult = NonNullable<
|
|
|
90
96
|
>;
|
|
91
97
|
export type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;
|
|
92
98
|
|
|
99
|
+
export function useGetOrganisationUnits<
|
|
100
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
101
|
+
TError = ErrorType<void | AsError>,
|
|
102
|
+
>(
|
|
103
|
+
orgId: string,
|
|
104
|
+
options: {
|
|
105
|
+
query: Partial<
|
|
106
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
107
|
+
> &
|
|
108
|
+
Pick<
|
|
109
|
+
DefinedInitialDataOptions<
|
|
110
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
111
|
+
TError,
|
|
112
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>
|
|
113
|
+
>,
|
|
114
|
+
"initialData"
|
|
115
|
+
>;
|
|
116
|
+
request?: SecondParameter<typeof customInstance>;
|
|
117
|
+
},
|
|
118
|
+
queryClient?: QueryClient,
|
|
119
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
120
|
+
export function useGetOrganisationUnits<
|
|
121
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
122
|
+
TError = ErrorType<void | AsError>,
|
|
123
|
+
>(
|
|
124
|
+
orgId: string,
|
|
125
|
+
options?: {
|
|
126
|
+
query?: Partial<
|
|
127
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
128
|
+
> &
|
|
129
|
+
Pick<
|
|
130
|
+
UndefinedInitialDataOptions<
|
|
131
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
132
|
+
TError,
|
|
133
|
+
Awaited<ReturnType<typeof getOrganisationUnits>>
|
|
134
|
+
>,
|
|
135
|
+
"initialData"
|
|
136
|
+
>;
|
|
137
|
+
request?: SecondParameter<typeof customInstance>;
|
|
138
|
+
},
|
|
139
|
+
queryClient?: QueryClient,
|
|
140
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
141
|
+
export function useGetOrganisationUnits<
|
|
142
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
143
|
+
TError = ErrorType<void | AsError>,
|
|
144
|
+
>(
|
|
145
|
+
orgId: string,
|
|
146
|
+
options?: {
|
|
147
|
+
query?: Partial<
|
|
148
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
149
|
+
>;
|
|
150
|
+
request?: SecondParameter<typeof customInstance>;
|
|
151
|
+
},
|
|
152
|
+
queryClient?: QueryClient,
|
|
153
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
93
154
|
/**
|
|
94
155
|
* @summary Gets Organisational Units
|
|
95
156
|
*/
|
|
@@ -100,13 +161,18 @@ export function useGetOrganisationUnits<
|
|
|
100
161
|
>(
|
|
101
162
|
orgId: string,
|
|
102
163
|
options?: {
|
|
103
|
-
query?:
|
|
164
|
+
query?: Partial<
|
|
165
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
166
|
+
>;
|
|
104
167
|
request?: SecondParameter<typeof customInstance>;
|
|
105
168
|
},
|
|
106
|
-
|
|
169
|
+
queryClient?: QueryClient,
|
|
170
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
107
171
|
const queryOptions = getGetOrganisationUnitsQueryOptions(orgId, options);
|
|
108
172
|
|
|
109
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
173
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
174
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
175
|
+
};
|
|
110
176
|
|
|
111
177
|
query.queryKey = queryOptions.queryKey;
|
|
112
178
|
|
|
@@ -135,10 +201,8 @@ export const getGetOrganisationUnitsSuspenseQueryOptions = <
|
|
|
135
201
|
>(
|
|
136
202
|
orgId: string,
|
|
137
203
|
options?: {
|
|
138
|
-
query?:
|
|
139
|
-
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
140
|
-
TError,
|
|
141
|
-
TData
|
|
204
|
+
query?: Partial<
|
|
205
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
142
206
|
>;
|
|
143
207
|
request?: SecondParameter<typeof customInstance>;
|
|
144
208
|
},
|
|
@@ -154,7 +218,7 @@ export const getGetOrganisationUnitsSuspenseQueryOptions = <
|
|
|
154
218
|
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
155
219
|
TError,
|
|
156
220
|
TData
|
|
157
|
-
> & { queryKey: QueryKey };
|
|
221
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
158
222
|
};
|
|
159
223
|
|
|
160
224
|
export type GetOrganisationUnitsSuspenseQueryResult = NonNullable<
|
|
@@ -162,6 +226,45 @@ export type GetOrganisationUnitsSuspenseQueryResult = NonNullable<
|
|
|
162
226
|
>;
|
|
163
227
|
export type GetOrganisationUnitsSuspenseQueryError = ErrorType<void | AsError>;
|
|
164
228
|
|
|
229
|
+
export function useGetOrganisationUnitsSuspense<
|
|
230
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
231
|
+
TError = ErrorType<void | AsError>,
|
|
232
|
+
>(
|
|
233
|
+
orgId: string,
|
|
234
|
+
options: {
|
|
235
|
+
query: Partial<
|
|
236
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
237
|
+
>;
|
|
238
|
+
request?: SecondParameter<typeof customInstance>;
|
|
239
|
+
},
|
|
240
|
+
queryClient?: QueryClient,
|
|
241
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
242
|
+
export function useGetOrganisationUnitsSuspense<
|
|
243
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
244
|
+
TError = ErrorType<void | AsError>,
|
|
245
|
+
>(
|
|
246
|
+
orgId: string,
|
|
247
|
+
options?: {
|
|
248
|
+
query?: Partial<
|
|
249
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
250
|
+
>;
|
|
251
|
+
request?: SecondParameter<typeof customInstance>;
|
|
252
|
+
},
|
|
253
|
+
queryClient?: QueryClient,
|
|
254
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
255
|
+
export function useGetOrganisationUnitsSuspense<
|
|
256
|
+
TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
257
|
+
TError = ErrorType<void | AsError>,
|
|
258
|
+
>(
|
|
259
|
+
orgId: string,
|
|
260
|
+
options?: {
|
|
261
|
+
query?: Partial<
|
|
262
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
263
|
+
>;
|
|
264
|
+
request?: SecondParameter<typeof customInstance>;
|
|
265
|
+
},
|
|
266
|
+
queryClient?: QueryClient,
|
|
267
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
165
268
|
/**
|
|
166
269
|
* @summary Gets Organisational Units
|
|
167
270
|
*/
|
|
@@ -172,19 +275,19 @@ export function useGetOrganisationUnitsSuspense<
|
|
|
172
275
|
>(
|
|
173
276
|
orgId: string,
|
|
174
277
|
options?: {
|
|
175
|
-
query?:
|
|
176
|
-
Awaited<ReturnType<typeof getOrganisationUnits>>,
|
|
177
|
-
TError,
|
|
178
|
-
TData
|
|
278
|
+
query?: Partial<
|
|
279
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>
|
|
179
280
|
>;
|
|
180
281
|
request?: SecondParameter<typeof customInstance>;
|
|
181
282
|
},
|
|
182
|
-
|
|
283
|
+
queryClient?: QueryClient,
|
|
284
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
183
285
|
const queryOptions = getGetOrganisationUnitsSuspenseQueryOptions(orgId, options);
|
|
184
286
|
|
|
185
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
186
|
-
|
|
187
|
-
|
|
287
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
288
|
+
TData,
|
|
289
|
+
TError
|
|
290
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
188
291
|
|
|
189
292
|
query.queryKey = queryOptions.queryKey;
|
|
190
293
|
|
|
@@ -263,18 +366,18 @@ export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;
|
|
|
263
366
|
/**
|
|
264
367
|
* @summary Create a new Organisational Unit
|
|
265
368
|
*/
|
|
266
|
-
export const useCreateOrganisationUnit = <
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
369
|
+
export const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
370
|
+
options?: {
|
|
371
|
+
mutation?: UseMutationOptions<
|
|
372
|
+
Awaited<ReturnType<typeof createOrganisationUnit>>,
|
|
373
|
+
TError,
|
|
374
|
+
{ orgId: string; data: OrganisationUnitPostBodyBody },
|
|
375
|
+
TContext
|
|
376
|
+
>;
|
|
377
|
+
request?: SecondParameter<typeof customInstance>;
|
|
378
|
+
},
|
|
379
|
+
queryClient?: QueryClient,
|
|
380
|
+
): UseMutationResult<
|
|
278
381
|
Awaited<ReturnType<typeof createOrganisationUnit>>,
|
|
279
382
|
TError,
|
|
280
383
|
{ orgId: string; data: OrganisationUnitPostBodyBody },
|
|
@@ -282,7 +385,7 @@ export const useCreateOrganisationUnit = <
|
|
|
282
385
|
> => {
|
|
283
386
|
const mutationOptions = getCreateOrganisationUnitMutationOptions(options);
|
|
284
387
|
|
|
285
|
-
return useMutation(mutationOptions);
|
|
388
|
+
return useMutation(mutationOptions, queryClient);
|
|
286
389
|
};
|
|
287
390
|
/**
|
|
288
391
|
* 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.
|
|
@@ -307,7 +410,7 @@ export const getGetUnitQueryOptions = <
|
|
|
307
410
|
>(
|
|
308
411
|
unitId: string,
|
|
309
412
|
options?: {
|
|
310
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
413
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
311
414
|
request?: SecondParameter<typeof customInstance>;
|
|
312
415
|
},
|
|
313
416
|
) => {
|
|
@@ -322,12 +425,61 @@ export const getGetUnitQueryOptions = <
|
|
|
322
425
|
Awaited<ReturnType<typeof getUnit>>,
|
|
323
426
|
TError,
|
|
324
427
|
TData
|
|
325
|
-
> & { queryKey: QueryKey };
|
|
428
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
326
429
|
};
|
|
327
430
|
|
|
328
431
|
export type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
|
|
329
432
|
export type GetUnitQueryError = ErrorType<void | AsError>;
|
|
330
433
|
|
|
434
|
+
export function useGetUnit<
|
|
435
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
436
|
+
TError = ErrorType<void | AsError>,
|
|
437
|
+
>(
|
|
438
|
+
unitId: string,
|
|
439
|
+
options: {
|
|
440
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>> &
|
|
441
|
+
Pick<
|
|
442
|
+
DefinedInitialDataOptions<
|
|
443
|
+
Awaited<ReturnType<typeof getUnit>>,
|
|
444
|
+
TError,
|
|
445
|
+
Awaited<ReturnType<typeof getUnit>>
|
|
446
|
+
>,
|
|
447
|
+
"initialData"
|
|
448
|
+
>;
|
|
449
|
+
request?: SecondParameter<typeof customInstance>;
|
|
450
|
+
},
|
|
451
|
+
queryClient?: QueryClient,
|
|
452
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
453
|
+
export function useGetUnit<
|
|
454
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
455
|
+
TError = ErrorType<void | AsError>,
|
|
456
|
+
>(
|
|
457
|
+
unitId: string,
|
|
458
|
+
options?: {
|
|
459
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>> &
|
|
460
|
+
Pick<
|
|
461
|
+
UndefinedInitialDataOptions<
|
|
462
|
+
Awaited<ReturnType<typeof getUnit>>,
|
|
463
|
+
TError,
|
|
464
|
+
Awaited<ReturnType<typeof getUnit>>
|
|
465
|
+
>,
|
|
466
|
+
"initialData"
|
|
467
|
+
>;
|
|
468
|
+
request?: SecondParameter<typeof customInstance>;
|
|
469
|
+
},
|
|
470
|
+
queryClient?: QueryClient,
|
|
471
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
472
|
+
export function useGetUnit<
|
|
473
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
474
|
+
TError = ErrorType<void | AsError>,
|
|
475
|
+
>(
|
|
476
|
+
unitId: string,
|
|
477
|
+
options?: {
|
|
478
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
479
|
+
request?: SecondParameter<typeof customInstance>;
|
|
480
|
+
},
|
|
481
|
+
queryClient?: QueryClient,
|
|
482
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
331
483
|
/**
|
|
332
484
|
* @summary Gets an Organisational Unit
|
|
333
485
|
*/
|
|
@@ -338,13 +490,16 @@ export function useGetUnit<
|
|
|
338
490
|
>(
|
|
339
491
|
unitId: string,
|
|
340
492
|
options?: {
|
|
341
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
493
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
342
494
|
request?: SecondParameter<typeof customInstance>;
|
|
343
495
|
},
|
|
344
|
-
|
|
496
|
+
queryClient?: QueryClient,
|
|
497
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
345
498
|
const queryOptions = getGetUnitQueryOptions(unitId, options);
|
|
346
499
|
|
|
347
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
500
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
501
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
502
|
+
};
|
|
348
503
|
|
|
349
504
|
query.queryKey = queryOptions.queryKey;
|
|
350
505
|
|
|
@@ -370,7 +525,7 @@ export const getGetUnitSuspenseQueryOptions = <
|
|
|
370
525
|
>(
|
|
371
526
|
unitId: string,
|
|
372
527
|
options?: {
|
|
373
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
528
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
374
529
|
request?: SecondParameter<typeof customInstance>;
|
|
375
530
|
},
|
|
376
531
|
) => {
|
|
@@ -385,12 +540,45 @@ export const getGetUnitSuspenseQueryOptions = <
|
|
|
385
540
|
Awaited<ReturnType<typeof getUnit>>,
|
|
386
541
|
TError,
|
|
387
542
|
TData
|
|
388
|
-
> & { queryKey: QueryKey };
|
|
543
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
389
544
|
};
|
|
390
545
|
|
|
391
546
|
export type GetUnitSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>;
|
|
392
547
|
export type GetUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
393
548
|
|
|
549
|
+
export function useGetUnitSuspense<
|
|
550
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
551
|
+
TError = ErrorType<void | AsError>,
|
|
552
|
+
>(
|
|
553
|
+
unitId: string,
|
|
554
|
+
options: {
|
|
555
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
556
|
+
request?: SecondParameter<typeof customInstance>;
|
|
557
|
+
},
|
|
558
|
+
queryClient?: QueryClient,
|
|
559
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
560
|
+
export function useGetUnitSuspense<
|
|
561
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
562
|
+
TError = ErrorType<void | AsError>,
|
|
563
|
+
>(
|
|
564
|
+
unitId: string,
|
|
565
|
+
options?: {
|
|
566
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
567
|
+
request?: SecondParameter<typeof customInstance>;
|
|
568
|
+
},
|
|
569
|
+
queryClient?: QueryClient,
|
|
570
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
571
|
+
export function useGetUnitSuspense<
|
|
572
|
+
TData = Awaited<ReturnType<typeof getUnit>>,
|
|
573
|
+
TError = ErrorType<void | AsError>,
|
|
574
|
+
>(
|
|
575
|
+
unitId: string,
|
|
576
|
+
options?: {
|
|
577
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
578
|
+
request?: SecondParameter<typeof customInstance>;
|
|
579
|
+
},
|
|
580
|
+
queryClient?: QueryClient,
|
|
581
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
394
582
|
/**
|
|
395
583
|
* @summary Gets an Organisational Unit
|
|
396
584
|
*/
|
|
@@ -401,15 +589,17 @@ export function useGetUnitSuspense<
|
|
|
401
589
|
>(
|
|
402
590
|
unitId: string,
|
|
403
591
|
options?: {
|
|
404
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData
|
|
592
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>>;
|
|
405
593
|
request?: SecondParameter<typeof customInstance>;
|
|
406
594
|
},
|
|
407
|
-
|
|
595
|
+
queryClient?: QueryClient,
|
|
596
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
408
597
|
const queryOptions = getGetUnitSuspenseQueryOptions(unitId, options);
|
|
409
598
|
|
|
410
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
411
|
-
|
|
412
|
-
|
|
599
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
600
|
+
TData,
|
|
601
|
+
TError
|
|
602
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
413
603
|
|
|
414
604
|
query.queryKey = queryOptions.queryKey;
|
|
415
605
|
|
|
@@ -482,15 +672,18 @@ export type PatchUnitMutationError = ErrorType<void | AsError>;
|
|
|
482
672
|
/**
|
|
483
673
|
* @summary Adjust an existing Unit
|
|
484
674
|
*/
|
|
485
|
-
export const usePatchUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
675
|
+
export const usePatchUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
676
|
+
options?: {
|
|
677
|
+
mutation?: UseMutationOptions<
|
|
678
|
+
Awaited<ReturnType<typeof patchUnit>>,
|
|
679
|
+
TError,
|
|
680
|
+
{ unitId: string; data: UnitPatchBodyBody },
|
|
681
|
+
TContext
|
|
682
|
+
>;
|
|
683
|
+
request?: SecondParameter<typeof customInstance>;
|
|
684
|
+
},
|
|
685
|
+
queryClient?: QueryClient,
|
|
686
|
+
): UseMutationResult<
|
|
494
687
|
Awaited<ReturnType<typeof patchUnit>>,
|
|
495
688
|
TError,
|
|
496
689
|
{ unitId: string; data: UnitPatchBodyBody },
|
|
@@ -498,7 +691,7 @@ export const usePatchUnit = <TError = ErrorType<void | AsError>, TContext = unkn
|
|
|
498
691
|
> => {
|
|
499
692
|
const mutationOptions = getPatchUnitMutationOptions(options);
|
|
500
693
|
|
|
501
|
-
return useMutation(mutationOptions);
|
|
694
|
+
return useMutation(mutationOptions, queryClient);
|
|
502
695
|
};
|
|
503
696
|
/**
|
|
504
697
|
* Deletes an Organisational Unit you have access to. Units can only be deleted by members of the Unit, its Organisation users or admin users.
|
|
@@ -561,18 +754,18 @@ export type DeleteOrganisationUnitMutationError = ErrorType<void | AsError>;
|
|
|
561
754
|
/**
|
|
562
755
|
* @summary Deletes an Organisational Unit
|
|
563
756
|
*/
|
|
564
|
-
export const useDeleteOrganisationUnit = <
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
757
|
+
export const useDeleteOrganisationUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
758
|
+
options?: {
|
|
759
|
+
mutation?: UseMutationOptions<
|
|
760
|
+
Awaited<ReturnType<typeof deleteOrganisationUnit>>,
|
|
761
|
+
TError,
|
|
762
|
+
{ unitId: string },
|
|
763
|
+
TContext
|
|
764
|
+
>;
|
|
765
|
+
request?: SecondParameter<typeof customInstance>;
|
|
766
|
+
},
|
|
767
|
+
queryClient?: QueryClient,
|
|
768
|
+
): UseMutationResult<
|
|
576
769
|
Awaited<ReturnType<typeof deleteOrganisationUnit>>,
|
|
577
770
|
TError,
|
|
578
771
|
{ unitId: string },
|
|
@@ -580,7 +773,7 @@ export const useDeleteOrganisationUnit = <
|
|
|
580
773
|
> => {
|
|
581
774
|
const mutationOptions = getDeleteOrganisationUnitMutationOptions(options);
|
|
582
775
|
|
|
583
|
-
return useMutation(mutationOptions);
|
|
776
|
+
return useMutation(mutationOptions, queryClient);
|
|
584
777
|
};
|
|
585
778
|
/**
|
|
586
779
|
* @summary Gets your Personal Unit (if you have one)
|
|
@@ -600,7 +793,7 @@ export const getGetPersonalUnitQueryOptions = <
|
|
|
600
793
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
601
794
|
TError = ErrorType<void | AsError>,
|
|
602
795
|
>(options?: {
|
|
603
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData
|
|
796
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>>;
|
|
604
797
|
request?: SecondParameter<typeof customInstance>;
|
|
605
798
|
}) => {
|
|
606
799
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -614,12 +807,58 @@ export const getGetPersonalUnitQueryOptions = <
|
|
|
614
807
|
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
615
808
|
TError,
|
|
616
809
|
TData
|
|
617
|
-
> & { queryKey: QueryKey };
|
|
810
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
618
811
|
};
|
|
619
812
|
|
|
620
813
|
export type GetPersonalUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getPersonalUnit>>>;
|
|
621
814
|
export type GetPersonalUnitQueryError = ErrorType<void | AsError>;
|
|
622
815
|
|
|
816
|
+
export function useGetPersonalUnit<
|
|
817
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
818
|
+
TError = ErrorType<void | AsError>,
|
|
819
|
+
>(
|
|
820
|
+
options: {
|
|
821
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>> &
|
|
822
|
+
Pick<
|
|
823
|
+
DefinedInitialDataOptions<
|
|
824
|
+
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
825
|
+
TError,
|
|
826
|
+
Awaited<ReturnType<typeof getPersonalUnit>>
|
|
827
|
+
>,
|
|
828
|
+
"initialData"
|
|
829
|
+
>;
|
|
830
|
+
request?: SecondParameter<typeof customInstance>;
|
|
831
|
+
},
|
|
832
|
+
queryClient?: QueryClient,
|
|
833
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
834
|
+
export function useGetPersonalUnit<
|
|
835
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
836
|
+
TError = ErrorType<void | AsError>,
|
|
837
|
+
>(
|
|
838
|
+
options?: {
|
|
839
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>> &
|
|
840
|
+
Pick<
|
|
841
|
+
UndefinedInitialDataOptions<
|
|
842
|
+
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
843
|
+
TError,
|
|
844
|
+
Awaited<ReturnType<typeof getPersonalUnit>>
|
|
845
|
+
>,
|
|
846
|
+
"initialData"
|
|
847
|
+
>;
|
|
848
|
+
request?: SecondParameter<typeof customInstance>;
|
|
849
|
+
},
|
|
850
|
+
queryClient?: QueryClient,
|
|
851
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
852
|
+
export function useGetPersonalUnit<
|
|
853
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
854
|
+
TError = ErrorType<void | AsError>,
|
|
855
|
+
>(
|
|
856
|
+
options?: {
|
|
857
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>>;
|
|
858
|
+
request?: SecondParameter<typeof customInstance>;
|
|
859
|
+
},
|
|
860
|
+
queryClient?: QueryClient,
|
|
861
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
623
862
|
/**
|
|
624
863
|
* @summary Gets your Personal Unit (if you have one)
|
|
625
864
|
*/
|
|
@@ -627,13 +866,18 @@ export type GetPersonalUnitQueryError = ErrorType<void | AsError>;
|
|
|
627
866
|
export function useGetPersonalUnit<
|
|
628
867
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
629
868
|
TError = ErrorType<void | AsError>,
|
|
630
|
-
>(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
869
|
+
>(
|
|
870
|
+
options?: {
|
|
871
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>>;
|
|
872
|
+
request?: SecondParameter<typeof customInstance>;
|
|
873
|
+
},
|
|
874
|
+
queryClient?: QueryClient,
|
|
875
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
634
876
|
const queryOptions = getGetPersonalUnitQueryOptions(options);
|
|
635
877
|
|
|
636
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
878
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
879
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
880
|
+
};
|
|
637
881
|
|
|
638
882
|
query.queryKey = queryOptions.queryKey;
|
|
639
883
|
|
|
@@ -656,7 +900,9 @@ export const getGetPersonalUnitSuspenseQueryOptions = <
|
|
|
656
900
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
657
901
|
TError = ErrorType<void | AsError>,
|
|
658
902
|
>(options?: {
|
|
659
|
-
query?:
|
|
903
|
+
query?: Partial<
|
|
904
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
905
|
+
>;
|
|
660
906
|
request?: SecondParameter<typeof customInstance>;
|
|
661
907
|
}) => {
|
|
662
908
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -670,7 +916,7 @@ export const getGetPersonalUnitSuspenseQueryOptions = <
|
|
|
670
916
|
Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
671
917
|
TError,
|
|
672
918
|
TData
|
|
673
|
-
> & { queryKey: QueryKey };
|
|
919
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
674
920
|
};
|
|
675
921
|
|
|
676
922
|
export type GetPersonalUnitSuspenseQueryResult = NonNullable<
|
|
@@ -678,6 +924,42 @@ export type GetPersonalUnitSuspenseQueryResult = NonNullable<
|
|
|
678
924
|
>;
|
|
679
925
|
export type GetPersonalUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
680
926
|
|
|
927
|
+
export function useGetPersonalUnitSuspense<
|
|
928
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
929
|
+
TError = ErrorType<void | AsError>,
|
|
930
|
+
>(
|
|
931
|
+
options: {
|
|
932
|
+
query: Partial<
|
|
933
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
934
|
+
>;
|
|
935
|
+
request?: SecondParameter<typeof customInstance>;
|
|
936
|
+
},
|
|
937
|
+
queryClient?: QueryClient,
|
|
938
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
939
|
+
export function useGetPersonalUnitSuspense<
|
|
940
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
941
|
+
TError = ErrorType<void | AsError>,
|
|
942
|
+
>(
|
|
943
|
+
options?: {
|
|
944
|
+
query?: Partial<
|
|
945
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
946
|
+
>;
|
|
947
|
+
request?: SecondParameter<typeof customInstance>;
|
|
948
|
+
},
|
|
949
|
+
queryClient?: QueryClient,
|
|
950
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
951
|
+
export function useGetPersonalUnitSuspense<
|
|
952
|
+
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
953
|
+
TError = ErrorType<void | AsError>,
|
|
954
|
+
>(
|
|
955
|
+
options?: {
|
|
956
|
+
query?: Partial<
|
|
957
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
958
|
+
>;
|
|
959
|
+
request?: SecondParameter<typeof customInstance>;
|
|
960
|
+
},
|
|
961
|
+
queryClient?: QueryClient,
|
|
962
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
681
963
|
/**
|
|
682
964
|
* @summary Gets your Personal Unit (if you have one)
|
|
683
965
|
*/
|
|
@@ -685,15 +967,21 @@ export type GetPersonalUnitSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
685
967
|
export function useGetPersonalUnitSuspense<
|
|
686
968
|
TData = Awaited<ReturnType<typeof getPersonalUnit>>,
|
|
687
969
|
TError = ErrorType<void | AsError>,
|
|
688
|
-
>(
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
970
|
+
>(
|
|
971
|
+
options?: {
|
|
972
|
+
query?: Partial<
|
|
973
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getPersonalUnit>>, TError, TData>
|
|
974
|
+
>;
|
|
975
|
+
request?: SecondParameter<typeof customInstance>;
|
|
976
|
+
},
|
|
977
|
+
queryClient?: QueryClient,
|
|
978
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
692
979
|
const queryOptions = getGetPersonalUnitSuspenseQueryOptions(options);
|
|
693
980
|
|
|
694
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
695
|
-
|
|
696
|
-
|
|
981
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
982
|
+
TData,
|
|
983
|
+
TError
|
|
984
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
697
985
|
|
|
698
986
|
query.queryKey = queryOptions.queryKey;
|
|
699
987
|
|
|
@@ -767,18 +1055,18 @@ export type CreatePersonalUnitMutationError = ErrorType<AsError | void>;
|
|
|
767
1055
|
/**
|
|
768
1056
|
* @summary Create a new Personal Unit
|
|
769
1057
|
*/
|
|
770
|
-
export const useCreatePersonalUnit = <
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
1058
|
+
export const useCreatePersonalUnit = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1059
|
+
options?: {
|
|
1060
|
+
mutation?: UseMutationOptions<
|
|
1061
|
+
Awaited<ReturnType<typeof createPersonalUnit>>,
|
|
1062
|
+
TError,
|
|
1063
|
+
{ data: PersonalUnitPutBodyBody },
|
|
1064
|
+
TContext
|
|
1065
|
+
>;
|
|
1066
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1067
|
+
},
|
|
1068
|
+
queryClient?: QueryClient,
|
|
1069
|
+
): UseMutationResult<
|
|
782
1070
|
Awaited<ReturnType<typeof createPersonalUnit>>,
|
|
783
1071
|
TError,
|
|
784
1072
|
{ data: PersonalUnitPutBodyBody },
|
|
@@ -786,7 +1074,7 @@ export const useCreatePersonalUnit = <
|
|
|
786
1074
|
> => {
|
|
787
1075
|
const mutationOptions = getCreatePersonalUnitMutationOptions(options);
|
|
788
1076
|
|
|
789
|
-
return useMutation(mutationOptions);
|
|
1077
|
+
return useMutation(mutationOptions, queryClient);
|
|
790
1078
|
};
|
|
791
1079
|
/**
|
|
792
1080
|
* Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**
|
|
@@ -832,21 +1120,21 @@ export type DeletePersonalUnitMutationError = ErrorType<void | AsError>;
|
|
|
832
1120
|
/**
|
|
833
1121
|
* @summary Deletes a Personal Unit
|
|
834
1122
|
*/
|
|
835
|
-
export const useDeletePersonalUnit = <
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
1123
|
+
export const useDeletePersonalUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
1124
|
+
options?: {
|
|
1125
|
+
mutation?: UseMutationOptions<
|
|
1126
|
+
Awaited<ReturnType<typeof deletePersonalUnit>>,
|
|
1127
|
+
TError,
|
|
1128
|
+
void,
|
|
1129
|
+
TContext
|
|
1130
|
+
>;
|
|
1131
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1132
|
+
},
|
|
1133
|
+
queryClient?: QueryClient,
|
|
1134
|
+
): UseMutationResult<Awaited<ReturnType<typeof deletePersonalUnit>>, TError, void, TContext> => {
|
|
847
1135
|
const mutationOptions = getDeletePersonalUnitMutationOptions(options);
|
|
848
1136
|
|
|
849
|
-
return useMutation(mutationOptions);
|
|
1137
|
+
return useMutation(mutationOptions, queryClient);
|
|
850
1138
|
};
|
|
851
1139
|
/**
|
|
852
1140
|
* Gets all the Units that you are a member of, or a specific Unit by name.
|
|
@@ -873,7 +1161,7 @@ export const getGetUnitsQueryOptions = <
|
|
|
873
1161
|
>(
|
|
874
1162
|
params?: GetUnitsParams,
|
|
875
1163
|
options?: {
|
|
876
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1164
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
877
1165
|
request?: SecondParameter<typeof customInstance>;
|
|
878
1166
|
},
|
|
879
1167
|
) => {
|
|
@@ -888,12 +1176,61 @@ export const getGetUnitsQueryOptions = <
|
|
|
888
1176
|
Awaited<ReturnType<typeof getUnits>>,
|
|
889
1177
|
TError,
|
|
890
1178
|
TData
|
|
891
|
-
> & { queryKey: QueryKey };
|
|
1179
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
892
1180
|
};
|
|
893
1181
|
|
|
894
1182
|
export type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>;
|
|
895
1183
|
export type GetUnitsQueryError = ErrorType<void | AsError>;
|
|
896
1184
|
|
|
1185
|
+
export function useGetUnits<
|
|
1186
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1187
|
+
TError = ErrorType<void | AsError>,
|
|
1188
|
+
>(
|
|
1189
|
+
params: undefined | GetUnitsParams,
|
|
1190
|
+
options: {
|
|
1191
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>> &
|
|
1192
|
+
Pick<
|
|
1193
|
+
DefinedInitialDataOptions<
|
|
1194
|
+
Awaited<ReturnType<typeof getUnits>>,
|
|
1195
|
+
TError,
|
|
1196
|
+
Awaited<ReturnType<typeof getUnits>>
|
|
1197
|
+
>,
|
|
1198
|
+
"initialData"
|
|
1199
|
+
>;
|
|
1200
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1201
|
+
},
|
|
1202
|
+
queryClient?: QueryClient,
|
|
1203
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1204
|
+
export function useGetUnits<
|
|
1205
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1206
|
+
TError = ErrorType<void | AsError>,
|
|
1207
|
+
>(
|
|
1208
|
+
params?: GetUnitsParams,
|
|
1209
|
+
options?: {
|
|
1210
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>> &
|
|
1211
|
+
Pick<
|
|
1212
|
+
UndefinedInitialDataOptions<
|
|
1213
|
+
Awaited<ReturnType<typeof getUnits>>,
|
|
1214
|
+
TError,
|
|
1215
|
+
Awaited<ReturnType<typeof getUnits>>
|
|
1216
|
+
>,
|
|
1217
|
+
"initialData"
|
|
1218
|
+
>;
|
|
1219
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1220
|
+
},
|
|
1221
|
+
queryClient?: QueryClient,
|
|
1222
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1223
|
+
export function useGetUnits<
|
|
1224
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1225
|
+
TError = ErrorType<void | AsError>,
|
|
1226
|
+
>(
|
|
1227
|
+
params?: GetUnitsParams,
|
|
1228
|
+
options?: {
|
|
1229
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1230
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1231
|
+
},
|
|
1232
|
+
queryClient?: QueryClient,
|
|
1233
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
897
1234
|
/**
|
|
898
1235
|
* @summary Gets Units
|
|
899
1236
|
*/
|
|
@@ -904,13 +1241,16 @@ export function useGetUnits<
|
|
|
904
1241
|
>(
|
|
905
1242
|
params?: GetUnitsParams,
|
|
906
1243
|
options?: {
|
|
907
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1244
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
908
1245
|
request?: SecondParameter<typeof customInstance>;
|
|
909
1246
|
},
|
|
910
|
-
|
|
1247
|
+
queryClient?: QueryClient,
|
|
1248
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
911
1249
|
const queryOptions = getGetUnitsQueryOptions(params, options);
|
|
912
1250
|
|
|
913
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
1251
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1252
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
1253
|
+
};
|
|
914
1254
|
|
|
915
1255
|
query.queryKey = queryOptions.queryKey;
|
|
916
1256
|
|
|
@@ -936,7 +1276,7 @@ export const getGetUnitsSuspenseQueryOptions = <
|
|
|
936
1276
|
>(
|
|
937
1277
|
params?: GetUnitsParams,
|
|
938
1278
|
options?: {
|
|
939
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1279
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
940
1280
|
request?: SecondParameter<typeof customInstance>;
|
|
941
1281
|
},
|
|
942
1282
|
) => {
|
|
@@ -951,12 +1291,45 @@ export const getGetUnitsSuspenseQueryOptions = <
|
|
|
951
1291
|
Awaited<ReturnType<typeof getUnits>>,
|
|
952
1292
|
TError,
|
|
953
1293
|
TData
|
|
954
|
-
> & { queryKey: QueryKey };
|
|
1294
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
955
1295
|
};
|
|
956
1296
|
|
|
957
1297
|
export type GetUnitsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>;
|
|
958
1298
|
export type GetUnitsSuspenseQueryError = ErrorType<void | AsError>;
|
|
959
1299
|
|
|
1300
|
+
export function useGetUnitsSuspense<
|
|
1301
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1302
|
+
TError = ErrorType<void | AsError>,
|
|
1303
|
+
>(
|
|
1304
|
+
params: undefined | GetUnitsParams,
|
|
1305
|
+
options: {
|
|
1306
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1307
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1308
|
+
},
|
|
1309
|
+
queryClient?: QueryClient,
|
|
1310
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1311
|
+
export function useGetUnitsSuspense<
|
|
1312
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1313
|
+
TError = ErrorType<void | AsError>,
|
|
1314
|
+
>(
|
|
1315
|
+
params?: GetUnitsParams,
|
|
1316
|
+
options?: {
|
|
1317
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1318
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1319
|
+
},
|
|
1320
|
+
queryClient?: QueryClient,
|
|
1321
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1322
|
+
export function useGetUnitsSuspense<
|
|
1323
|
+
TData = Awaited<ReturnType<typeof getUnits>>,
|
|
1324
|
+
TError = ErrorType<void | AsError>,
|
|
1325
|
+
>(
|
|
1326
|
+
params?: GetUnitsParams,
|
|
1327
|
+
options?: {
|
|
1328
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
1329
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1330
|
+
},
|
|
1331
|
+
queryClient?: QueryClient,
|
|
1332
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
960
1333
|
/**
|
|
961
1334
|
* @summary Gets Units
|
|
962
1335
|
*/
|
|
@@ -967,15 +1340,17 @@ export function useGetUnitsSuspense<
|
|
|
967
1340
|
>(
|
|
968
1341
|
params?: GetUnitsParams,
|
|
969
1342
|
options?: {
|
|
970
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData
|
|
1343
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>>;
|
|
971
1344
|
request?: SecondParameter<typeof customInstance>;
|
|
972
1345
|
},
|
|
973
|
-
|
|
1346
|
+
queryClient?: QueryClient,
|
|
1347
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
974
1348
|
const queryOptions = getGetUnitsSuspenseQueryOptions(params, options);
|
|
975
1349
|
|
|
976
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
977
|
-
|
|
978
|
-
|
|
1350
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1351
|
+
TData,
|
|
1352
|
+
TError
|
|
1353
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
979
1354
|
|
|
980
1355
|
query.queryKey = queryOptions.queryKey;
|
|
981
1356
|
|
|
@@ -1051,18 +1426,18 @@ export type CreateDefaultUnitMutationError = ErrorType<AsError | void>;
|
|
|
1051
1426
|
/**
|
|
1052
1427
|
* @summary Create a new Personal Unit
|
|
1053
1428
|
*/
|
|
1054
|
-
export const useCreateDefaultUnit = <
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1429
|
+
export const useCreateDefaultUnit = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
1430
|
+
options?: {
|
|
1431
|
+
mutation?: UseMutationOptions<
|
|
1432
|
+
Awaited<ReturnType<typeof createDefaultUnit>>,
|
|
1433
|
+
TError,
|
|
1434
|
+
{ data: PersonalUnitPutBodyBody },
|
|
1435
|
+
TContext
|
|
1436
|
+
>;
|
|
1437
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1438
|
+
},
|
|
1439
|
+
queryClient?: QueryClient,
|
|
1440
|
+
): UseMutationResult<
|
|
1066
1441
|
Awaited<ReturnType<typeof createDefaultUnit>>,
|
|
1067
1442
|
TError,
|
|
1068
1443
|
{ data: PersonalUnitPutBodyBody },
|
|
@@ -1070,7 +1445,7 @@ export const useCreateDefaultUnit = <
|
|
|
1070
1445
|
> => {
|
|
1071
1446
|
const mutationOptions = getCreateDefaultUnitMutationOptions(options);
|
|
1072
1447
|
|
|
1073
|
-
return useMutation(mutationOptions);
|
|
1448
|
+
return useMutation(mutationOptions, queryClient);
|
|
1074
1449
|
};
|
|
1075
1450
|
/**
|
|
1076
1451
|
* Deletes a Personal Unit. The Unit is *your* Unit, and belongs to the **Default Organisation**
|
|
@@ -1118,19 +1493,19 @@ export type DeleteDefaultUnitMutationError = ErrorType<void | AsError>;
|
|
|
1118
1493
|
/**
|
|
1119
1494
|
* @summary Deletes a Personal Unit
|
|
1120
1495
|
*/
|
|
1121
|
-
export const useDeleteDefaultUnit = <
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1496
|
+
export const useDeleteDefaultUnit = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
1497
|
+
options?: {
|
|
1498
|
+
mutation?: UseMutationOptions<
|
|
1499
|
+
Awaited<ReturnType<typeof deleteDefaultUnit>>,
|
|
1500
|
+
TError,
|
|
1501
|
+
void,
|
|
1502
|
+
TContext
|
|
1503
|
+
>;
|
|
1504
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1505
|
+
},
|
|
1506
|
+
queryClient?: QueryClient,
|
|
1507
|
+
): UseMutationResult<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, void, TContext> => {
|
|
1133
1508
|
const mutationOptions = getDeleteDefaultUnitMutationOptions(options);
|
|
1134
1509
|
|
|
1135
|
-
return useMutation(mutationOptions);
|
|
1510
|
+
return useMutation(mutationOptions, queryClient);
|
|
1136
1511
|
};
|