@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,10 +10,14 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
13
|
+
DataTag,
|
|
14
|
+
DefinedInitialDataOptions,
|
|
15
|
+
DefinedUseQueryResult,
|
|
13
16
|
InvalidateOptions,
|
|
14
17
|
QueryClient,
|
|
15
18
|
QueryFunction,
|
|
16
19
|
QueryKey,
|
|
20
|
+
UndefinedInitialDataOptions,
|
|
17
21
|
UseQueryOptions,
|
|
18
22
|
UseQueryResult,
|
|
19
23
|
UseSuspenseQueryOptions,
|
|
@@ -65,7 +69,7 @@ export const getGetChargesQueryOptions = <
|
|
|
65
69
|
>(
|
|
66
70
|
params?: GetChargesParams,
|
|
67
71
|
options?: {
|
|
68
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
72
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
69
73
|
request?: SecondParameter<typeof customInstance>;
|
|
70
74
|
},
|
|
71
75
|
) => {
|
|
@@ -80,12 +84,61 @@ export const getGetChargesQueryOptions = <
|
|
|
80
84
|
Awaited<ReturnType<typeof getCharges>>,
|
|
81
85
|
TError,
|
|
82
86
|
TData
|
|
83
|
-
> & { queryKey: QueryKey };
|
|
87
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
84
88
|
};
|
|
85
89
|
|
|
86
90
|
export type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;
|
|
87
91
|
export type GetChargesQueryError = ErrorType<void | AsError>;
|
|
88
92
|
|
|
93
|
+
export function useGetCharges<
|
|
94
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
95
|
+
TError = ErrorType<void | AsError>,
|
|
96
|
+
>(
|
|
97
|
+
params: undefined | GetChargesParams,
|
|
98
|
+
options: {
|
|
99
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &
|
|
100
|
+
Pick<
|
|
101
|
+
DefinedInitialDataOptions<
|
|
102
|
+
Awaited<ReturnType<typeof getCharges>>,
|
|
103
|
+
TError,
|
|
104
|
+
Awaited<ReturnType<typeof getCharges>>
|
|
105
|
+
>,
|
|
106
|
+
"initialData"
|
|
107
|
+
>;
|
|
108
|
+
request?: SecondParameter<typeof customInstance>;
|
|
109
|
+
},
|
|
110
|
+
queryClient?: QueryClient,
|
|
111
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
112
|
+
export function useGetCharges<
|
|
113
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
114
|
+
TError = ErrorType<void | AsError>,
|
|
115
|
+
>(
|
|
116
|
+
params?: GetChargesParams,
|
|
117
|
+
options?: {
|
|
118
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &
|
|
119
|
+
Pick<
|
|
120
|
+
UndefinedInitialDataOptions<
|
|
121
|
+
Awaited<ReturnType<typeof getCharges>>,
|
|
122
|
+
TError,
|
|
123
|
+
Awaited<ReturnType<typeof getCharges>>
|
|
124
|
+
>,
|
|
125
|
+
"initialData"
|
|
126
|
+
>;
|
|
127
|
+
request?: SecondParameter<typeof customInstance>;
|
|
128
|
+
},
|
|
129
|
+
queryClient?: QueryClient,
|
|
130
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
131
|
+
export function useGetCharges<
|
|
132
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
133
|
+
TError = ErrorType<void | AsError>,
|
|
134
|
+
>(
|
|
135
|
+
params?: GetChargesParams,
|
|
136
|
+
options?: {
|
|
137
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
138
|
+
request?: SecondParameter<typeof customInstance>;
|
|
139
|
+
},
|
|
140
|
+
queryClient?: QueryClient,
|
|
141
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
89
142
|
/**
|
|
90
143
|
* @summary Gets charges for all Organisations
|
|
91
144
|
*/
|
|
@@ -96,13 +149,16 @@ export function useGetCharges<
|
|
|
96
149
|
>(
|
|
97
150
|
params?: GetChargesParams,
|
|
98
151
|
options?: {
|
|
99
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
152
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
100
153
|
request?: SecondParameter<typeof customInstance>;
|
|
101
154
|
},
|
|
102
|
-
|
|
155
|
+
queryClient?: QueryClient,
|
|
156
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
103
157
|
const queryOptions = getGetChargesQueryOptions(params, options);
|
|
104
158
|
|
|
105
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
159
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
160
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
161
|
+
};
|
|
106
162
|
|
|
107
163
|
query.queryKey = queryOptions.queryKey;
|
|
108
164
|
|
|
@@ -128,7 +184,7 @@ export const getGetChargesSuspenseQueryOptions = <
|
|
|
128
184
|
>(
|
|
129
185
|
params?: GetChargesParams,
|
|
130
186
|
options?: {
|
|
131
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
187
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
132
188
|
request?: SecondParameter<typeof customInstance>;
|
|
133
189
|
},
|
|
134
190
|
) => {
|
|
@@ -143,12 +199,45 @@ export const getGetChargesSuspenseQueryOptions = <
|
|
|
143
199
|
Awaited<ReturnType<typeof getCharges>>,
|
|
144
200
|
TError,
|
|
145
201
|
TData
|
|
146
|
-
> & { queryKey: QueryKey };
|
|
202
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
147
203
|
};
|
|
148
204
|
|
|
149
205
|
export type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;
|
|
150
206
|
export type GetChargesSuspenseQueryError = ErrorType<void | AsError>;
|
|
151
207
|
|
|
208
|
+
export function useGetChargesSuspense<
|
|
209
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
210
|
+
TError = ErrorType<void | AsError>,
|
|
211
|
+
>(
|
|
212
|
+
params: undefined | GetChargesParams,
|
|
213
|
+
options: {
|
|
214
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
215
|
+
request?: SecondParameter<typeof customInstance>;
|
|
216
|
+
},
|
|
217
|
+
queryClient?: QueryClient,
|
|
218
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
219
|
+
export function useGetChargesSuspense<
|
|
220
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
221
|
+
TError = ErrorType<void | AsError>,
|
|
222
|
+
>(
|
|
223
|
+
params?: GetChargesParams,
|
|
224
|
+
options?: {
|
|
225
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
226
|
+
request?: SecondParameter<typeof customInstance>;
|
|
227
|
+
},
|
|
228
|
+
queryClient?: QueryClient,
|
|
229
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
230
|
+
export function useGetChargesSuspense<
|
|
231
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
232
|
+
TError = ErrorType<void | AsError>,
|
|
233
|
+
>(
|
|
234
|
+
params?: GetChargesParams,
|
|
235
|
+
options?: {
|
|
236
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
237
|
+
request?: SecondParameter<typeof customInstance>;
|
|
238
|
+
},
|
|
239
|
+
queryClient?: QueryClient,
|
|
240
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
152
241
|
/**
|
|
153
242
|
* @summary Gets charges for all Organisations
|
|
154
243
|
*/
|
|
@@ -159,15 +248,17 @@ export function useGetChargesSuspense<
|
|
|
159
248
|
>(
|
|
160
249
|
params?: GetChargesParams,
|
|
161
250
|
options?: {
|
|
162
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
251
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
163
252
|
request?: SecondParameter<typeof customInstance>;
|
|
164
253
|
},
|
|
165
|
-
|
|
254
|
+
queryClient?: QueryClient,
|
|
255
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
166
256
|
const queryOptions = getGetChargesSuspenseQueryOptions(params, options);
|
|
167
257
|
|
|
168
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
169
|
-
|
|
170
|
-
|
|
258
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
259
|
+
TData,
|
|
260
|
+
TError
|
|
261
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
171
262
|
|
|
172
263
|
query.queryKey = queryOptions.queryKey;
|
|
173
264
|
|
|
@@ -207,7 +298,9 @@ export const getGetOrganisationChargesQueryOptions = <
|
|
|
207
298
|
orgId: string,
|
|
208
299
|
params?: GetOrganisationChargesParams,
|
|
209
300
|
options?: {
|
|
210
|
-
query?:
|
|
301
|
+
query?: Partial<
|
|
302
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
303
|
+
>;
|
|
211
304
|
request?: SecondParameter<typeof customInstance>;
|
|
212
305
|
},
|
|
213
306
|
) => {
|
|
@@ -222,7 +315,7 @@ export const getGetOrganisationChargesQueryOptions = <
|
|
|
222
315
|
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
223
316
|
TError,
|
|
224
317
|
TData
|
|
225
|
-
> & { queryKey: QueryKey };
|
|
318
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
226
319
|
};
|
|
227
320
|
|
|
228
321
|
export type GetOrganisationChargesQueryResult = NonNullable<
|
|
@@ -230,6 +323,64 @@ export type GetOrganisationChargesQueryResult = NonNullable<
|
|
|
230
323
|
>;
|
|
231
324
|
export type GetOrganisationChargesQueryError = ErrorType<void | AsError>;
|
|
232
325
|
|
|
326
|
+
export function useGetOrganisationCharges<
|
|
327
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
328
|
+
TError = ErrorType<void | AsError>,
|
|
329
|
+
>(
|
|
330
|
+
orgId: string,
|
|
331
|
+
params: undefined | GetOrganisationChargesParams,
|
|
332
|
+
options: {
|
|
333
|
+
query: Partial<
|
|
334
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
335
|
+
> &
|
|
336
|
+
Pick<
|
|
337
|
+
DefinedInitialDataOptions<
|
|
338
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
339
|
+
TError,
|
|
340
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
341
|
+
>,
|
|
342
|
+
"initialData"
|
|
343
|
+
>;
|
|
344
|
+
request?: SecondParameter<typeof customInstance>;
|
|
345
|
+
},
|
|
346
|
+
queryClient?: QueryClient,
|
|
347
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
348
|
+
export function useGetOrganisationCharges<
|
|
349
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
350
|
+
TError = ErrorType<void | AsError>,
|
|
351
|
+
>(
|
|
352
|
+
orgId: string,
|
|
353
|
+
params?: GetOrganisationChargesParams,
|
|
354
|
+
options?: {
|
|
355
|
+
query?: Partial<
|
|
356
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
357
|
+
> &
|
|
358
|
+
Pick<
|
|
359
|
+
UndefinedInitialDataOptions<
|
|
360
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
361
|
+
TError,
|
|
362
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
363
|
+
>,
|
|
364
|
+
"initialData"
|
|
365
|
+
>;
|
|
366
|
+
request?: SecondParameter<typeof customInstance>;
|
|
367
|
+
},
|
|
368
|
+
queryClient?: QueryClient,
|
|
369
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
370
|
+
export function useGetOrganisationCharges<
|
|
371
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
372
|
+
TError = ErrorType<void | AsError>,
|
|
373
|
+
>(
|
|
374
|
+
orgId: string,
|
|
375
|
+
params?: GetOrganisationChargesParams,
|
|
376
|
+
options?: {
|
|
377
|
+
query?: Partial<
|
|
378
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
379
|
+
>;
|
|
380
|
+
request?: SecondParameter<typeof customInstance>;
|
|
381
|
+
},
|
|
382
|
+
queryClient?: QueryClient,
|
|
383
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
233
384
|
/**
|
|
234
385
|
* @summary Gets charges for all Units in an Organisation
|
|
235
386
|
*/
|
|
@@ -241,13 +392,18 @@ export function useGetOrganisationCharges<
|
|
|
241
392
|
orgId: string,
|
|
242
393
|
params?: GetOrganisationChargesParams,
|
|
243
394
|
options?: {
|
|
244
|
-
query?:
|
|
395
|
+
query?: Partial<
|
|
396
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
397
|
+
>;
|
|
245
398
|
request?: SecondParameter<typeof customInstance>;
|
|
246
399
|
},
|
|
247
|
-
|
|
400
|
+
queryClient?: QueryClient,
|
|
401
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
248
402
|
const queryOptions = getGetOrganisationChargesQueryOptions(orgId, params, options);
|
|
249
403
|
|
|
250
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
404
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
405
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
406
|
+
};
|
|
251
407
|
|
|
252
408
|
query.queryKey = queryOptions.queryKey;
|
|
253
409
|
|
|
@@ -278,10 +434,8 @@ export const getGetOrganisationChargesSuspenseQueryOptions = <
|
|
|
278
434
|
orgId: string,
|
|
279
435
|
params?: GetOrganisationChargesParams,
|
|
280
436
|
options?: {
|
|
281
|
-
query?:
|
|
282
|
-
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
283
|
-
TError,
|
|
284
|
-
TData
|
|
437
|
+
query?: Partial<
|
|
438
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
285
439
|
>;
|
|
286
440
|
request?: SecondParameter<typeof customInstance>;
|
|
287
441
|
},
|
|
@@ -297,7 +451,7 @@ export const getGetOrganisationChargesSuspenseQueryOptions = <
|
|
|
297
451
|
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
298
452
|
TError,
|
|
299
453
|
TData
|
|
300
|
-
> & { queryKey: QueryKey };
|
|
454
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
301
455
|
};
|
|
302
456
|
|
|
303
457
|
export type GetOrganisationChargesSuspenseQueryResult = NonNullable<
|
|
@@ -305,6 +459,48 @@ export type GetOrganisationChargesSuspenseQueryResult = NonNullable<
|
|
|
305
459
|
>;
|
|
306
460
|
export type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;
|
|
307
461
|
|
|
462
|
+
export function useGetOrganisationChargesSuspense<
|
|
463
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
464
|
+
TError = ErrorType<void | AsError>,
|
|
465
|
+
>(
|
|
466
|
+
orgId: string,
|
|
467
|
+
params: undefined | GetOrganisationChargesParams,
|
|
468
|
+
options: {
|
|
469
|
+
query: Partial<
|
|
470
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
471
|
+
>;
|
|
472
|
+
request?: SecondParameter<typeof customInstance>;
|
|
473
|
+
},
|
|
474
|
+
queryClient?: QueryClient,
|
|
475
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
476
|
+
export function useGetOrganisationChargesSuspense<
|
|
477
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
478
|
+
TError = ErrorType<void | AsError>,
|
|
479
|
+
>(
|
|
480
|
+
orgId: string,
|
|
481
|
+
params?: GetOrganisationChargesParams,
|
|
482
|
+
options?: {
|
|
483
|
+
query?: Partial<
|
|
484
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
485
|
+
>;
|
|
486
|
+
request?: SecondParameter<typeof customInstance>;
|
|
487
|
+
},
|
|
488
|
+
queryClient?: QueryClient,
|
|
489
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
490
|
+
export function useGetOrganisationChargesSuspense<
|
|
491
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
492
|
+
TError = ErrorType<void | AsError>,
|
|
493
|
+
>(
|
|
494
|
+
orgId: string,
|
|
495
|
+
params?: GetOrganisationChargesParams,
|
|
496
|
+
options?: {
|
|
497
|
+
query?: Partial<
|
|
498
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
499
|
+
>;
|
|
500
|
+
request?: SecondParameter<typeof customInstance>;
|
|
501
|
+
},
|
|
502
|
+
queryClient?: QueryClient,
|
|
503
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
308
504
|
/**
|
|
309
505
|
* @summary Gets charges for all Units in an Organisation
|
|
310
506
|
*/
|
|
@@ -316,19 +512,19 @@ export function useGetOrganisationChargesSuspense<
|
|
|
316
512
|
orgId: string,
|
|
317
513
|
params?: GetOrganisationChargesParams,
|
|
318
514
|
options?: {
|
|
319
|
-
query?:
|
|
320
|
-
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
321
|
-
TError,
|
|
322
|
-
TData
|
|
515
|
+
query?: Partial<
|
|
516
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
323
517
|
>;
|
|
324
518
|
request?: SecondParameter<typeof customInstance>;
|
|
325
519
|
},
|
|
326
|
-
|
|
520
|
+
queryClient?: QueryClient,
|
|
521
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
327
522
|
const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
|
|
328
523
|
|
|
329
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
330
|
-
|
|
331
|
-
|
|
524
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
525
|
+
TData,
|
|
526
|
+
TError
|
|
527
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
332
528
|
|
|
333
529
|
query.queryKey = queryOptions.queryKey;
|
|
334
530
|
|
|
@@ -371,7 +567,7 @@ export const getGetProductChargesQueryOptions = <
|
|
|
371
567
|
productId: string,
|
|
372
568
|
params?: GetProductChargesParams,
|
|
373
569
|
options?: {
|
|
374
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData
|
|
570
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
375
571
|
request?: SecondParameter<typeof customInstance>;
|
|
376
572
|
},
|
|
377
573
|
) => {
|
|
@@ -386,7 +582,7 @@ export const getGetProductChargesQueryOptions = <
|
|
|
386
582
|
Awaited<ReturnType<typeof getProductCharges>>,
|
|
387
583
|
TError,
|
|
388
584
|
TData
|
|
389
|
-
> & { queryKey: QueryKey };
|
|
585
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
390
586
|
};
|
|
391
587
|
|
|
392
588
|
export type GetProductChargesQueryResult = NonNullable<
|
|
@@ -394,6 +590,58 @@ export type GetProductChargesQueryResult = NonNullable<
|
|
|
394
590
|
>;
|
|
395
591
|
export type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
396
592
|
|
|
593
|
+
export function useGetProductCharges<
|
|
594
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
595
|
+
TError = ErrorType<AsError | void>,
|
|
596
|
+
>(
|
|
597
|
+
productId: string,
|
|
598
|
+
params: undefined | GetProductChargesParams,
|
|
599
|
+
options: {
|
|
600
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &
|
|
601
|
+
Pick<
|
|
602
|
+
DefinedInitialDataOptions<
|
|
603
|
+
Awaited<ReturnType<typeof getProductCharges>>,
|
|
604
|
+
TError,
|
|
605
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
606
|
+
>,
|
|
607
|
+
"initialData"
|
|
608
|
+
>;
|
|
609
|
+
request?: SecondParameter<typeof customInstance>;
|
|
610
|
+
},
|
|
611
|
+
queryClient?: QueryClient,
|
|
612
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
613
|
+
export function useGetProductCharges<
|
|
614
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
615
|
+
TError = ErrorType<AsError | void>,
|
|
616
|
+
>(
|
|
617
|
+
productId: string,
|
|
618
|
+
params?: GetProductChargesParams,
|
|
619
|
+
options?: {
|
|
620
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &
|
|
621
|
+
Pick<
|
|
622
|
+
UndefinedInitialDataOptions<
|
|
623
|
+
Awaited<ReturnType<typeof getProductCharges>>,
|
|
624
|
+
TError,
|
|
625
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
626
|
+
>,
|
|
627
|
+
"initialData"
|
|
628
|
+
>;
|
|
629
|
+
request?: SecondParameter<typeof customInstance>;
|
|
630
|
+
},
|
|
631
|
+
queryClient?: QueryClient,
|
|
632
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
633
|
+
export function useGetProductCharges<
|
|
634
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
635
|
+
TError = ErrorType<AsError | void>,
|
|
636
|
+
>(
|
|
637
|
+
productId: string,
|
|
638
|
+
params?: GetProductChargesParams,
|
|
639
|
+
options?: {
|
|
640
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
641
|
+
request?: SecondParameter<typeof customInstance>;
|
|
642
|
+
},
|
|
643
|
+
queryClient?: QueryClient,
|
|
644
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
397
645
|
/**
|
|
398
646
|
* @summary Get charges made against a Product
|
|
399
647
|
*/
|
|
@@ -405,13 +653,16 @@ export function useGetProductCharges<
|
|
|
405
653
|
productId: string,
|
|
406
654
|
params?: GetProductChargesParams,
|
|
407
655
|
options?: {
|
|
408
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData
|
|
656
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
409
657
|
request?: SecondParameter<typeof customInstance>;
|
|
410
658
|
},
|
|
411
|
-
|
|
659
|
+
queryClient?: QueryClient,
|
|
660
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
412
661
|
const queryOptions = getGetProductChargesQueryOptions(productId, params, options);
|
|
413
662
|
|
|
414
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
663
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
664
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
665
|
+
};
|
|
415
666
|
|
|
416
667
|
query.queryKey = queryOptions.queryKey;
|
|
417
668
|
|
|
@@ -442,7 +693,9 @@ export const getGetProductChargesSuspenseQueryOptions = <
|
|
|
442
693
|
productId: string,
|
|
443
694
|
params?: GetProductChargesParams,
|
|
444
695
|
options?: {
|
|
445
|
-
query?:
|
|
696
|
+
query?: Partial<
|
|
697
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
698
|
+
>;
|
|
446
699
|
request?: SecondParameter<typeof customInstance>;
|
|
447
700
|
},
|
|
448
701
|
) => {
|
|
@@ -457,7 +710,7 @@ export const getGetProductChargesSuspenseQueryOptions = <
|
|
|
457
710
|
Awaited<ReturnType<typeof getProductCharges>>,
|
|
458
711
|
TError,
|
|
459
712
|
TData
|
|
460
|
-
> & { queryKey: QueryKey };
|
|
713
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
461
714
|
};
|
|
462
715
|
|
|
463
716
|
export type GetProductChargesSuspenseQueryResult = NonNullable<
|
|
@@ -465,6 +718,48 @@ export type GetProductChargesSuspenseQueryResult = NonNullable<
|
|
|
465
718
|
>;
|
|
466
719
|
export type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
467
720
|
|
|
721
|
+
export function useGetProductChargesSuspense<
|
|
722
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
723
|
+
TError = ErrorType<AsError | void>,
|
|
724
|
+
>(
|
|
725
|
+
productId: string,
|
|
726
|
+
params: undefined | GetProductChargesParams,
|
|
727
|
+
options: {
|
|
728
|
+
query: Partial<
|
|
729
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
730
|
+
>;
|
|
731
|
+
request?: SecondParameter<typeof customInstance>;
|
|
732
|
+
},
|
|
733
|
+
queryClient?: QueryClient,
|
|
734
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
735
|
+
export function useGetProductChargesSuspense<
|
|
736
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
737
|
+
TError = ErrorType<AsError | void>,
|
|
738
|
+
>(
|
|
739
|
+
productId: string,
|
|
740
|
+
params?: GetProductChargesParams,
|
|
741
|
+
options?: {
|
|
742
|
+
query?: Partial<
|
|
743
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
744
|
+
>;
|
|
745
|
+
request?: SecondParameter<typeof customInstance>;
|
|
746
|
+
},
|
|
747
|
+
queryClient?: QueryClient,
|
|
748
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
749
|
+
export function useGetProductChargesSuspense<
|
|
750
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
751
|
+
TError = ErrorType<AsError | void>,
|
|
752
|
+
>(
|
|
753
|
+
productId: string,
|
|
754
|
+
params?: GetProductChargesParams,
|
|
755
|
+
options?: {
|
|
756
|
+
query?: Partial<
|
|
757
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
758
|
+
>;
|
|
759
|
+
request?: SecondParameter<typeof customInstance>;
|
|
760
|
+
},
|
|
761
|
+
queryClient?: QueryClient,
|
|
762
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
468
763
|
/**
|
|
469
764
|
* @summary Get charges made against a Product
|
|
470
765
|
*/
|
|
@@ -476,15 +771,19 @@ export function useGetProductChargesSuspense<
|
|
|
476
771
|
productId: string,
|
|
477
772
|
params?: GetProductChargesParams,
|
|
478
773
|
options?: {
|
|
479
|
-
query?:
|
|
774
|
+
query?: Partial<
|
|
775
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
776
|
+
>;
|
|
480
777
|
request?: SecondParameter<typeof customInstance>;
|
|
481
778
|
},
|
|
482
|
-
|
|
779
|
+
queryClient?: QueryClient,
|
|
780
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
483
781
|
const queryOptions = getGetProductChargesSuspenseQueryOptions(productId, params, options);
|
|
484
782
|
|
|
485
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
486
|
-
|
|
487
|
-
|
|
783
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
784
|
+
TData,
|
|
785
|
+
TError
|
|
786
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
488
787
|
|
|
489
788
|
query.queryKey = queryOptions.queryKey;
|
|
490
789
|
|
|
@@ -523,7 +822,7 @@ export const getGetUnitChargesQueryOptions = <
|
|
|
523
822
|
unitId: string,
|
|
524
823
|
params?: GetUnitChargesParams,
|
|
525
824
|
options?: {
|
|
526
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData
|
|
825
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
527
826
|
request?: SecondParameter<typeof customInstance>;
|
|
528
827
|
},
|
|
529
828
|
) => {
|
|
@@ -538,12 +837,64 @@ export const getGetUnitChargesQueryOptions = <
|
|
|
538
837
|
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
539
838
|
TError,
|
|
540
839
|
TData
|
|
541
|
-
> & { queryKey: QueryKey };
|
|
840
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
542
841
|
};
|
|
543
842
|
|
|
544
843
|
export type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;
|
|
545
844
|
export type GetUnitChargesQueryError = ErrorType<AsError | void>;
|
|
546
845
|
|
|
846
|
+
export function useGetUnitCharges<
|
|
847
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
848
|
+
TError = ErrorType<AsError | void>,
|
|
849
|
+
>(
|
|
850
|
+
unitId: string,
|
|
851
|
+
params: undefined | GetUnitChargesParams,
|
|
852
|
+
options: {
|
|
853
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &
|
|
854
|
+
Pick<
|
|
855
|
+
DefinedInitialDataOptions<
|
|
856
|
+
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
857
|
+
TError,
|
|
858
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
859
|
+
>,
|
|
860
|
+
"initialData"
|
|
861
|
+
>;
|
|
862
|
+
request?: SecondParameter<typeof customInstance>;
|
|
863
|
+
},
|
|
864
|
+
queryClient?: QueryClient,
|
|
865
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
866
|
+
export function useGetUnitCharges<
|
|
867
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
868
|
+
TError = ErrorType<AsError | void>,
|
|
869
|
+
>(
|
|
870
|
+
unitId: string,
|
|
871
|
+
params?: GetUnitChargesParams,
|
|
872
|
+
options?: {
|
|
873
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &
|
|
874
|
+
Pick<
|
|
875
|
+
UndefinedInitialDataOptions<
|
|
876
|
+
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
877
|
+
TError,
|
|
878
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
879
|
+
>,
|
|
880
|
+
"initialData"
|
|
881
|
+
>;
|
|
882
|
+
request?: SecondParameter<typeof customInstance>;
|
|
883
|
+
},
|
|
884
|
+
queryClient?: QueryClient,
|
|
885
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
886
|
+
export function useGetUnitCharges<
|
|
887
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
888
|
+
TError = ErrorType<AsError | void>,
|
|
889
|
+
>(
|
|
890
|
+
unitId: string,
|
|
891
|
+
params?: GetUnitChargesParams,
|
|
892
|
+
options?: {
|
|
893
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
894
|
+
request?: SecondParameter<typeof customInstance>;
|
|
895
|
+
},
|
|
896
|
+
queryClient?: QueryClient,
|
|
897
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
547
898
|
/**
|
|
548
899
|
* @summary Get charges made against a Unit
|
|
549
900
|
*/
|
|
@@ -555,13 +906,16 @@ export function useGetUnitCharges<
|
|
|
555
906
|
unitId: string,
|
|
556
907
|
params?: GetUnitChargesParams,
|
|
557
908
|
options?: {
|
|
558
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData
|
|
909
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
559
910
|
request?: SecondParameter<typeof customInstance>;
|
|
560
911
|
},
|
|
561
|
-
|
|
912
|
+
queryClient?: QueryClient,
|
|
913
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
562
914
|
const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);
|
|
563
915
|
|
|
564
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
916
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
917
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
918
|
+
};
|
|
565
919
|
|
|
566
920
|
query.queryKey = queryOptions.queryKey;
|
|
567
921
|
|
|
@@ -592,7 +946,9 @@ export const getGetUnitChargesSuspenseQueryOptions = <
|
|
|
592
946
|
unitId: string,
|
|
593
947
|
params?: GetUnitChargesParams,
|
|
594
948
|
options?: {
|
|
595
|
-
query?:
|
|
949
|
+
query?: Partial<
|
|
950
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
951
|
+
>;
|
|
596
952
|
request?: SecondParameter<typeof customInstance>;
|
|
597
953
|
},
|
|
598
954
|
) => {
|
|
@@ -607,7 +963,7 @@ export const getGetUnitChargesSuspenseQueryOptions = <
|
|
|
607
963
|
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
608
964
|
TError,
|
|
609
965
|
TData
|
|
610
|
-
> & { queryKey: QueryKey };
|
|
966
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
611
967
|
};
|
|
612
968
|
|
|
613
969
|
export type GetUnitChargesSuspenseQueryResult = NonNullable<
|
|
@@ -615,6 +971,48 @@ export type GetUnitChargesSuspenseQueryResult = NonNullable<
|
|
|
615
971
|
>;
|
|
616
972
|
export type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
617
973
|
|
|
974
|
+
export function useGetUnitChargesSuspense<
|
|
975
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
976
|
+
TError = ErrorType<AsError | void>,
|
|
977
|
+
>(
|
|
978
|
+
unitId: string,
|
|
979
|
+
params: undefined | GetUnitChargesParams,
|
|
980
|
+
options: {
|
|
981
|
+
query: Partial<
|
|
982
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
983
|
+
>;
|
|
984
|
+
request?: SecondParameter<typeof customInstance>;
|
|
985
|
+
},
|
|
986
|
+
queryClient?: QueryClient,
|
|
987
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
988
|
+
export function useGetUnitChargesSuspense<
|
|
989
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
990
|
+
TError = ErrorType<AsError | void>,
|
|
991
|
+
>(
|
|
992
|
+
unitId: string,
|
|
993
|
+
params?: GetUnitChargesParams,
|
|
994
|
+
options?: {
|
|
995
|
+
query?: Partial<
|
|
996
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
997
|
+
>;
|
|
998
|
+
request?: SecondParameter<typeof customInstance>;
|
|
999
|
+
},
|
|
1000
|
+
queryClient?: QueryClient,
|
|
1001
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1002
|
+
export function useGetUnitChargesSuspense<
|
|
1003
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1004
|
+
TError = ErrorType<AsError | void>,
|
|
1005
|
+
>(
|
|
1006
|
+
unitId: string,
|
|
1007
|
+
params?: GetUnitChargesParams,
|
|
1008
|
+
options?: {
|
|
1009
|
+
query?: Partial<
|
|
1010
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1011
|
+
>;
|
|
1012
|
+
request?: SecondParameter<typeof customInstance>;
|
|
1013
|
+
},
|
|
1014
|
+
queryClient?: QueryClient,
|
|
1015
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
618
1016
|
/**
|
|
619
1017
|
* @summary Get charges made against a Unit
|
|
620
1018
|
*/
|
|
@@ -626,15 +1024,19 @@ export function useGetUnitChargesSuspense<
|
|
|
626
1024
|
unitId: string,
|
|
627
1025
|
params?: GetUnitChargesParams,
|
|
628
1026
|
options?: {
|
|
629
|
-
query?:
|
|
1027
|
+
query?: Partial<
|
|
1028
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1029
|
+
>;
|
|
630
1030
|
request?: SecondParameter<typeof customInstance>;
|
|
631
1031
|
},
|
|
632
|
-
|
|
1032
|
+
queryClient?: QueryClient,
|
|
1033
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
633
1034
|
const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId, params, options);
|
|
634
1035
|
|
|
635
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
636
|
-
|
|
637
|
-
|
|
1036
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1037
|
+
TData,
|
|
1038
|
+
TError
|
|
1039
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
638
1040
|
|
|
639
1041
|
query.queryKey = queryOptions.queryKey;
|
|
640
1042
|
|