@squonk/account-server-client 4.4.0-4-4.2197467763 → 4.4.0-4-4.2200269934
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/actions/actions.cjs +4 -4
- package/dist/api/actions/actions.cjs.map +1 -1
- package/dist/api/actions/actions.d.cts +35 -17
- package/dist/api/actions/actions.d.cts.map +1 -1
- package/dist/api/actions/actions.d.ts +35 -17
- package/dist/api/actions/actions.d.ts.map +1 -1
- package/dist/api/actions/actions.fetch.cjs +4 -4
- package/dist/api/actions/actions.fetch.cjs.map +1 -1
- package/dist/api/actions/actions.fetch.d.cts +35 -17
- package/dist/api/actions/actions.fetch.d.cts.map +1 -1
- package/dist/api/actions/actions.fetch.d.ts +35 -17
- package/dist/api/actions/actions.fetch.d.ts.map +1 -1
- package/dist/api/actions/actions.fetch.js +4 -4
- package/dist/api/actions/actions.fetch.js.map +1 -1
- package/dist/api/actions/actions.js +4 -4
- package/dist/api/actions/actions.js.map +1 -1
- package/dist/api/asset/asset.cjs +22 -22
- package/dist/api/asset/asset.cjs.map +1 -1
- package/dist/api/asset/asset.d.cts +76 -40
- package/dist/api/asset/asset.d.cts.map +1 -1
- package/dist/api/asset/asset.d.ts +76 -40
- package/dist/api/asset/asset.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.cjs +22 -22
- package/dist/api/asset/asset.fetch.cjs.map +1 -1
- package/dist/api/asset/asset.fetch.d.cts +76 -40
- package/dist/api/asset/asset.fetch.d.cts.map +1 -1
- package/dist/api/asset/asset.fetch.d.ts +76 -40
- package/dist/api/asset/asset.fetch.d.ts.map +1 -1
- package/dist/api/asset/asset.fetch.js +22 -22
- package/dist/api/asset/asset.fetch.js.map +1 -1
- package/dist/api/asset/asset.js +22 -22
- package/dist/api/asset/asset.js.map +1 -1
- package/dist/api/charges/charges.cjs +16 -16
- package/dist/api/charges/charges.cjs.map +1 -1
- package/dist/api/charges/charges.d.cts +137 -65
- package/dist/api/charges/charges.d.cts.map +1 -1
- package/dist/api/charges/charges.d.ts +137 -65
- package/dist/api/charges/charges.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.cjs +16 -16
- package/dist/api/charges/charges.fetch.cjs.map +1 -1
- package/dist/api/charges/charges.fetch.d.cts +137 -65
- package/dist/api/charges/charges.fetch.d.cts.map +1 -1
- package/dist/api/charges/charges.fetch.d.ts +137 -65
- package/dist/api/charges/charges.fetch.d.ts.map +1 -1
- package/dist/api/charges/charges.fetch.js +16 -16
- package/dist/api/charges/charges.fetch.js.map +1 -1
- package/dist/api/charges/charges.js +16 -16
- package/dist/api/charges/charges.js.map +1 -1
- package/dist/api/event-stream/event-stream.cjs +12 -12
- package/dist/api/event-stream/event-stream.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.d.cts +71 -35
- package/dist/api/event-stream/event-stream.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.d.ts +71 -35
- package/dist/api/event-stream/event-stream.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.cjs +12 -12
- package/dist/api/event-stream/event-stream.fetch.cjs.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.d.cts +71 -35
- package/dist/api/event-stream/event-stream.fetch.d.cts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.d.ts +71 -35
- package/dist/api/event-stream/event-stream.fetch.d.ts.map +1 -1
- package/dist/api/event-stream/event-stream.fetch.js +12 -12
- package/dist/api/event-stream/event-stream.fetch.js.map +1 -1
- package/dist/api/event-stream/event-stream.js +12 -12
- package/dist/api/event-stream/event-stream.js.map +1 -1
- package/dist/api/merchant/merchant.cjs +8 -8
- package/dist/api/merchant/merchant.cjs.map +1 -1
- package/dist/api/merchant/merchant.d.cts +69 -33
- package/dist/api/merchant/merchant.d.cts.map +1 -1
- package/dist/api/merchant/merchant.d.ts +69 -33
- package/dist/api/merchant/merchant.d.ts.map +1 -1
- package/dist/api/merchant/merchant.fetch.cjs +8 -8
- package/dist/api/merchant/merchant.fetch.cjs.map +1 -1
- package/dist/api/merchant/merchant.fetch.d.cts +69 -33
- package/dist/api/merchant/merchant.fetch.d.cts.map +1 -1
- package/dist/api/merchant/merchant.fetch.d.ts +69 -33
- package/dist/api/merchant/merchant.fetch.d.ts.map +1 -1
- package/dist/api/merchant/merchant.fetch.js +8 -8
- package/dist/api/merchant/merchant.fetch.js.map +1 -1
- package/dist/api/merchant/merchant.js +8 -8
- package/dist/api/merchant/merchant.js.map +1 -1
- package/dist/api/organisation/organisation.cjs +18 -18
- package/dist/api/organisation/organisation.cjs.map +1 -1
- package/dist/api/organisation/organisation.d.cts +106 -52
- package/dist/api/organisation/organisation.d.cts.map +1 -1
- package/dist/api/organisation/organisation.d.ts +106 -52
- package/dist/api/organisation/organisation.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.cjs +18 -18
- package/dist/api/organisation/organisation.fetch.cjs.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.cts +106 -52
- package/dist/api/organisation/organisation.fetch.d.cts.map +1 -1
- package/dist/api/organisation/organisation.fetch.d.ts +106 -52
- package/dist/api/organisation/organisation.fetch.d.ts.map +1 -1
- package/dist/api/organisation/organisation.fetch.js +18 -18
- package/dist/api/organisation/organisation.fetch.js.map +1 -1
- package/dist/api/organisation/organisation.js +18 -18
- package/dist/api/organisation/organisation.js.map +1 -1
- package/dist/api/product/product.cjs +30 -30
- package/dist/api/product/product.cjs.map +1 -1
- package/dist/api/product/product.d.cts +208 -100
- package/dist/api/product/product.d.cts.map +1 -1
- package/dist/api/product/product.d.ts +208 -100
- package/dist/api/product/product.d.ts.map +1 -1
- package/dist/api/product/product.fetch.cjs +30 -30
- package/dist/api/product/product.fetch.cjs.map +1 -1
- package/dist/api/product/product.fetch.d.cts +208 -100
- package/dist/api/product/product.fetch.d.cts.map +1 -1
- package/dist/api/product/product.fetch.d.ts +208 -100
- package/dist/api/product/product.fetch.d.ts.map +1 -1
- package/dist/api/product/product.fetch.js +30 -30
- package/dist/api/product/product.fetch.js.map +1 -1
- package/dist/api/product/product.js +30 -30
- package/dist/api/product/product.js.map +1 -1
- package/dist/api/state/state.cjs +4 -4
- package/dist/api/state/state.cjs.map +1 -1
- package/dist/api/state/state.d.cts +35 -17
- package/dist/api/state/state.d.cts.map +1 -1
- package/dist/api/state/state.d.ts +35 -17
- package/dist/api/state/state.d.ts.map +1 -1
- package/dist/api/state/state.fetch.cjs +4 -4
- package/dist/api/state/state.fetch.cjs.map +1 -1
- package/dist/api/state/state.fetch.d.cts +35 -17
- package/dist/api/state/state.fetch.d.cts.map +1 -1
- package/dist/api/state/state.fetch.d.ts +35 -17
- package/dist/api/state/state.fetch.d.ts.map +1 -1
- package/dist/api/state/state.fetch.js +4 -4
- package/dist/api/state/state.fetch.js.map +1 -1
- package/dist/api/state/state.js +4 -4
- package/dist/api/state/state.js.map +1 -1
- package/dist/api/unit/unit.cjs +30 -30
- package/dist/api/unit/unit.cjs.map +1 -1
- package/dist/api/unit/unit.d.cts +144 -72
- package/dist/api/unit/unit.d.cts.map +1 -1
- package/dist/api/unit/unit.d.ts +144 -72
- package/dist/api/unit/unit.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.cjs +30 -30
- package/dist/api/unit/unit.fetch.cjs.map +1 -1
- package/dist/api/unit/unit.fetch.d.cts +144 -72
- package/dist/api/unit/unit.fetch.d.cts.map +1 -1
- package/dist/api/unit/unit.fetch.d.ts +144 -72
- package/dist/api/unit/unit.fetch.d.ts.map +1 -1
- package/dist/api/unit/unit.fetch.js +30 -30
- package/dist/api/unit/unit.fetch.js.map +1 -1
- package/dist/api/unit/unit.js +30 -30
- package/dist/api/unit/unit.js.map +1 -1
- package/dist/api/user/user.cjs +20 -20
- package/dist/api/user/user.cjs.map +1 -1
- package/dist/api/user/user.d.cts +107 -53
- package/dist/api/user/user.d.cts.map +1 -1
- package/dist/api/user/user.d.ts +107 -53
- package/dist/api/user/user.d.ts.map +1 -1
- package/dist/api/user/user.fetch.cjs +20 -20
- package/dist/api/user/user.fetch.cjs.map +1 -1
- package/dist/api/user/user.fetch.d.cts +107 -53
- package/dist/api/user/user.fetch.d.cts.map +1 -1
- package/dist/api/user/user.fetch.d.ts +107 -53
- package/dist/api/user/user.fetch.d.ts.map +1 -1
- package/dist/api/user/user.fetch.js +20 -20
- package/dist/api/user/user.fetch.js.map +1 -1
- package/dist/api/user/user.js +20 -20
- package/dist/api/user/user.js.map +1 -1
- package/package.json +7 -5
- package/src/api/actions/actions.fetch.ts +103 -12
- package/src/api/actions/actions.ts +103 -12
- package/src/api/asset/asset.fetch.ts +303 -94
- package/src/api/asset/asset.ts +303 -94
- package/src/api/charges/charges.fetch.ts +456 -54
- package/src/api/charges/charges.ts +456 -54
- package/src/api/event-stream/event-stream.fetch.ts +262 -58
- package/src/api/event-stream/event-stream.ts +262 -58
- package/src/api/merchant/merchant.fetch.ts +212 -28
- package/src/api/merchant/merchant.ts +212 -28
- package/src/api/organisation/organisation.fetch.ts +381 -86
- package/src/api/organisation/organisation.ts +381 -86
- package/src/api/product/product.fetch.ts +724 -130
- package/src/api/product/product.ts +724 -130
- package/src/api/state/state.fetch.ts +105 -16
- package/src/api/state/state.ts +105 -16
- package/src/api/unit/unit.fetch.ts +521 -146
- package/src/api/unit/unit.ts +521 -146
- package/src/api/user/user.fetch.ts +401 -101
- package/src/api/user/user.ts +401 -101
- package/tests/README.md +98 -0
- package/tests/component.test.tsx +191 -0
- package/tests/tsconfig.json +7 -0
- package/tests/type-tests.tsx +196 -0
|
@@ -10,10 +10,14 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
10
10
|
*/
|
|
11
11
|
import { useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
13
|
+
DataTag,
|
|
14
|
+
DefinedInitialDataOptions,
|
|
15
|
+
DefinedUseQueryResult,
|
|
13
16
|
InvalidateOptions,
|
|
14
17
|
QueryClient,
|
|
15
18
|
QueryFunction,
|
|
16
19
|
QueryKey,
|
|
20
|
+
UndefinedInitialDataOptions,
|
|
17
21
|
UseQueryOptions,
|
|
18
22
|
UseQueryResult,
|
|
19
23
|
UseSuspenseQueryOptions,
|
|
@@ -63,7 +67,7 @@ export const getGetVersionQueryOptions = <
|
|
|
63
67
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
64
68
|
TError = ErrorType<AsError | void>,
|
|
65
69
|
>(options?: {
|
|
66
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData
|
|
70
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
67
71
|
request?: SecondParameter<typeof customFetch>;
|
|
68
72
|
}) => {
|
|
69
73
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -77,12 +81,58 @@ export const getGetVersionQueryOptions = <
|
|
|
77
81
|
Awaited<ReturnType<typeof getVersion>>,
|
|
78
82
|
TError,
|
|
79
83
|
TData
|
|
80
|
-
> & { queryKey: QueryKey };
|
|
84
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
81
85
|
};
|
|
82
86
|
|
|
83
87
|
export type GetVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>;
|
|
84
88
|
export type GetVersionQueryError = ErrorType<AsError | void>;
|
|
85
89
|
|
|
90
|
+
export function useGetVersion<
|
|
91
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
92
|
+
TError = ErrorType<AsError | void>,
|
|
93
|
+
>(
|
|
94
|
+
options: {
|
|
95
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>> &
|
|
96
|
+
Pick<
|
|
97
|
+
DefinedInitialDataOptions<
|
|
98
|
+
Awaited<ReturnType<typeof getVersion>>,
|
|
99
|
+
TError,
|
|
100
|
+
Awaited<ReturnType<typeof getVersion>>
|
|
101
|
+
>,
|
|
102
|
+
"initialData"
|
|
103
|
+
>;
|
|
104
|
+
request?: SecondParameter<typeof customFetch>;
|
|
105
|
+
},
|
|
106
|
+
queryClient?: QueryClient,
|
|
107
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
108
|
+
export function useGetVersion<
|
|
109
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
110
|
+
TError = ErrorType<AsError | void>,
|
|
111
|
+
>(
|
|
112
|
+
options?: {
|
|
113
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>> &
|
|
114
|
+
Pick<
|
|
115
|
+
UndefinedInitialDataOptions<
|
|
116
|
+
Awaited<ReturnType<typeof getVersion>>,
|
|
117
|
+
TError,
|
|
118
|
+
Awaited<ReturnType<typeof getVersion>>
|
|
119
|
+
>,
|
|
120
|
+
"initialData"
|
|
121
|
+
>;
|
|
122
|
+
request?: SecondParameter<typeof customFetch>;
|
|
123
|
+
},
|
|
124
|
+
queryClient?: QueryClient,
|
|
125
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
126
|
+
export function useGetVersion<
|
|
127
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
128
|
+
TError = ErrorType<AsError | void>,
|
|
129
|
+
>(
|
|
130
|
+
options?: {
|
|
131
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
132
|
+
request?: SecondParameter<typeof customFetch>;
|
|
133
|
+
},
|
|
134
|
+
queryClient?: QueryClient,
|
|
135
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
86
136
|
/**
|
|
87
137
|
* @summary Gets the Account Server version
|
|
88
138
|
*/
|
|
@@ -90,13 +140,18 @@ export type GetVersionQueryError = ErrorType<AsError | void>;
|
|
|
90
140
|
export function useGetVersion<
|
|
91
141
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
92
142
|
TError = ErrorType<AsError | void>,
|
|
93
|
-
>(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
143
|
+
>(
|
|
144
|
+
options?: {
|
|
145
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
146
|
+
request?: SecondParameter<typeof customFetch>;
|
|
147
|
+
},
|
|
148
|
+
queryClient?: QueryClient,
|
|
149
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
97
150
|
const queryOptions = getGetVersionQueryOptions(options);
|
|
98
151
|
|
|
99
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
152
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
153
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
154
|
+
};
|
|
100
155
|
|
|
101
156
|
query.queryKey = queryOptions.queryKey;
|
|
102
157
|
|
|
@@ -119,7 +174,7 @@ export const getGetVersionSuspenseQueryOptions = <
|
|
|
119
174
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
120
175
|
TError = ErrorType<AsError | void>,
|
|
121
176
|
>(options?: {
|
|
122
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData
|
|
177
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
123
178
|
request?: SecondParameter<typeof customFetch>;
|
|
124
179
|
}) => {
|
|
125
180
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -133,12 +188,42 @@ export const getGetVersionSuspenseQueryOptions = <
|
|
|
133
188
|
Awaited<ReturnType<typeof getVersion>>,
|
|
134
189
|
TError,
|
|
135
190
|
TData
|
|
136
|
-
> & { queryKey: QueryKey };
|
|
191
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
137
192
|
};
|
|
138
193
|
|
|
139
194
|
export type GetVersionSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>;
|
|
140
195
|
export type GetVersionSuspenseQueryError = ErrorType<AsError | void>;
|
|
141
196
|
|
|
197
|
+
export function useGetVersionSuspense<
|
|
198
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
199
|
+
TError = ErrorType<AsError | void>,
|
|
200
|
+
>(
|
|
201
|
+
options: {
|
|
202
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
203
|
+
request?: SecondParameter<typeof customFetch>;
|
|
204
|
+
},
|
|
205
|
+
queryClient?: QueryClient,
|
|
206
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
207
|
+
export function useGetVersionSuspense<
|
|
208
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
209
|
+
TError = ErrorType<AsError | void>,
|
|
210
|
+
>(
|
|
211
|
+
options?: {
|
|
212
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
213
|
+
request?: SecondParameter<typeof customFetch>;
|
|
214
|
+
},
|
|
215
|
+
queryClient?: QueryClient,
|
|
216
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
217
|
+
export function useGetVersionSuspense<
|
|
218
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
219
|
+
TError = ErrorType<AsError | void>,
|
|
220
|
+
>(
|
|
221
|
+
options?: {
|
|
222
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
223
|
+
request?: SecondParameter<typeof customFetch>;
|
|
224
|
+
},
|
|
225
|
+
queryClient?: QueryClient,
|
|
226
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
142
227
|
/**
|
|
143
228
|
* @summary Gets the Account Server version
|
|
144
229
|
*/
|
|
@@ -146,15 +231,19 @@ export type GetVersionSuspenseQueryError = ErrorType<AsError | void>;
|
|
|
146
231
|
export function useGetVersionSuspense<
|
|
147
232
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
148
233
|
TError = ErrorType<AsError | void>,
|
|
149
|
-
>(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
234
|
+
>(
|
|
235
|
+
options?: {
|
|
236
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
237
|
+
request?: SecondParameter<typeof customFetch>;
|
|
238
|
+
},
|
|
239
|
+
queryClient?: QueryClient,
|
|
240
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
153
241
|
const queryOptions = getGetVersionSuspenseQueryOptions(options);
|
|
154
242
|
|
|
155
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
156
|
-
|
|
157
|
-
|
|
243
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
244
|
+
TData,
|
|
245
|
+
TError
|
|
246
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
158
247
|
|
|
159
248
|
query.queryKey = queryOptions.queryKey;
|
|
160
249
|
|
package/src/api/state/state.ts
CHANGED
|
@@ -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,
|
|
@@ -48,7 +52,7 @@ export const getGetVersionQueryOptions = <
|
|
|
48
52
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
49
53
|
TError = ErrorType<AsError | void>,
|
|
50
54
|
>(options?: {
|
|
51
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData
|
|
55
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
52
56
|
request?: SecondParameter<typeof customInstance>;
|
|
53
57
|
}) => {
|
|
54
58
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -62,12 +66,58 @@ export const getGetVersionQueryOptions = <
|
|
|
62
66
|
Awaited<ReturnType<typeof getVersion>>,
|
|
63
67
|
TError,
|
|
64
68
|
TData
|
|
65
|
-
> & { queryKey: QueryKey };
|
|
69
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
66
70
|
};
|
|
67
71
|
|
|
68
72
|
export type GetVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>;
|
|
69
73
|
export type GetVersionQueryError = ErrorType<AsError | void>;
|
|
70
74
|
|
|
75
|
+
export function useGetVersion<
|
|
76
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
77
|
+
TError = ErrorType<AsError | void>,
|
|
78
|
+
>(
|
|
79
|
+
options: {
|
|
80
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>> &
|
|
81
|
+
Pick<
|
|
82
|
+
DefinedInitialDataOptions<
|
|
83
|
+
Awaited<ReturnType<typeof getVersion>>,
|
|
84
|
+
TError,
|
|
85
|
+
Awaited<ReturnType<typeof getVersion>>
|
|
86
|
+
>,
|
|
87
|
+
"initialData"
|
|
88
|
+
>;
|
|
89
|
+
request?: SecondParameter<typeof customInstance>;
|
|
90
|
+
},
|
|
91
|
+
queryClient?: QueryClient,
|
|
92
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
93
|
+
export function useGetVersion<
|
|
94
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
95
|
+
TError = ErrorType<AsError | void>,
|
|
96
|
+
>(
|
|
97
|
+
options?: {
|
|
98
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>> &
|
|
99
|
+
Pick<
|
|
100
|
+
UndefinedInitialDataOptions<
|
|
101
|
+
Awaited<ReturnType<typeof getVersion>>,
|
|
102
|
+
TError,
|
|
103
|
+
Awaited<ReturnType<typeof getVersion>>
|
|
104
|
+
>,
|
|
105
|
+
"initialData"
|
|
106
|
+
>;
|
|
107
|
+
request?: SecondParameter<typeof customInstance>;
|
|
108
|
+
},
|
|
109
|
+
queryClient?: QueryClient,
|
|
110
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
111
|
+
export function useGetVersion<
|
|
112
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
113
|
+
TError = ErrorType<AsError | void>,
|
|
114
|
+
>(
|
|
115
|
+
options?: {
|
|
116
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
117
|
+
request?: SecondParameter<typeof customInstance>;
|
|
118
|
+
},
|
|
119
|
+
queryClient?: QueryClient,
|
|
120
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
71
121
|
/**
|
|
72
122
|
* @summary Gets the Account Server version
|
|
73
123
|
*/
|
|
@@ -75,13 +125,18 @@ export type GetVersionQueryError = ErrorType<AsError | void>;
|
|
|
75
125
|
export function useGetVersion<
|
|
76
126
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
77
127
|
TError = ErrorType<AsError | void>,
|
|
78
|
-
>(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
128
|
+
>(
|
|
129
|
+
options?: {
|
|
130
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
131
|
+
request?: SecondParameter<typeof customInstance>;
|
|
132
|
+
},
|
|
133
|
+
queryClient?: QueryClient,
|
|
134
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
82
135
|
const queryOptions = getGetVersionQueryOptions(options);
|
|
83
136
|
|
|
84
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
137
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
138
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
139
|
+
};
|
|
85
140
|
|
|
86
141
|
query.queryKey = queryOptions.queryKey;
|
|
87
142
|
|
|
@@ -104,7 +159,7 @@ export const getGetVersionSuspenseQueryOptions = <
|
|
|
104
159
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
105
160
|
TError = ErrorType<AsError | void>,
|
|
106
161
|
>(options?: {
|
|
107
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData
|
|
162
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
108
163
|
request?: SecondParameter<typeof customInstance>;
|
|
109
164
|
}) => {
|
|
110
165
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -118,12 +173,42 @@ export const getGetVersionSuspenseQueryOptions = <
|
|
|
118
173
|
Awaited<ReturnType<typeof getVersion>>,
|
|
119
174
|
TError,
|
|
120
175
|
TData
|
|
121
|
-
> & { queryKey: QueryKey };
|
|
176
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
122
177
|
};
|
|
123
178
|
|
|
124
179
|
export type GetVersionSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>;
|
|
125
180
|
export type GetVersionSuspenseQueryError = ErrorType<AsError | void>;
|
|
126
181
|
|
|
182
|
+
export function useGetVersionSuspense<
|
|
183
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
184
|
+
TError = ErrorType<AsError | void>,
|
|
185
|
+
>(
|
|
186
|
+
options: {
|
|
187
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
188
|
+
request?: SecondParameter<typeof customInstance>;
|
|
189
|
+
},
|
|
190
|
+
queryClient?: QueryClient,
|
|
191
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
192
|
+
export function useGetVersionSuspense<
|
|
193
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
194
|
+
TError = ErrorType<AsError | void>,
|
|
195
|
+
>(
|
|
196
|
+
options?: {
|
|
197
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
198
|
+
request?: SecondParameter<typeof customInstance>;
|
|
199
|
+
},
|
|
200
|
+
queryClient?: QueryClient,
|
|
201
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
202
|
+
export function useGetVersionSuspense<
|
|
203
|
+
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
204
|
+
TError = ErrorType<AsError | void>,
|
|
205
|
+
>(
|
|
206
|
+
options?: {
|
|
207
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
208
|
+
request?: SecondParameter<typeof customInstance>;
|
|
209
|
+
},
|
|
210
|
+
queryClient?: QueryClient,
|
|
211
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
127
212
|
/**
|
|
128
213
|
* @summary Gets the Account Server version
|
|
129
214
|
*/
|
|
@@ -131,15 +216,19 @@ export type GetVersionSuspenseQueryError = ErrorType<AsError | void>;
|
|
|
131
216
|
export function useGetVersionSuspense<
|
|
132
217
|
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
133
218
|
TError = ErrorType<AsError | void>,
|
|
134
|
-
>(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
219
|
+
>(
|
|
220
|
+
options?: {
|
|
221
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>;
|
|
222
|
+
request?: SecondParameter<typeof customInstance>;
|
|
223
|
+
},
|
|
224
|
+
queryClient?: QueryClient,
|
|
225
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
138
226
|
const queryOptions = getGetVersionSuspenseQueryOptions(options);
|
|
139
227
|
|
|
140
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
141
|
-
|
|
142
|
-
|
|
228
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
229
|
+
TData,
|
|
230
|
+
TError
|
|
231
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
143
232
|
|
|
144
233
|
query.queryKey = queryOptions.queryKey;
|
|
145
234
|
|