@squonk/account-server-client 4.2.1 → 4.3.1
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/asset/asset.cjs +99 -126
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +99 -99
- package/asset/asset.d.ts +99 -99
- package/asset/asset.js +107 -134
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +73 -85
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +47 -47
- package/charges/charges.d.ts +47 -47
- package/charges/charges.js +78 -90
- package/charges/charges.js.map +1 -1
- package/chunk-3WKSNKHE.js +25 -0
- package/chunk-3WKSNKHE.js.map +1 -0
- package/chunk-NY2VJJG7.cjs +25 -0
- package/chunk-NY2VJJG7.cjs.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/event-stream/event-stream.cjs +53 -61
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +45 -45
- package/event-stream/event-stream.d.ts +45 -45
- package/event-stream/event-stream.js +58 -66
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +49 -57
- package/index.cjs.map +1 -1
- package/index.d.cts +796 -773
- package/index.d.ts +796 -773
- package/index.js +48 -56
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +38 -45
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +25 -25
- package/merchant/merchant.d.ts +25 -25
- package/merchant/merchant.js +42 -49
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +77 -87
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +72 -70
- package/organisation/organisation.d.ts +72 -70
- package/organisation/organisation.js +83 -93
- package/organisation/organisation.js.map +1 -1
- package/package.json +13 -16
- package/product/product.cjs +143 -153
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +100 -100
- package/product/product.d.ts +100 -100
- package/product/product.js +153 -163
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +863 -856
- package/src/asset/asset.ts +899 -634
- package/src/charges/charges.ts +822 -498
- package/src/custom-instance.ts +3 -3
- package/src/event-stream/event-stream.ts +531 -345
- package/src/index.ts +2 -2
- package/src/merchant/merchant.ts +355 -234
- package/src/options-mutator.ts +27 -0
- package/src/organisation/organisation.ts +812 -504
- package/src/product/product.ts +1373 -841
- package/src/state/state.ts +174 -127
- package/src/unit/unit.ts +1273 -603
- package/src/user/user.ts +895 -564
- package/state/state.cjs +22 -24
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +14 -14
- package/state/state.d.ts +14 -14
- package/state/state.js +24 -26
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +171 -106
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +200 -90
- package/unit/unit.d.ts +200 -90
- package/unit/unit.js +179 -114
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +94 -110
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +77 -77
- package/user/user.d.ts +77 -77
- package/user/user.js +101 -117
- package/user/user.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
package/src/charges/charges.ts
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.10.0 🍺
|
|
4
3
|
* Do not edit manually.
|
|
5
4
|
* Account Server API
|
|
6
5
|
* The Informatics Matters Account Server API.
|
|
7
6
|
|
|
8
7
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
9
8
|
|
|
10
|
-
* OpenAPI spec version: 4.
|
|
9
|
+
* OpenAPI spec version: 4.3
|
|
11
10
|
*/
|
|
12
|
-
import {
|
|
13
|
-
useQuery,
|
|
14
|
-
useSuspenseQuery
|
|
15
|
-
} from '@tanstack/react-query'
|
|
11
|
+
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
16
12
|
import type {
|
|
17
13
|
DataTag,
|
|
18
14
|
DefinedInitialDataOptions,
|
|
19
15
|
DefinedUseQueryResult,
|
|
16
|
+
QueryClient,
|
|
20
17
|
QueryFunction,
|
|
21
18
|
QueryKey,
|
|
22
19
|
UndefinedInitialDataOptions,
|
|
23
20
|
UseQueryOptions,
|
|
24
21
|
UseQueryResult,
|
|
25
22
|
UseSuspenseQueryOptions,
|
|
26
|
-
UseSuspenseQueryResult
|
|
27
|
-
} from
|
|
23
|
+
UseSuspenseQueryResult,
|
|
24
|
+
} from "@tanstack/react-query";
|
|
25
|
+
|
|
28
26
|
import type {
|
|
29
27
|
AsError,
|
|
30
28
|
ChargesGetResponse,
|
|
@@ -34,14 +32,14 @@ import type {
|
|
|
34
32
|
GetUnitChargesParams,
|
|
35
33
|
OrganisationChargesGetResponse,
|
|
36
34
|
ProductChargesGetResponse,
|
|
37
|
-
UnitChargesGetResponse
|
|
38
|
-
} from
|
|
39
|
-
import { customInstance } from '.././custom-instance';
|
|
40
|
-
import type { ErrorType } from '.././custom-instance';
|
|
41
|
-
|
|
35
|
+
UnitChargesGetResponse,
|
|
36
|
+
} from "../account-server-api.schemas";
|
|
42
37
|
|
|
43
|
-
|
|
38
|
+
import { customInstance } from ".././custom-instance";
|
|
39
|
+
import type { ErrorType } from ".././custom-instance";
|
|
40
|
+
import { queryMutator } from ".././options-mutator";
|
|
44
41
|
|
|
42
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
45
43
|
|
|
46
44
|
/**
|
|
47
45
|
* Gets global Charges.
|
|
@@ -51,144 +49,211 @@ You need admin rights to use this path.
|
|
|
51
49
|
* @summary Gets charges for all Organisations
|
|
52
50
|
*/
|
|
53
51
|
export const getCharges = (
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
params?: GetChargesParams,
|
|
53
|
+
options?: SecondParameter<typeof customInstance>,
|
|
54
|
+
signal?: AbortSignal,
|
|
56
55
|
) => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
56
|
+
return customInstance<ChargesGetResponse>(
|
|
57
|
+
{ url: `/charges`, method: "GET", params, signal },
|
|
58
|
+
options,
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const getGetChargesQueryKey = (params?: GetChargesParams) => {
|
|
63
|
+
return [`/charges`, ...(params ? [params] : [])] as const;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const useGetChargesQueryOptions = <
|
|
67
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
68
|
+
TError = ErrorType<void | AsError>,
|
|
69
|
+
>(
|
|
70
|
+
params?: GetChargesParams,
|
|
71
|
+
options?: {
|
|
72
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
73
|
+
request?: SecondParameter<typeof customInstance>;
|
|
74
|
+
},
|
|
73
75
|
) => {
|
|
76
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
74
77
|
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) => getCharges(params, requestOptions, signal);
|
|
78
|
+
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
82
79
|
|
|
83
|
-
|
|
80
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>
|
|
81
|
+
getCharges(params, requestOptions, signal);
|
|
84
82
|
|
|
85
|
-
|
|
83
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
86
84
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export type GetChargesQueryError = ErrorType<void | AsError>
|
|
85
|
+
return customOptions as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {
|
|
86
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
92
89
|
|
|
90
|
+
export type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;
|
|
91
|
+
export type GetChargesQueryError = ErrorType<void | AsError>;
|
|
93
92
|
|
|
94
|
-
export function useGetCharges<
|
|
95
|
-
|
|
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<
|
|
96
101
|
DefinedInitialDataOptions<
|
|
97
102
|
Awaited<ReturnType<typeof getCharges>>,
|
|
98
103
|
TError,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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, TError> };
|
|
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<
|
|
106
120
|
UndefinedInitialDataOptions<
|
|
107
121
|
Awaited<ReturnType<typeof getCharges>>,
|
|
108
122
|
TError,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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, TError> };
|
|
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, TError> };
|
|
118
142
|
/**
|
|
119
143
|
* @summary Gets charges for all Organisations
|
|
120
144
|
*/
|
|
121
145
|
|
|
122
|
-
export function useGetCharges<
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
146
|
+
export function useGetCharges<
|
|
147
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
148
|
+
TError = ErrorType<void | AsError>,
|
|
149
|
+
>(
|
|
150
|
+
params?: GetChargesParams,
|
|
151
|
+
options?: {
|
|
152
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
153
|
+
request?: SecondParameter<typeof customInstance>;
|
|
154
|
+
},
|
|
155
|
+
queryClient?: QueryClient,
|
|
156
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
157
|
+
const queryOptions = useGetChargesQueryOptions(params, options);
|
|
158
|
+
|
|
159
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
160
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
query.queryKey = queryOptions.queryKey;
|
|
132
164
|
|
|
133
165
|
return query;
|
|
134
166
|
}
|
|
135
167
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
168
|
+
export const useGetChargesSuspenseQueryOptions = <
|
|
169
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
170
|
+
TError = ErrorType<void | AsError>,
|
|
171
|
+
>(
|
|
172
|
+
params?: GetChargesParams,
|
|
173
|
+
options?: {
|
|
174
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
175
|
+
request?: SecondParameter<typeof customInstance>;
|
|
176
|
+
},
|
|
139
177
|
) => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges
|
|
157
|
-
export type GetChargesSuspenseQueryError = ErrorType<void | AsError
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
178
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
179
|
+
|
|
180
|
+
const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
|
|
181
|
+
|
|
182
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) =>
|
|
183
|
+
getCharges(params, requestOptions, signal);
|
|
184
|
+
|
|
185
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
186
|
+
|
|
187
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
188
|
+
Awaited<ReturnType<typeof getCharges>>,
|
|
189
|
+
TError,
|
|
190
|
+
TData
|
|
191
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>;
|
|
195
|
+
export type GetChargesSuspenseQueryError = ErrorType<void | AsError>;
|
|
196
|
+
|
|
197
|
+
export function useGetChargesSuspense<
|
|
198
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
199
|
+
TError = ErrorType<void | AsError>,
|
|
200
|
+
>(
|
|
201
|
+
params: undefined | GetChargesParams,
|
|
202
|
+
options: {
|
|
203
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
204
|
+
request?: SecondParameter<typeof customInstance>;
|
|
205
|
+
},
|
|
206
|
+
queryClient?: QueryClient,
|
|
207
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
208
|
+
export function useGetChargesSuspense<
|
|
209
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
210
|
+
TError = ErrorType<void | AsError>,
|
|
211
|
+
>(
|
|
212
|
+
params?: 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, TError> };
|
|
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, TError> };
|
|
172
230
|
/**
|
|
173
231
|
* @summary Gets charges for all Organisations
|
|
174
232
|
*/
|
|
175
233
|
|
|
176
|
-
export function useGetChargesSuspense<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
234
|
+
export function useGetChargesSuspense<
|
|
235
|
+
TData = Awaited<ReturnType<typeof getCharges>>,
|
|
236
|
+
TError = ErrorType<void | AsError>,
|
|
237
|
+
>(
|
|
238
|
+
params?: GetChargesParams,
|
|
239
|
+
options?: {
|
|
240
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>;
|
|
241
|
+
request?: SecondParameter<typeof customInstance>;
|
|
242
|
+
},
|
|
243
|
+
queryClient?: QueryClient,
|
|
244
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
245
|
+
const queryOptions = useGetChargesSuspenseQueryOptions(params, options);
|
|
246
|
+
|
|
247
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
248
|
+
TData,
|
|
249
|
+
TError
|
|
250
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
251
|
+
|
|
252
|
+
query.queryKey = queryOptions.queryKey;
|
|
186
253
|
|
|
187
254
|
return query;
|
|
188
255
|
}
|
|
189
256
|
|
|
190
|
-
|
|
191
|
-
|
|
192
257
|
/**
|
|
193
258
|
* Gets a Organisation charges.
|
|
194
259
|
|
|
@@ -197,156 +262,251 @@ The Organisation cannot be the **Default Organisation** and you need to be a mem
|
|
|
197
262
|
* @summary Gets charges for all Units in an Organisation
|
|
198
263
|
*/
|
|
199
264
|
export const getOrganisationCharges = (
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
265
|
+
orgId: string,
|
|
266
|
+
params?: GetOrganisationChargesParams,
|
|
267
|
+
options?: SecondParameter<typeof customInstance>,
|
|
268
|
+
signal?: AbortSignal,
|
|
203
269
|
) => {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
export const getGetOrganisationChargesQueryKey = (orgId: string,
|
|
215
|
-
params?: GetOrganisationChargesParams,) => {
|
|
216
|
-
return ["account-server-api", `/charges/organisation/${orgId}`, ...(params ? [params]: [])] as const;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
export const getGetOrganisationChargesQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisationCharges>>, TError = ErrorType<void | AsError>>(orgId: string,
|
|
221
|
-
params?: GetOrganisationChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
270
|
+
return customInstance<OrganisationChargesGetResponse>(
|
|
271
|
+
{ url: `/charges/organisation/${orgId}`, method: "GET", params, signal },
|
|
272
|
+
options,
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
export const getGetOrganisationChargesQueryKey = (
|
|
277
|
+
orgId: string,
|
|
278
|
+
params?: GetOrganisationChargesParams,
|
|
222
279
|
) => {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
280
|
+
return [`/charges/organisation/${orgId}`, ...(params ? [params] : [])] as const;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export const useGetOrganisationChargesQueryOptions = <
|
|
284
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
285
|
+
TError = ErrorType<void | AsError>,
|
|
286
|
+
>(
|
|
287
|
+
orgId: string,
|
|
288
|
+
params?: GetOrganisationChargesParams,
|
|
289
|
+
options?: {
|
|
290
|
+
query?: Partial<
|
|
291
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
292
|
+
>;
|
|
293
|
+
request?: SecondParameter<typeof customInstance>;
|
|
294
|
+
},
|
|
295
|
+
) => {
|
|
296
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
297
|
+
|
|
298
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
|
|
299
|
+
|
|
300
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>
|
|
301
|
+
getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
302
|
+
|
|
303
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
304
|
+
|
|
305
|
+
return customOptions as UseQueryOptions<
|
|
306
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
307
|
+
TError,
|
|
308
|
+
TData
|
|
309
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export type GetOrganisationChargesQueryResult = NonNullable<
|
|
313
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
314
|
+
>;
|
|
315
|
+
export type GetOrganisationChargesQueryError = ErrorType<void | AsError>;
|
|
316
|
+
|
|
317
|
+
export function useGetOrganisationCharges<
|
|
318
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
319
|
+
TError = ErrorType<void | AsError>,
|
|
320
|
+
>(
|
|
321
|
+
orgId: string,
|
|
322
|
+
params: undefined | GetOrganisationChargesParams,
|
|
323
|
+
options: {
|
|
324
|
+
query: Partial<
|
|
325
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
326
|
+
> &
|
|
327
|
+
Pick<
|
|
246
328
|
DefinedInitialDataOptions<
|
|
247
329
|
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
248
330
|
TError,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
331
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
332
|
+
>,
|
|
333
|
+
"initialData"
|
|
334
|
+
>;
|
|
335
|
+
request?: SecondParameter<typeof customInstance>;
|
|
336
|
+
},
|
|
337
|
+
queryClient?: QueryClient,
|
|
338
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
339
|
+
export function useGetOrganisationCharges<
|
|
340
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
341
|
+
TError = ErrorType<void | AsError>,
|
|
342
|
+
>(
|
|
343
|
+
orgId: string,
|
|
344
|
+
params?: GetOrganisationChargesParams,
|
|
345
|
+
options?: {
|
|
346
|
+
query?: Partial<
|
|
347
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
348
|
+
> &
|
|
349
|
+
Pick<
|
|
257
350
|
UndefinedInitialDataOptions<
|
|
258
351
|
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
259
352
|
TError,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
353
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
354
|
+
>,
|
|
355
|
+
"initialData"
|
|
356
|
+
>;
|
|
357
|
+
request?: SecondParameter<typeof customInstance>;
|
|
358
|
+
},
|
|
359
|
+
queryClient?: QueryClient,
|
|
360
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
361
|
+
export function useGetOrganisationCharges<
|
|
362
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
363
|
+
TError = ErrorType<void | AsError>,
|
|
364
|
+
>(
|
|
365
|
+
orgId: string,
|
|
366
|
+
params?: GetOrganisationChargesParams,
|
|
367
|
+
options?: {
|
|
368
|
+
query?: Partial<
|
|
369
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
370
|
+
>;
|
|
371
|
+
request?: SecondParameter<typeof customInstance>;
|
|
372
|
+
},
|
|
373
|
+
queryClient?: QueryClient,
|
|
374
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
270
375
|
/**
|
|
271
376
|
* @summary Gets charges for all Units in an Organisation
|
|
272
377
|
*/
|
|
273
378
|
|
|
274
|
-
export function useGetOrganisationCharges<
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
379
|
+
export function useGetOrganisationCharges<
|
|
380
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
381
|
+
TError = ErrorType<void | AsError>,
|
|
382
|
+
>(
|
|
383
|
+
orgId: string,
|
|
384
|
+
params?: GetOrganisationChargesParams,
|
|
385
|
+
options?: {
|
|
386
|
+
query?: Partial<
|
|
387
|
+
UseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
388
|
+
>;
|
|
389
|
+
request?: SecondParameter<typeof customInstance>;
|
|
390
|
+
},
|
|
391
|
+
queryClient?: QueryClient,
|
|
392
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
393
|
+
const queryOptions = useGetOrganisationChargesQueryOptions(orgId, params, options);
|
|
394
|
+
|
|
395
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
396
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
query.queryKey = queryOptions.queryKey;
|
|
285
400
|
|
|
286
401
|
return query;
|
|
287
402
|
}
|
|
288
403
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
404
|
+
export const useGetOrganisationChargesSuspenseQueryOptions = <
|
|
405
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
406
|
+
TError = ErrorType<void | AsError>,
|
|
407
|
+
>(
|
|
408
|
+
orgId: string,
|
|
409
|
+
params?: GetOrganisationChargesParams,
|
|
410
|
+
options?: {
|
|
411
|
+
query?: Partial<
|
|
412
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
413
|
+
>;
|
|
414
|
+
request?: SecondParameter<typeof customInstance>;
|
|
415
|
+
},
|
|
293
416
|
) => {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export type GetOrganisationChargesSuspenseQueryResult = NonNullable<
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
417
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
418
|
+
|
|
419
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationChargesQueryKey(orgId, params);
|
|
420
|
+
|
|
421
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationCharges>>> = ({ signal }) =>
|
|
422
|
+
getOrganisationCharges(orgId, params, requestOptions, signal);
|
|
423
|
+
|
|
424
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
425
|
+
|
|
426
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
427
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
428
|
+
TError,
|
|
429
|
+
TData
|
|
430
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
export type GetOrganisationChargesSuspenseQueryResult = NonNullable<
|
|
434
|
+
Awaited<ReturnType<typeof getOrganisationCharges>>
|
|
435
|
+
>;
|
|
436
|
+
export type GetOrganisationChargesSuspenseQueryError = ErrorType<void | AsError>;
|
|
437
|
+
|
|
438
|
+
export function useGetOrganisationChargesSuspense<
|
|
439
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
440
|
+
TError = ErrorType<void | AsError>,
|
|
441
|
+
>(
|
|
442
|
+
orgId: string,
|
|
443
|
+
params: undefined | GetOrganisationChargesParams,
|
|
444
|
+
options: {
|
|
445
|
+
query: Partial<
|
|
446
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
447
|
+
>;
|
|
448
|
+
request?: SecondParameter<typeof customInstance>;
|
|
449
|
+
},
|
|
450
|
+
queryClient?: QueryClient,
|
|
451
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
452
|
+
export function useGetOrganisationChargesSuspense<
|
|
453
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
454
|
+
TError = ErrorType<void | AsError>,
|
|
455
|
+
>(
|
|
456
|
+
orgId: string,
|
|
457
|
+
params?: GetOrganisationChargesParams,
|
|
458
|
+
options?: {
|
|
459
|
+
query?: Partial<
|
|
460
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
461
|
+
>;
|
|
462
|
+
request?: SecondParameter<typeof customInstance>;
|
|
463
|
+
},
|
|
464
|
+
queryClient?: QueryClient,
|
|
465
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
466
|
+
export function useGetOrganisationChargesSuspense<
|
|
467
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
468
|
+
TError = ErrorType<void | AsError>,
|
|
469
|
+
>(
|
|
470
|
+
orgId: string,
|
|
471
|
+
params?: GetOrganisationChargesParams,
|
|
472
|
+
options?: {
|
|
473
|
+
query?: Partial<
|
|
474
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
475
|
+
>;
|
|
476
|
+
request?: SecondParameter<typeof customInstance>;
|
|
477
|
+
},
|
|
478
|
+
queryClient?: QueryClient,
|
|
479
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
329
480
|
/**
|
|
330
481
|
* @summary Gets charges for all Units in an Organisation
|
|
331
482
|
*/
|
|
332
483
|
|
|
333
|
-
export function useGetOrganisationChargesSuspense<
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
484
|
+
export function useGetOrganisationChargesSuspense<
|
|
485
|
+
TData = Awaited<ReturnType<typeof getOrganisationCharges>>,
|
|
486
|
+
TError = ErrorType<void | AsError>,
|
|
487
|
+
>(
|
|
488
|
+
orgId: string,
|
|
489
|
+
params?: GetOrganisationChargesParams,
|
|
490
|
+
options?: {
|
|
491
|
+
query?: Partial<
|
|
492
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationCharges>>, TError, TData>
|
|
493
|
+
>;
|
|
494
|
+
request?: SecondParameter<typeof customInstance>;
|
|
495
|
+
},
|
|
496
|
+
queryClient?: QueryClient,
|
|
497
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
498
|
+
const queryOptions = useGetOrganisationChargesSuspenseQueryOptions(orgId, params, options);
|
|
499
|
+
|
|
500
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
501
|
+
TData,
|
|
502
|
+
TError
|
|
503
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
504
|
+
|
|
505
|
+
query.queryKey = queryOptions.queryKey;
|
|
344
506
|
|
|
345
507
|
return query;
|
|
346
508
|
}
|
|
347
509
|
|
|
348
|
-
|
|
349
|
-
|
|
350
510
|
/**
|
|
351
511
|
* Get the charges made against a Product with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
352
512
|
|
|
@@ -358,156 +518,241 @@ You need to be part of the **Unit** or **Organisation** to use this method
|
|
|
358
518
|
* @summary Get charges made against a Product
|
|
359
519
|
*/
|
|
360
520
|
export const getProductCharges = (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
521
|
+
productId: string,
|
|
522
|
+
params?: GetProductChargesParams,
|
|
523
|
+
options?: SecondParameter<typeof customInstance>,
|
|
524
|
+
signal?: AbortSignal,
|
|
364
525
|
) => {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
export const getGetProductChargesQueryKey = (productId: string,
|
|
376
|
-
params?: GetProductChargesParams,) => {
|
|
377
|
-
return ["account-server-api", `/charges/product/${productId}`, ...(params ? [params]: [])] as const;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
export const getGetProductChargesQueryOptions = <TData = Awaited<ReturnType<typeof getProductCharges>>, TError = ErrorType<AsError | void>>(productId: string,
|
|
382
|
-
params?: GetProductChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
526
|
+
return customInstance<ProductChargesGetResponse>(
|
|
527
|
+
{ url: `/charges/product/${productId}`, method: "GET", params, signal },
|
|
528
|
+
options,
|
|
529
|
+
);
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
export const getGetProductChargesQueryKey = (
|
|
533
|
+
productId: string,
|
|
534
|
+
params?: GetProductChargesParams,
|
|
383
535
|
) => {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
536
|
+
return [`/charges/product/${productId}`, ...(params ? [params] : [])] as const;
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
export const useGetProductChargesQueryOptions = <
|
|
540
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
541
|
+
TError = ErrorType<AsError | void>,
|
|
542
|
+
>(
|
|
543
|
+
productId: string,
|
|
544
|
+
params?: GetProductChargesParams,
|
|
545
|
+
options?: {
|
|
546
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
547
|
+
request?: SecondParameter<typeof customInstance>;
|
|
548
|
+
},
|
|
549
|
+
) => {
|
|
550
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
551
|
+
|
|
552
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);
|
|
553
|
+
|
|
554
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>
|
|
555
|
+
getProductCharges(productId, params, requestOptions, signal);
|
|
556
|
+
|
|
557
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
558
|
+
|
|
559
|
+
return customOptions as UseQueryOptions<
|
|
560
|
+
Awaited<ReturnType<typeof getProductCharges>>,
|
|
561
|
+
TError,
|
|
562
|
+
TData
|
|
563
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
export type GetProductChargesQueryResult = NonNullable<
|
|
567
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
568
|
+
>;
|
|
569
|
+
export type GetProductChargesQueryError = ErrorType<AsError | void>;
|
|
570
|
+
|
|
571
|
+
export function useGetProductCharges<
|
|
572
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
573
|
+
TError = ErrorType<AsError | void>,
|
|
574
|
+
>(
|
|
575
|
+
productId: string,
|
|
576
|
+
params: undefined | GetProductChargesParams,
|
|
577
|
+
options: {
|
|
578
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &
|
|
579
|
+
Pick<
|
|
407
580
|
DefinedInitialDataOptions<
|
|
408
581
|
Awaited<ReturnType<typeof getProductCharges>>,
|
|
409
582
|
TError,
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
583
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
584
|
+
>,
|
|
585
|
+
"initialData"
|
|
586
|
+
>;
|
|
587
|
+
request?: SecondParameter<typeof customInstance>;
|
|
588
|
+
},
|
|
589
|
+
queryClient?: QueryClient,
|
|
590
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
591
|
+
export function useGetProductCharges<
|
|
592
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
593
|
+
TError = ErrorType<AsError | void>,
|
|
594
|
+
>(
|
|
595
|
+
productId: string,
|
|
596
|
+
params?: GetProductChargesParams,
|
|
597
|
+
options?: {
|
|
598
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>> &
|
|
599
|
+
Pick<
|
|
418
600
|
UndefinedInitialDataOptions<
|
|
419
601
|
Awaited<ReturnType<typeof getProductCharges>>,
|
|
420
602
|
TError,
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
603
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
604
|
+
>,
|
|
605
|
+
"initialData"
|
|
606
|
+
>;
|
|
607
|
+
request?: SecondParameter<typeof customInstance>;
|
|
608
|
+
},
|
|
609
|
+
queryClient?: QueryClient,
|
|
610
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
611
|
+
export function useGetProductCharges<
|
|
612
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
613
|
+
TError = ErrorType<AsError | void>,
|
|
614
|
+
>(
|
|
615
|
+
productId: string,
|
|
616
|
+
params?: GetProductChargesParams,
|
|
617
|
+
options?: {
|
|
618
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
619
|
+
request?: SecondParameter<typeof customInstance>;
|
|
620
|
+
},
|
|
621
|
+
queryClient?: QueryClient,
|
|
622
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
431
623
|
/**
|
|
432
624
|
* @summary Get charges made against a Product
|
|
433
625
|
*/
|
|
434
626
|
|
|
435
|
-
export function useGetProductCharges<
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
627
|
+
export function useGetProductCharges<
|
|
628
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
629
|
+
TError = ErrorType<AsError | void>,
|
|
630
|
+
>(
|
|
631
|
+
productId: string,
|
|
632
|
+
params?: GetProductChargesParams,
|
|
633
|
+
options?: {
|
|
634
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>>;
|
|
635
|
+
request?: SecondParameter<typeof customInstance>;
|
|
636
|
+
},
|
|
637
|
+
queryClient?: QueryClient,
|
|
638
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
639
|
+
const queryOptions = useGetProductChargesQueryOptions(productId, params, options);
|
|
640
|
+
|
|
641
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
642
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
query.queryKey = queryOptions.queryKey;
|
|
446
646
|
|
|
447
647
|
return query;
|
|
448
648
|
}
|
|
449
649
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
650
|
+
export const useGetProductChargesSuspenseQueryOptions = <
|
|
651
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
652
|
+
TError = ErrorType<AsError | void>,
|
|
653
|
+
>(
|
|
654
|
+
productId: string,
|
|
655
|
+
params?: GetProductChargesParams,
|
|
656
|
+
options?: {
|
|
657
|
+
query?: Partial<
|
|
658
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
659
|
+
>;
|
|
660
|
+
request?: SecondParameter<typeof customInstance>;
|
|
661
|
+
},
|
|
454
662
|
) => {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
export type GetProductChargesSuspenseQueryResult = NonNullable<
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
663
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
664
|
+
|
|
665
|
+
const queryKey = queryOptions?.queryKey ?? getGetProductChargesQueryKey(productId, params);
|
|
666
|
+
|
|
667
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getProductCharges>>> = ({ signal }) =>
|
|
668
|
+
getProductCharges(productId, params, requestOptions, signal);
|
|
669
|
+
|
|
670
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
671
|
+
|
|
672
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
673
|
+
Awaited<ReturnType<typeof getProductCharges>>,
|
|
674
|
+
TError,
|
|
675
|
+
TData
|
|
676
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
export type GetProductChargesSuspenseQueryResult = NonNullable<
|
|
680
|
+
Awaited<ReturnType<typeof getProductCharges>>
|
|
681
|
+
>;
|
|
682
|
+
export type GetProductChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
683
|
+
|
|
684
|
+
export function useGetProductChargesSuspense<
|
|
685
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
686
|
+
TError = ErrorType<AsError | void>,
|
|
687
|
+
>(
|
|
688
|
+
productId: string,
|
|
689
|
+
params: undefined | GetProductChargesParams,
|
|
690
|
+
options: {
|
|
691
|
+
query: Partial<
|
|
692
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
693
|
+
>;
|
|
694
|
+
request?: SecondParameter<typeof customInstance>;
|
|
695
|
+
},
|
|
696
|
+
queryClient?: QueryClient,
|
|
697
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
698
|
+
export function useGetProductChargesSuspense<
|
|
699
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
700
|
+
TError = ErrorType<AsError | void>,
|
|
701
|
+
>(
|
|
702
|
+
productId: string,
|
|
703
|
+
params?: GetProductChargesParams,
|
|
704
|
+
options?: {
|
|
705
|
+
query?: Partial<
|
|
706
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
707
|
+
>;
|
|
708
|
+
request?: SecondParameter<typeof customInstance>;
|
|
709
|
+
},
|
|
710
|
+
queryClient?: QueryClient,
|
|
711
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
712
|
+
export function useGetProductChargesSuspense<
|
|
713
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
714
|
+
TError = ErrorType<AsError | void>,
|
|
715
|
+
>(
|
|
716
|
+
productId: string,
|
|
717
|
+
params?: GetProductChargesParams,
|
|
718
|
+
options?: {
|
|
719
|
+
query?: Partial<
|
|
720
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
721
|
+
>;
|
|
722
|
+
request?: SecondParameter<typeof customInstance>;
|
|
723
|
+
},
|
|
724
|
+
queryClient?: QueryClient,
|
|
725
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
490
726
|
/**
|
|
491
727
|
* @summary Get charges made against a Product
|
|
492
728
|
*/
|
|
493
729
|
|
|
494
|
-
export function useGetProductChargesSuspense<
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
730
|
+
export function useGetProductChargesSuspense<
|
|
731
|
+
TData = Awaited<ReturnType<typeof getProductCharges>>,
|
|
732
|
+
TError = ErrorType<AsError | void>,
|
|
733
|
+
>(
|
|
734
|
+
productId: string,
|
|
735
|
+
params?: GetProductChargesParams,
|
|
736
|
+
options?: {
|
|
737
|
+
query?: Partial<
|
|
738
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getProductCharges>>, TError, TData>
|
|
739
|
+
>;
|
|
740
|
+
request?: SecondParameter<typeof customInstance>;
|
|
741
|
+
},
|
|
742
|
+
queryClient?: QueryClient,
|
|
743
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
744
|
+
const queryOptions = useGetProductChargesSuspenseQueryOptions(productId, params, options);
|
|
745
|
+
|
|
746
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
747
|
+
TData,
|
|
748
|
+
TError
|
|
749
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
750
|
+
|
|
751
|
+
query.queryKey = queryOptions.queryKey;
|
|
505
752
|
|
|
506
753
|
return query;
|
|
507
754
|
}
|
|
508
755
|
|
|
509
|
-
|
|
510
|
-
|
|
511
756
|
/**
|
|
512
757
|
* Get the charges made against a Unit with optional **from** (inclusive) and **until** (exclusive) dates. If no dates are provided, the charges for the current billing period are returned.
|
|
513
758
|
Dates are interpreted using the Python `dateutil` parser, so the input strings are extremely flexible with, for example, `1 December 2021` as an acceptable input.
|
|
@@ -518,153 +763,232 @@ You need to be part of the **Unit** or **Organisation** to use this method
|
|
|
518
763
|
* @summary Get charges made against a Unit
|
|
519
764
|
*/
|
|
520
765
|
export const getUnitCharges = (
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
766
|
+
unitId: string,
|
|
767
|
+
params?: GetUnitChargesParams,
|
|
768
|
+
options?: SecondParameter<typeof customInstance>,
|
|
769
|
+
signal?: AbortSignal,
|
|
524
770
|
) => {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
export const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
771
|
+
return customInstance<UnitChargesGetResponse>(
|
|
772
|
+
{ url: `/charges/unit/${unitId}`, method: "GET", params, signal },
|
|
773
|
+
options,
|
|
774
|
+
);
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
export const getGetUnitChargesQueryKey = (unitId: string, params?: GetUnitChargesParams) => {
|
|
778
|
+
return [`/charges/unit/${unitId}`, ...(params ? [params] : [])] as const;
|
|
779
|
+
};
|
|
780
|
+
|
|
781
|
+
export const useGetUnitChargesQueryOptions = <
|
|
782
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
783
|
+
TError = ErrorType<AsError | void>,
|
|
784
|
+
>(
|
|
785
|
+
unitId: string,
|
|
786
|
+
params?: GetUnitChargesParams,
|
|
787
|
+
options?: {
|
|
788
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
789
|
+
request?: SecondParameter<typeof customInstance>;
|
|
790
|
+
},
|
|
543
791
|
) => {
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
export type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges
|
|
561
|
-
export type GetUnitChargesQueryError = ErrorType<AsError | void
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
792
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
793
|
+
|
|
794
|
+
const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);
|
|
795
|
+
|
|
796
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>
|
|
797
|
+
getUnitCharges(unitId, params, requestOptions, signal);
|
|
798
|
+
|
|
799
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
800
|
+
|
|
801
|
+
return customOptions as UseQueryOptions<
|
|
802
|
+
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
803
|
+
TError,
|
|
804
|
+
TData
|
|
805
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
export type GetUnitChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getUnitCharges>>>;
|
|
809
|
+
export type GetUnitChargesQueryError = ErrorType<AsError | void>;
|
|
810
|
+
|
|
811
|
+
export function useGetUnitCharges<
|
|
812
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
813
|
+
TError = ErrorType<AsError | void>,
|
|
814
|
+
>(
|
|
815
|
+
unitId: string,
|
|
816
|
+
params: undefined | GetUnitChargesParams,
|
|
817
|
+
options: {
|
|
818
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &
|
|
819
|
+
Pick<
|
|
567
820
|
DefinedInitialDataOptions<
|
|
568
821
|
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
569
822
|
TError,
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
823
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
824
|
+
>,
|
|
825
|
+
"initialData"
|
|
826
|
+
>;
|
|
827
|
+
request?: SecondParameter<typeof customInstance>;
|
|
828
|
+
},
|
|
829
|
+
queryClient?: QueryClient,
|
|
830
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
831
|
+
export function useGetUnitCharges<
|
|
832
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
833
|
+
TError = ErrorType<AsError | void>,
|
|
834
|
+
>(
|
|
835
|
+
unitId: string,
|
|
836
|
+
params?: GetUnitChargesParams,
|
|
837
|
+
options?: {
|
|
838
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>> &
|
|
839
|
+
Pick<
|
|
578
840
|
UndefinedInitialDataOptions<
|
|
579
841
|
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
580
842
|
TError,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
843
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
844
|
+
>,
|
|
845
|
+
"initialData"
|
|
846
|
+
>;
|
|
847
|
+
request?: SecondParameter<typeof customInstance>;
|
|
848
|
+
},
|
|
849
|
+
queryClient?: QueryClient,
|
|
850
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
851
|
+
export function useGetUnitCharges<
|
|
852
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
853
|
+
TError = ErrorType<AsError | void>,
|
|
854
|
+
>(
|
|
855
|
+
unitId: string,
|
|
856
|
+
params?: GetUnitChargesParams,
|
|
857
|
+
options?: {
|
|
858
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
859
|
+
request?: SecondParameter<typeof customInstance>;
|
|
860
|
+
},
|
|
861
|
+
queryClient?: QueryClient,
|
|
862
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
591
863
|
/**
|
|
592
864
|
* @summary Get charges made against a Unit
|
|
593
865
|
*/
|
|
594
866
|
|
|
595
|
-
export function useGetUnitCharges<
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
867
|
+
export function useGetUnitCharges<
|
|
868
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
869
|
+
TError = ErrorType<AsError | void>,
|
|
870
|
+
>(
|
|
871
|
+
unitId: string,
|
|
872
|
+
params?: GetUnitChargesParams,
|
|
873
|
+
options?: {
|
|
874
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>>;
|
|
875
|
+
request?: SecondParameter<typeof customInstance>;
|
|
876
|
+
},
|
|
877
|
+
queryClient?: QueryClient,
|
|
878
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
879
|
+
const queryOptions = useGetUnitChargesQueryOptions(unitId, params, options);
|
|
880
|
+
|
|
881
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
882
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
query.queryKey = queryOptions.queryKey;
|
|
606
886
|
|
|
607
887
|
return query;
|
|
608
888
|
}
|
|
609
889
|
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
890
|
+
export const useGetUnitChargesSuspenseQueryOptions = <
|
|
891
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
892
|
+
TError = ErrorType<AsError | void>,
|
|
893
|
+
>(
|
|
894
|
+
unitId: string,
|
|
895
|
+
params?: GetUnitChargesParams,
|
|
896
|
+
options?: {
|
|
897
|
+
query?: Partial<
|
|
898
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
899
|
+
>;
|
|
900
|
+
request?: SecondParameter<typeof customInstance>;
|
|
901
|
+
},
|
|
614
902
|
) => {
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
export type GetUnitChargesSuspenseQueryResult = NonNullable<
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
903
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
904
|
+
|
|
905
|
+
const queryKey = queryOptions?.queryKey ?? getGetUnitChargesQueryKey(unitId, params);
|
|
906
|
+
|
|
907
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnitCharges>>> = ({ signal }) =>
|
|
908
|
+
getUnitCharges(unitId, params, requestOptions, signal);
|
|
909
|
+
|
|
910
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
911
|
+
|
|
912
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
913
|
+
Awaited<ReturnType<typeof getUnitCharges>>,
|
|
914
|
+
TError,
|
|
915
|
+
TData
|
|
916
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
917
|
+
};
|
|
918
|
+
|
|
919
|
+
export type GetUnitChargesSuspenseQueryResult = NonNullable<
|
|
920
|
+
Awaited<ReturnType<typeof getUnitCharges>>
|
|
921
|
+
>;
|
|
922
|
+
export type GetUnitChargesSuspenseQueryError = ErrorType<AsError | void>;
|
|
923
|
+
|
|
924
|
+
export function useGetUnitChargesSuspense<
|
|
925
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
926
|
+
TError = ErrorType<AsError | void>,
|
|
927
|
+
>(
|
|
928
|
+
unitId: string,
|
|
929
|
+
params: undefined | GetUnitChargesParams,
|
|
930
|
+
options: {
|
|
931
|
+
query: Partial<
|
|
932
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
933
|
+
>;
|
|
934
|
+
request?: SecondParameter<typeof customInstance>;
|
|
935
|
+
},
|
|
936
|
+
queryClient?: QueryClient,
|
|
937
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
938
|
+
export function useGetUnitChargesSuspense<
|
|
939
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
940
|
+
TError = ErrorType<AsError | void>,
|
|
941
|
+
>(
|
|
942
|
+
unitId: string,
|
|
943
|
+
params?: GetUnitChargesParams,
|
|
944
|
+
options?: {
|
|
945
|
+
query?: Partial<
|
|
946
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
947
|
+
>;
|
|
948
|
+
request?: SecondParameter<typeof customInstance>;
|
|
949
|
+
},
|
|
950
|
+
queryClient?: QueryClient,
|
|
951
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
952
|
+
export function useGetUnitChargesSuspense<
|
|
953
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
954
|
+
TError = ErrorType<AsError | void>,
|
|
955
|
+
>(
|
|
956
|
+
unitId: string,
|
|
957
|
+
params?: GetUnitChargesParams,
|
|
958
|
+
options?: {
|
|
959
|
+
query?: Partial<
|
|
960
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
961
|
+
>;
|
|
962
|
+
request?: SecondParameter<typeof customInstance>;
|
|
963
|
+
},
|
|
964
|
+
queryClient?: QueryClient,
|
|
965
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
650
966
|
/**
|
|
651
967
|
* @summary Get charges made against a Unit
|
|
652
968
|
*/
|
|
653
969
|
|
|
654
|
-
export function useGetUnitChargesSuspense<
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
970
|
+
export function useGetUnitChargesSuspense<
|
|
971
|
+
TData = Awaited<ReturnType<typeof getUnitCharges>>,
|
|
972
|
+
TError = ErrorType<AsError | void>,
|
|
973
|
+
>(
|
|
974
|
+
unitId: string,
|
|
975
|
+
params?: GetUnitChargesParams,
|
|
976
|
+
options?: {
|
|
977
|
+
query?: Partial<
|
|
978
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUnitCharges>>, TError, TData>
|
|
979
|
+
>;
|
|
980
|
+
request?: SecondParameter<typeof customInstance>;
|
|
981
|
+
},
|
|
982
|
+
queryClient?: QueryClient,
|
|
983
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
984
|
+
const queryOptions = useGetUnitChargesSuspenseQueryOptions(unitId, params, options);
|
|
985
|
+
|
|
986
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
987
|
+
TData,
|
|
988
|
+
TError
|
|
989
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
990
|
+
|
|
991
|
+
query.queryKey = queryOptions.queryKey;
|
|
665
992
|
|
|
666
993
|
return query;
|
|
667
994
|
}
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|