@squonk/account-server-client 4.4.0-4-4.2197069952 → 4.4.0-4-4.2199390673
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,
|
|
@@ -92,7 +96,7 @@ export const getGetChargesQueryOptions = <
|
|
|
92
96
|
>(
|
|
93
97
|
params?: GetChargesParams,
|
|
94
98
|
options?: {
|
|
95
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
99
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
96
100
|
request?: SecondParameter<typeof customFetch>;
|
|
97
101
|
},
|
|
98
102
|
) => {
|
|
@@ -107,12 +111,61 @@ export const getGetChargesQueryOptions = <
|
|
|
107
111
|
Awaited<ReturnType<typeof getCharges>>,
|
|
108
112
|
TError,
|
|
109
113
|
TData
|
|
110
|
-
> & { queryKey: QueryKey };
|
|
114
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
111
115
|
};
|
|
112
116
|
|
|
113
117
|
export type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;
|
|
114
118
|
export type GetChargesQueryError = ErrorType<void | AsError>;
|
|
115
119
|
|
|
120
|
+
export function useGetCharges<
|
|
121
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
122
|
+
TError = ErrorType<void | AsError>,
|
|
123
|
+
>(
|
|
124
|
+
params: undefined | GetChargesParams,
|
|
125
|
+
options: {
|
|
126
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &
|
|
127
|
+
Pick<
|
|
128
|
+
DefinedInitialDataOptions<
|
|
129
|
+
Awaited<ReturnType<typeof getCharges>>,
|
|
130
|
+
TError,
|
|
131
|
+
Awaited<ReturnType<typeof getCharges>>
|
|
132
|
+
>,
|
|
133
|
+
"initialData"
|
|
134
|
+
>;
|
|
135
|
+
request?: SecondParameter<typeof customFetch>;
|
|
136
|
+
},
|
|
137
|
+
queryClient?: QueryClient,
|
|
138
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
139
|
+
export function useGetCharges<
|
|
140
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
141
|
+
TError = ErrorType<void | AsError>,
|
|
142
|
+
>(
|
|
143
|
+
params?: GetChargesParams,
|
|
144
|
+
options?: {
|
|
145
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>> &
|
|
146
|
+
Pick<
|
|
147
|
+
UndefinedInitialDataOptions<
|
|
148
|
+
Awaited<ReturnType<typeof getCharges>>,
|
|
149
|
+
TError,
|
|
150
|
+
Awaited<ReturnType<typeof getCharges>>
|
|
151
|
+
>,
|
|
152
|
+
"initialData"
|
|
153
|
+
>;
|
|
154
|
+
request?: SecondParameter<typeof customFetch>;
|
|
155
|
+
},
|
|
156
|
+
queryClient?: QueryClient,
|
|
157
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
158
|
+
export function useGetCharges<
|
|
159
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
160
|
+
TError = ErrorType<void | AsError>,
|
|
161
|
+
>(
|
|
162
|
+
params?: GetChargesParams,
|
|
163
|
+
options?: {
|
|
164
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
165
|
+
request?: SecondParameter<typeof customFetch>;
|
|
166
|
+
},
|
|
167
|
+
queryClient?: QueryClient,
|
|
168
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
116
169
|
/**
|
|
117
170
|
* @summary Gets charges for all Organisations
|
|
118
171
|
*/
|
|
@@ -123,13 +176,16 @@ export function useGetCharges<
|
|
|
123
176
|
>(
|
|
124
177
|
params?: GetChargesParams,
|
|
125
178
|
options?: {
|
|
126
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
179
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
127
180
|
request?: SecondParameter<typeof customFetch>;
|
|
128
181
|
},
|
|
129
|
-
|
|
182
|
+
queryClient?: QueryClient,
|
|
183
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
130
184
|
const queryOptions = getGetChargesQueryOptions(params, options);
|
|
131
185
|
|
|
132
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
186
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
187
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
188
|
+
};
|
|
133
189
|
|
|
134
190
|
query.queryKey = queryOptions.queryKey;
|
|
135
191
|
|
|
@@ -155,7 +211,7 @@ export const getGetChargesSuspenseQueryOptions = <
|
|
|
155
211
|
>(
|
|
156
212
|
params?: GetChargesParams,
|
|
157
213
|
options?: {
|
|
158
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
214
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
159
215
|
request?: SecondParameter<typeof customFetch>;
|
|
160
216
|
},
|
|
161
217
|
) => {
|
|
@@ -170,12 +226,45 @@ export const getGetChargesSuspenseQueryOptions = <
|
|
|
170
226
|
Awaited<ReturnType<typeof getCharges>>,
|
|
171
227
|
TError,
|
|
172
228
|
TData
|
|
173
|
-
> & { queryKey: QueryKey };
|
|
229
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
174
230
|
};
|
|
175
231
|
|
|
176
232
|
export type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;
|
|
177
233
|
export type GetChargesSuspenseQueryError = ErrorType<void | AsError>;
|
|
178
234
|
|
|
235
|
+
export function useGetChargesSuspense<
|
|
236
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
237
|
+
TError = ErrorType<void | AsError>,
|
|
238
|
+
>(
|
|
239
|
+
params: undefined | GetChargesParams,
|
|
240
|
+
options: {
|
|
241
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
242
|
+
request?: SecondParameter<typeof customFetch>;
|
|
243
|
+
},
|
|
244
|
+
queryClient?: QueryClient,
|
|
245
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
246
|
+
export function useGetChargesSuspense<
|
|
247
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
248
|
+
TError = ErrorType<void | AsError>,
|
|
249
|
+
>(
|
|
250
|
+
params?: GetChargesParams,
|
|
251
|
+
options?: {
|
|
252
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
253
|
+
request?: SecondParameter<typeof customFetch>;
|
|
254
|
+
},
|
|
255
|
+
queryClient?: QueryClient,
|
|
256
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
257
|
+
export function useGetChargesSuspense<
|
|
258
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
259
|
+
TError = ErrorType<void | AsError>,
|
|
260
|
+
>(
|
|
261
|
+
params?: GetChargesParams,
|
|
262
|
+
options?: {
|
|
263
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
264
|
+
request?: SecondParameter<typeof customFetch>;
|
|
265
|
+
},
|
|
266
|
+
queryClient?: QueryClient,
|
|
267
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
179
268
|
/**
|
|
180
269
|
* @summary Gets charges for all Organisations
|
|
181
270
|
*/
|
|
@@ -186,15 +275,17 @@ export function useGetChargesSuspense<
|
|
|
186
275
|
>(
|
|
187
276
|
params?: GetChargesParams,
|
|
188
277
|
options?: {
|
|
189
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData
|
|
278
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
190
279
|
request?: SecondParameter<typeof customFetch>;
|
|
191
280
|
},
|
|
192
|
-
|
|
281
|
+
queryClient?: QueryClient,
|
|
282
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
193
283
|
const queryOptions = getGetChargesSuspenseQueryOptions(params, options);
|
|
194
284
|
|
|
195
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
196
|
-
|
|
197
|
-
|
|
285
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
286
|
+
TData,
|
|
287
|
+
TError
|
|
288
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
198
289
|
|
|
199
290
|
query.queryKey = queryOptions.queryKey;
|
|
200
291
|
|
|
@@ -276,7 +367,9 @@ export const getGetOrganisationChargesQueryOptions = <
|
|
|
276
367
|
orgId: string,
|
|
277
368
|
params?: GetOrganisationChargesParams,
|
|
278
369
|
options?: {
|
|
279
|
-
query?:
|
|
370
|
+
query?: Partial<
|
|
371
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
372
|
+
>;
|
|
280
373
|
request?: SecondParameter<typeof customFetch>;
|
|
281
374
|
},
|
|
282
375
|
) => {
|
|
@@ -291,7 +384,7 @@ export const getGetOrganisationChargesQueryOptions = <
|
|
|
291
384
|
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
292
385
|
TError,
|
|
293
386
|
TData
|
|
294
|
-
> & { queryKey: QueryKey };
|
|
387
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
295
388
|
};
|
|
296
389
|
|
|
297
390
|
export type GetOrganisationChargesQueryResult = NonNullable<
|
|
@@ -299,6 +392,64 @@ export type GetOrganisationChargesQueryResult = NonNullable<
|
|
|
299
392
|
>;
|
|
300
393
|
export type GetOrganisationChargesQueryError = ErrorType<void | AsError>;
|
|
301
394
|
|
|
395
|
+
export function useGetOrganisationCharges<
|
|
396
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
397
|
+
TError = ErrorType<void | AsError>,
|
|
398
|
+
>(
|
|
399
|
+
orgId: string,
|
|
400
|
+
params: undefined | GetOrganisationChargesParams,
|
|
401
|
+
options: {
|
|
402
|
+
query: Partial<
|
|
403
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
404
|
+
> &
|
|
405
|
+
Pick<
|
|
406
|
+
DefinedInitialDataOptions<
|
|
407
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
408
|
+
TError,
|
|
409
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
410
|
+
>,
|
|
411
|
+
"initialData"
|
|
412
|
+
>;
|
|
413
|
+
request?: SecondParameter<typeof customFetch>;
|
|
414
|
+
},
|
|
415
|
+
queryClient?: QueryClient,
|
|
416
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
417
|
+
export function useGetOrganisationCharges<
|
|
418
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
419
|
+
TError = ErrorType<void | AsError>,
|
|
420
|
+
>(
|
|
421
|
+
orgId: string,
|
|
422
|
+
params?: GetOrganisationChargesParams,
|
|
423
|
+
options?: {
|
|
424
|
+
query?: Partial<
|
|
425
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
426
|
+
> &
|
|
427
|
+
Pick<
|
|
428
|
+
UndefinedInitialDataOptions<
|
|
429
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
430
|
+
TError,
|
|
431
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
432
|
+
>,
|
|
433
|
+
"initialData"
|
|
434
|
+
>;
|
|
435
|
+
request?: SecondParameter<typeof customFetch>;
|
|
436
|
+
},
|
|
437
|
+
queryClient?: QueryClient,
|
|
438
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
439
|
+
export function useGetOrganisationCharges<
|
|
440
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
441
|
+
TError = ErrorType<void | AsError>,
|
|
442
|
+
>(
|
|
443
|
+
orgId: string,
|
|
444
|
+
params?: GetOrganisationChargesParams,
|
|
445
|
+
options?: {
|
|
446
|
+
query?: Partial<
|
|
447
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
448
|
+
>;
|
|
449
|
+
request?: SecondParameter<typeof customFetch>;
|
|
450
|
+
},
|
|
451
|
+
queryClient?: QueryClient,
|
|
452
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
302
453
|
/**
|
|
303
454
|
* @summary Gets charges for all Units in an Organisation
|
|
304
455
|
*/
|
|
@@ -310,13 +461,18 @@ export function useGetOrganisationCharges<
|
|
|
310
461
|
orgId: string,
|
|
311
462
|
params?: GetOrganisationChargesParams,
|
|
312
463
|
options?: {
|
|
313
|
-
query?:
|
|
464
|
+
query?: Partial<
|
|
465
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
466
|
+
>;
|
|
314
467
|
request?: SecondParameter<typeof customFetch>;
|
|
315
468
|
},
|
|
316
|
-
|
|
469
|
+
queryClient?: QueryClient,
|
|
470
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
317
471
|
const queryOptions = getGetOrganisationChargesQueryOptions(orgId, params, options);
|
|
318
472
|
|
|
319
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
473
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
474
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
475
|
+
};
|
|
320
476
|
|
|
321
477
|
query.queryKey = queryOptions.queryKey;
|
|
322
478
|
|
|
@@ -347,10 +503,8 @@ export const getGetOrganisationChargesSuspenseQueryOptions = <
|
|
|
347
503
|
orgId: string,
|
|
348
504
|
params?: GetOrganisationChargesParams,
|
|
349
505
|
options?: {
|
|
350
|
-
query?:
|
|
351
|
-
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
352
|
-
TError,
|
|
353
|
-
TData
|
|
506
|
+
query?: Partial<
|
|
507
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
354
508
|
>;
|
|
355
509
|
request?: SecondParameter<typeof customFetch>;
|
|
356
510
|
},
|
|
@@ -366,7 +520,7 @@ export const getGetOrganisationChargesSuspenseQueryOptions = <
|
|
|
366
520
|
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
367
521
|
TError,
|
|
368
522
|
TData
|
|
369
|
-
> & { queryKey: QueryKey };
|
|
523
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
370
524
|
};
|
|
371
525
|
|
|
372
526
|
export type GetOrganisationChargesSuspenseQueryResult = NonNullable<
|
|
@@ -374,6 +528,48 @@ export type GetOrganisationChargesSuspenseQueryResult = NonNullable<
|
|
|
374
528
|
>;
|
|
375
529
|
export type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;
|
|
376
530
|
|
|
531
|
+
export function useGetOrganisationChargesSuspense<
|
|
532
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
533
|
+
TError = ErrorType<void | AsError>,
|
|
534
|
+
>(
|
|
535
|
+
orgId: string,
|
|
536
|
+
params: undefined | GetOrganisationChargesParams,
|
|
537
|
+
options: {
|
|
538
|
+
query: Partial<
|
|
539
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
540
|
+
>;
|
|
541
|
+
request?: SecondParameter<typeof customFetch>;
|
|
542
|
+
},
|
|
543
|
+
queryClient?: QueryClient,
|
|
544
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
545
|
+
export function useGetOrganisationChargesSuspense<
|
|
546
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
547
|
+
TError = ErrorType<void | AsError>,
|
|
548
|
+
>(
|
|
549
|
+
orgId: string,
|
|
550
|
+
params?: GetOrganisationChargesParams,
|
|
551
|
+
options?: {
|
|
552
|
+
query?: Partial<
|
|
553
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
554
|
+
>;
|
|
555
|
+
request?: SecondParameter<typeof customFetch>;
|
|
556
|
+
},
|
|
557
|
+
queryClient?: QueryClient,
|
|
558
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
559
|
+
export function useGetOrganisationChargesSuspense<
|
|
560
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
561
|
+
TError = ErrorType<void | AsError>,
|
|
562
|
+
>(
|
|
563
|
+
orgId: string,
|
|
564
|
+
params?: GetOrganisationChargesParams,
|
|
565
|
+
options?: {
|
|
566
|
+
query?: Partial<
|
|
567
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
568
|
+
>;
|
|
569
|
+
request?: SecondParameter<typeof customFetch>;
|
|
570
|
+
},
|
|
571
|
+
queryClient?: QueryClient,
|
|
572
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
377
573
|
/**
|
|
378
574
|
* @summary Gets charges for all Units in an Organisation
|
|
379
575
|
*/
|
|
@@ -385,19 +581,19 @@ export function useGetOrganisationChargesSuspense<
|
|
|
385
581
|
orgId: string,
|
|
386
582
|
params?: GetOrganisationChargesParams,
|
|
387
583
|
options?: {
|
|
388
|
-
query?:
|
|
389
|
-
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
390
|
-
TError,
|
|
391
|
-
TData
|
|
584
|
+
query?: Partial<
|
|
585
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
392
586
|
>;
|
|
393
587
|
request?: SecondParameter<typeof customFetch>;
|
|
394
588
|
},
|
|
395
|
-
|
|
589
|
+
queryClient?: QueryClient,
|
|
590
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
396
591
|
const queryOptions = getGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
|
|
397
592
|
|
|
398
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
399
|
-
|
|
400
|
-
|
|
593
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
594
|
+
TData,
|
|
595
|
+
TError
|
|
596
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
401
597
|
|
|
402
598
|
query.queryKey = queryOptions.queryKey;
|
|
403
599
|
|
|
@@ -474,7 +670,7 @@ export const getGetProductChargesQueryOptions = <
|
|
|
474
670
|
productId: string,
|
|
475
671
|
params?: GetProductChargesParams,
|
|
476
672
|
options?: {
|
|
477
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData
|
|
673
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
478
674
|
request?: SecondParameter<typeof customFetch>;
|
|
479
675
|
},
|
|
480
676
|
) => {
|
|
@@ -489,7 +685,7 @@ export const getGetProductChargesQueryOptions = <
|
|
|
489
685
|
Awaited<ReturnType<typeof getProductCharges>>,
|
|
490
686
|
TError,
|
|
491
687
|
TData
|
|
492
|
-
> & { queryKey: QueryKey };
|
|
688
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
493
689
|
};
|
|
494
690
|
|
|
495
691
|
export type GetProductChargesQueryResult = NonNullable<
|
|
@@ -497,6 +693,58 @@ export type GetProductChargesQueryResult = NonNullable<
|
|
|
497
693
|
>;
|
|
498
694
|
export type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
499
695
|
|
|
696
|
+
export function useGetProductCharges<
|
|
697
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
698
|
+
TError = ErrorType<AsError | void>,
|
|
699
|
+
>(
|
|
700
|
+
productId: string,
|
|
701
|
+
params: undefined | GetProductChargesParams,
|
|
702
|
+
options: {
|
|
703
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &
|
|
704
|
+
Pick<
|
|
705
|
+
DefinedInitialDataOptions<
|
|
706
|
+
Awaited<ReturnType<typeof getProductCharges>>,
|
|
707
|
+
TError,
|
|
708
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
709
|
+
>,
|
|
710
|
+
"initialData"
|
|
711
|
+
>;
|
|
712
|
+
request?: SecondParameter<typeof customFetch>;
|
|
713
|
+
},
|
|
714
|
+
queryClient?: QueryClient,
|
|
715
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
716
|
+
export function useGetProductCharges<
|
|
717
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
718
|
+
TError = ErrorType<AsError | void>,
|
|
719
|
+
>(
|
|
720
|
+
productId: string,
|
|
721
|
+
params?: GetProductChargesParams,
|
|
722
|
+
options?: {
|
|
723
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &
|
|
724
|
+
Pick<
|
|
725
|
+
UndefinedInitialDataOptions<
|
|
726
|
+
Awaited<ReturnType<typeof getProductCharges>>,
|
|
727
|
+
TError,
|
|
728
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
729
|
+
>,
|
|
730
|
+
"initialData"
|
|
731
|
+
>;
|
|
732
|
+
request?: SecondParameter<typeof customFetch>;
|
|
733
|
+
},
|
|
734
|
+
queryClient?: QueryClient,
|
|
735
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
736
|
+
export function useGetProductCharges<
|
|
737
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
738
|
+
TError = ErrorType<AsError | void>,
|
|
739
|
+
>(
|
|
740
|
+
productId: string,
|
|
741
|
+
params?: GetProductChargesParams,
|
|
742
|
+
options?: {
|
|
743
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
744
|
+
request?: SecondParameter<typeof customFetch>;
|
|
745
|
+
},
|
|
746
|
+
queryClient?: QueryClient,
|
|
747
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
500
748
|
/**
|
|
501
749
|
* @summary Get charges made against a Product
|
|
502
750
|
*/
|
|
@@ -508,13 +756,16 @@ export function useGetProductCharges<
|
|
|
508
756
|
productId: string,
|
|
509
757
|
params?: GetProductChargesParams,
|
|
510
758
|
options?: {
|
|
511
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData
|
|
759
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
512
760
|
request?: SecondParameter<typeof customFetch>;
|
|
513
761
|
},
|
|
514
|
-
|
|
762
|
+
queryClient?: QueryClient,
|
|
763
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
515
764
|
const queryOptions = getGetProductChargesQueryOptions(productId, params, options);
|
|
516
765
|
|
|
517
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
766
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
767
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
768
|
+
};
|
|
518
769
|
|
|
519
770
|
query.queryKey = queryOptions.queryKey;
|
|
520
771
|
|
|
@@ -545,7 +796,9 @@ export const getGetProductChargesSuspenseQueryOptions = <
|
|
|
545
796
|
productId: string,
|
|
546
797
|
params?: GetProductChargesParams,
|
|
547
798
|
options?: {
|
|
548
|
-
query?:
|
|
799
|
+
query?: Partial<
|
|
800
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
801
|
+
>;
|
|
549
802
|
request?: SecondParameter<typeof customFetch>;
|
|
550
803
|
},
|
|
551
804
|
) => {
|
|
@@ -560,7 +813,7 @@ export const getGetProductChargesSuspenseQueryOptions = <
|
|
|
560
813
|
Awaited<ReturnType<typeof getProductCharges>>,
|
|
561
814
|
TError,
|
|
562
815
|
TData
|
|
563
|
-
> & { queryKey: QueryKey };
|
|
816
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
564
817
|
};
|
|
565
818
|
|
|
566
819
|
export type GetProductChargesSuspenseQueryResult = NonNullable<
|
|
@@ -568,6 +821,48 @@ export type GetProductChargesSuspenseQueryResult = NonNullable<
|
|
|
568
821
|
>;
|
|
569
822
|
export type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
570
823
|
|
|
824
|
+
export function useGetProductChargesSuspense<
|
|
825
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
826
|
+
TError = ErrorType<AsError | void>,
|
|
827
|
+
>(
|
|
828
|
+
productId: string,
|
|
829
|
+
params: undefined | GetProductChargesParams,
|
|
830
|
+
options: {
|
|
831
|
+
query: Partial<
|
|
832
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
833
|
+
>;
|
|
834
|
+
request?: SecondParameter<typeof customFetch>;
|
|
835
|
+
},
|
|
836
|
+
queryClient?: QueryClient,
|
|
837
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
838
|
+
export function useGetProductChargesSuspense<
|
|
839
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
840
|
+
TError = ErrorType<AsError | void>,
|
|
841
|
+
>(
|
|
842
|
+
productId: string,
|
|
843
|
+
params?: GetProductChargesParams,
|
|
844
|
+
options?: {
|
|
845
|
+
query?: Partial<
|
|
846
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
847
|
+
>;
|
|
848
|
+
request?: SecondParameter<typeof customFetch>;
|
|
849
|
+
},
|
|
850
|
+
queryClient?: QueryClient,
|
|
851
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
852
|
+
export function useGetProductChargesSuspense<
|
|
853
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
854
|
+
TError = ErrorType<AsError | void>,
|
|
855
|
+
>(
|
|
856
|
+
productId: string,
|
|
857
|
+
params?: GetProductChargesParams,
|
|
858
|
+
options?: {
|
|
859
|
+
query?: Partial<
|
|
860
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
861
|
+
>;
|
|
862
|
+
request?: SecondParameter<typeof customFetch>;
|
|
863
|
+
},
|
|
864
|
+
queryClient?: QueryClient,
|
|
865
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
571
866
|
/**
|
|
572
867
|
* @summary Get charges made against a Product
|
|
573
868
|
*/
|
|
@@ -579,15 +874,19 @@ export function useGetProductChargesSuspense<
|
|
|
579
874
|
productId: string,
|
|
580
875
|
params?: GetProductChargesParams,
|
|
581
876
|
options?: {
|
|
582
|
-
query?:
|
|
877
|
+
query?: Partial<
|
|
878
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
879
|
+
>;
|
|
583
880
|
request?: SecondParameter<typeof customFetch>;
|
|
584
881
|
},
|
|
585
|
-
|
|
882
|
+
queryClient?: QueryClient,
|
|
883
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
586
884
|
const queryOptions = getGetProductChargesSuspenseQueryOptions(productId, params, options);
|
|
587
885
|
|
|
588
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
589
|
-
|
|
590
|
-
|
|
886
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
887
|
+
TData,
|
|
888
|
+
TError
|
|
889
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
591
890
|
|
|
592
891
|
query.queryKey = queryOptions.queryKey;
|
|
593
892
|
|
|
@@ -658,7 +957,7 @@ export const getGetUnitChargesQueryOptions = <
|
|
|
658
957
|
unitId: string,
|
|
659
958
|
params?: GetUnitChargesParams,
|
|
660
959
|
options?: {
|
|
661
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData
|
|
960
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
662
961
|
request?: SecondParameter<typeof customFetch>;
|
|
663
962
|
},
|
|
664
963
|
) => {
|
|
@@ -673,12 +972,64 @@ export const getGetUnitChargesQueryOptions = <
|
|
|
673
972
|
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
674
973
|
TError,
|
|
675
974
|
TData
|
|
676
|
-
> & { queryKey: QueryKey };
|
|
975
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
677
976
|
};
|
|
678
977
|
|
|
679
978
|
export type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;
|
|
680
979
|
export type GetUnitChargesQueryError = ErrorType<AsError | void>;
|
|
681
980
|
|
|
981
|
+
export function useGetUnitCharges<
|
|
982
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
983
|
+
TError = ErrorType<AsError | void>,
|
|
984
|
+
>(
|
|
985
|
+
unitId: string,
|
|
986
|
+
params: undefined | GetUnitChargesParams,
|
|
987
|
+
options: {
|
|
988
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &
|
|
989
|
+
Pick<
|
|
990
|
+
DefinedInitialDataOptions<
|
|
991
|
+
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
992
|
+
TError,
|
|
993
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
994
|
+
>,
|
|
995
|
+
"initialData"
|
|
996
|
+
>;
|
|
997
|
+
request?: SecondParameter<typeof customFetch>;
|
|
998
|
+
},
|
|
999
|
+
queryClient?: QueryClient,
|
|
1000
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1001
|
+
export function useGetUnitCharges<
|
|
1002
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1003
|
+
TError = ErrorType<AsError | void>,
|
|
1004
|
+
>(
|
|
1005
|
+
unitId: string,
|
|
1006
|
+
params?: GetUnitChargesParams,
|
|
1007
|
+
options?: {
|
|
1008
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &
|
|
1009
|
+
Pick<
|
|
1010
|
+
UndefinedInitialDataOptions<
|
|
1011
|
+
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1012
|
+
TError,
|
|
1013
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
1014
|
+
>,
|
|
1015
|
+
"initialData"
|
|
1016
|
+
>;
|
|
1017
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1018
|
+
},
|
|
1019
|
+
queryClient?: QueryClient,
|
|
1020
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1021
|
+
export function useGetUnitCharges<
|
|
1022
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1023
|
+
TError = ErrorType<AsError | void>,
|
|
1024
|
+
>(
|
|
1025
|
+
unitId: string,
|
|
1026
|
+
params?: GetUnitChargesParams,
|
|
1027
|
+
options?: {
|
|
1028
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
1029
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1030
|
+
},
|
|
1031
|
+
queryClient?: QueryClient,
|
|
1032
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
682
1033
|
/**
|
|
683
1034
|
* @summary Get charges made against a Unit
|
|
684
1035
|
*/
|
|
@@ -690,13 +1041,16 @@ export function useGetUnitCharges<
|
|
|
690
1041
|
unitId: string,
|
|
691
1042
|
params?: GetUnitChargesParams,
|
|
692
1043
|
options?: {
|
|
693
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData
|
|
1044
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
694
1045
|
request?: SecondParameter<typeof customFetch>;
|
|
695
1046
|
},
|
|
696
|
-
|
|
1047
|
+
queryClient?: QueryClient,
|
|
1048
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
697
1049
|
const queryOptions = getGetUnitChargesQueryOptions(unitId, params, options);
|
|
698
1050
|
|
|
699
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
1051
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
1052
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
1053
|
+
};
|
|
700
1054
|
|
|
701
1055
|
query.queryKey = queryOptions.queryKey;
|
|
702
1056
|
|
|
@@ -727,7 +1081,9 @@ export const getGetUnitChargesSuspenseQueryOptions = <
|
|
|
727
1081
|
unitId: string,
|
|
728
1082
|
params?: GetUnitChargesParams,
|
|
729
1083
|
options?: {
|
|
730
|
-
query?:
|
|
1084
|
+
query?: Partial<
|
|
1085
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1086
|
+
>;
|
|
731
1087
|
request?: SecondParameter<typeof customFetch>;
|
|
732
1088
|
},
|
|
733
1089
|
) => {
|
|
@@ -742,7 +1098,7 @@ export const getGetUnitChargesSuspenseQueryOptions = <
|
|
|
742
1098
|
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
743
1099
|
TError,
|
|
744
1100
|
TData
|
|
745
|
-
> & { queryKey: QueryKey };
|
|
1101
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
746
1102
|
};
|
|
747
1103
|
|
|
748
1104
|
export type GetUnitChargesSuspenseQueryResult = NonNullable<
|
|
@@ -750,6 +1106,48 @@ export type GetUnitChargesSuspenseQueryResult = NonNullable<
|
|
|
750
1106
|
>;
|
|
751
1107
|
export type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
752
1108
|
|
|
1109
|
+
export function useGetUnitChargesSuspense<
|
|
1110
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1111
|
+
TError = ErrorType<AsError | void>,
|
|
1112
|
+
>(
|
|
1113
|
+
unitId: string,
|
|
1114
|
+
params: undefined | GetUnitChargesParams,
|
|
1115
|
+
options: {
|
|
1116
|
+
query: Partial<
|
|
1117
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1118
|
+
>;
|
|
1119
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1120
|
+
},
|
|
1121
|
+
queryClient?: QueryClient,
|
|
1122
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1123
|
+
export function useGetUnitChargesSuspense<
|
|
1124
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1125
|
+
TError = ErrorType<AsError | void>,
|
|
1126
|
+
>(
|
|
1127
|
+
unitId: string,
|
|
1128
|
+
params?: GetUnitChargesParams,
|
|
1129
|
+
options?: {
|
|
1130
|
+
query?: Partial<
|
|
1131
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1132
|
+
>;
|
|
1133
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1134
|
+
},
|
|
1135
|
+
queryClient?: QueryClient,
|
|
1136
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
1137
|
+
export function useGetUnitChargesSuspense<
|
|
1138
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
1139
|
+
TError = ErrorType<AsError | void>,
|
|
1140
|
+
>(
|
|
1141
|
+
unitId: string,
|
|
1142
|
+
params?: GetUnitChargesParams,
|
|
1143
|
+
options?: {
|
|
1144
|
+
query?: Partial<
|
|
1145
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1146
|
+
>;
|
|
1147
|
+
request?: SecondParameter<typeof customFetch>;
|
|
1148
|
+
},
|
|
1149
|
+
queryClient?: QueryClient,
|
|
1150
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
753
1151
|
/**
|
|
754
1152
|
* @summary Get charges made against a Unit
|
|
755
1153
|
*/
|
|
@@ -761,15 +1159,19 @@ export function useGetUnitChargesSuspense<
|
|
|
761
1159
|
unitId: string,
|
|
762
1160
|
params?: GetUnitChargesParams,
|
|
763
1161
|
options?: {
|
|
764
|
-
query?:
|
|
1162
|
+
query?: Partial<
|
|
1163
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
1164
|
+
>;
|
|
765
1165
|
request?: SecondParameter<typeof customFetch>;
|
|
766
1166
|
},
|
|
767
|
-
|
|
1167
|
+
queryClient?: QueryClient,
|
|
1168
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
768
1169
|
const queryOptions = getGetUnitChargesSuspenseQueryOptions(unitId, params, options);
|
|
769
1170
|
|
|
770
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
771
|
-
|
|
772
|
-
|
|
1171
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
1172
|
+
TData,
|
|
1173
|
+
TError
|
|
1174
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
773
1175
|
|
|
774
1176
|
query.queryKey = queryOptions.queryKey;
|
|
775
1177
|
|