@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,
|
|
@@ -49,7 +53,7 @@ export const getGetMerchantsQueryOptions = <
|
|
|
49
53
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
50
54
|
TError = ErrorType<AsError | void>,
|
|
51
55
|
>(options?: {
|
|
52
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData
|
|
56
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
53
57
|
request?: SecondParameter<typeof customInstance>;
|
|
54
58
|
}) => {
|
|
55
59
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -63,12 +67,58 @@ export const getGetMerchantsQueryOptions = <
|
|
|
63
67
|
Awaited<ReturnType<typeof getMerchants>>,
|
|
64
68
|
TError,
|
|
65
69
|
TData
|
|
66
|
-
> & { queryKey: QueryKey };
|
|
70
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
67
71
|
};
|
|
68
72
|
|
|
69
73
|
export type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
|
|
70
74
|
export type GetMerchantsQueryError = ErrorType<AsError | void>;
|
|
71
75
|
|
|
76
|
+
export function useGetMerchants<
|
|
77
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
78
|
+
TError = ErrorType<AsError | void>,
|
|
79
|
+
>(
|
|
80
|
+
options: {
|
|
81
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &
|
|
82
|
+
Pick<
|
|
83
|
+
DefinedInitialDataOptions<
|
|
84
|
+
Awaited<ReturnType<typeof getMerchants>>,
|
|
85
|
+
TError,
|
|
86
|
+
Awaited<ReturnType<typeof getMerchants>>
|
|
87
|
+
>,
|
|
88
|
+
"initialData"
|
|
89
|
+
>;
|
|
90
|
+
request?: SecondParameter<typeof customInstance>;
|
|
91
|
+
},
|
|
92
|
+
queryClient?: QueryClient,
|
|
93
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
94
|
+
export function useGetMerchants<
|
|
95
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
96
|
+
TError = ErrorType<AsError | void>,
|
|
97
|
+
>(
|
|
98
|
+
options?: {
|
|
99
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>> &
|
|
100
|
+
Pick<
|
|
101
|
+
UndefinedInitialDataOptions<
|
|
102
|
+
Awaited<ReturnType<typeof getMerchants>>,
|
|
103
|
+
TError,
|
|
104
|
+
Awaited<ReturnType<typeof getMerchants>>
|
|
105
|
+
>,
|
|
106
|
+
"initialData"
|
|
107
|
+
>;
|
|
108
|
+
request?: SecondParameter<typeof customInstance>;
|
|
109
|
+
},
|
|
110
|
+
queryClient?: QueryClient,
|
|
111
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
112
|
+
export function useGetMerchants<
|
|
113
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
114
|
+
TError = ErrorType<AsError | void>,
|
|
115
|
+
>(
|
|
116
|
+
options?: {
|
|
117
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
118
|
+
request?: SecondParameter<typeof customInstance>;
|
|
119
|
+
},
|
|
120
|
+
queryClient?: QueryClient,
|
|
121
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
72
122
|
/**
|
|
73
123
|
* @summary Gets all Merchants
|
|
74
124
|
*/
|
|
@@ -76,13 +126,18 @@ export type GetMerchantsQueryError = ErrorType<AsError | void>;
|
|
|
76
126
|
export function useGetMerchants<
|
|
77
127
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
78
128
|
TError = ErrorType<AsError | void>,
|
|
79
|
-
>(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
129
|
+
>(
|
|
130
|
+
options?: {
|
|
131
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
132
|
+
request?: SecondParameter<typeof customInstance>;
|
|
133
|
+
},
|
|
134
|
+
queryClient?: QueryClient,
|
|
135
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
83
136
|
const queryOptions = getGetMerchantsQueryOptions(options);
|
|
84
137
|
|
|
85
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
138
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
139
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
140
|
+
};
|
|
86
141
|
|
|
87
142
|
query.queryKey = queryOptions.queryKey;
|
|
88
143
|
|
|
@@ -105,7 +160,7 @@ export const getGetMerchantsSuspenseQueryOptions = <
|
|
|
105
160
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
106
161
|
TError = ErrorType<AsError | void>,
|
|
107
162
|
>(options?: {
|
|
108
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData
|
|
163
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
109
164
|
request?: SecondParameter<typeof customInstance>;
|
|
110
165
|
}) => {
|
|
111
166
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -119,12 +174,48 @@ export const getGetMerchantsSuspenseQueryOptions = <
|
|
|
119
174
|
Awaited<ReturnType<typeof getMerchants>>,
|
|
120
175
|
TError,
|
|
121
176
|
TData
|
|
122
|
-
> & { queryKey: QueryKey };
|
|
177
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
123
178
|
};
|
|
124
179
|
|
|
125
180
|
export type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
|
|
126
181
|
export type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;
|
|
127
182
|
|
|
183
|
+
export function useGetMerchantsSuspense<
|
|
184
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
185
|
+
TError = ErrorType<AsError | void>,
|
|
186
|
+
>(
|
|
187
|
+
options: {
|
|
188
|
+
query: Partial<
|
|
189
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
190
|
+
>;
|
|
191
|
+
request?: SecondParameter<typeof customInstance>;
|
|
192
|
+
},
|
|
193
|
+
queryClient?: QueryClient,
|
|
194
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
195
|
+
export function useGetMerchantsSuspense<
|
|
196
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
197
|
+
TError = ErrorType<AsError | void>,
|
|
198
|
+
>(
|
|
199
|
+
options?: {
|
|
200
|
+
query?: Partial<
|
|
201
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
202
|
+
>;
|
|
203
|
+
request?: SecondParameter<typeof customInstance>;
|
|
204
|
+
},
|
|
205
|
+
queryClient?: QueryClient,
|
|
206
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
207
|
+
export function useGetMerchantsSuspense<
|
|
208
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
209
|
+
TError = ErrorType<AsError | void>,
|
|
210
|
+
>(
|
|
211
|
+
options?: {
|
|
212
|
+
query?: Partial<
|
|
213
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
214
|
+
>;
|
|
215
|
+
request?: SecondParameter<typeof customInstance>;
|
|
216
|
+
},
|
|
217
|
+
queryClient?: QueryClient,
|
|
218
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
128
219
|
/**
|
|
129
220
|
* @summary Gets all Merchants
|
|
130
221
|
*/
|
|
@@ -132,15 +223,21 @@ export type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;
|
|
|
132
223
|
export function useGetMerchantsSuspense<
|
|
133
224
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
134
225
|
TError = ErrorType<AsError | void>,
|
|
135
|
-
>(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
226
|
+
>(
|
|
227
|
+
options?: {
|
|
228
|
+
query?: Partial<
|
|
229
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
230
|
+
>;
|
|
231
|
+
request?: SecondParameter<typeof customInstance>;
|
|
232
|
+
},
|
|
233
|
+
queryClient?: QueryClient,
|
|
234
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
139
235
|
const queryOptions = getGetMerchantsSuspenseQueryOptions(options);
|
|
140
236
|
|
|
141
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
142
|
-
|
|
143
|
-
|
|
237
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
238
|
+
TData,
|
|
239
|
+
TError
|
|
240
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
144
241
|
|
|
145
242
|
query.queryKey = queryOptions.queryKey;
|
|
146
243
|
|
|
@@ -173,7 +270,7 @@ export const getGetServiceQueryOptions = <
|
|
|
173
270
|
>(
|
|
174
271
|
mId: number,
|
|
175
272
|
options?: {
|
|
176
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
273
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
177
274
|
request?: SecondParameter<typeof customInstance>;
|
|
178
275
|
},
|
|
179
276
|
) => {
|
|
@@ -188,12 +285,61 @@ export const getGetServiceQueryOptions = <
|
|
|
188
285
|
Awaited<ReturnType<typeof getService>>,
|
|
189
286
|
TError,
|
|
190
287
|
TData
|
|
191
|
-
> & { queryKey: QueryKey };
|
|
288
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
192
289
|
};
|
|
193
290
|
|
|
194
291
|
export type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
|
|
195
292
|
export type GetServiceQueryError = ErrorType<AsError | void>;
|
|
196
293
|
|
|
294
|
+
export function useGetService<
|
|
295
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
296
|
+
TError = ErrorType<AsError | void>,
|
|
297
|
+
>(
|
|
298
|
+
mId: number,
|
|
299
|
+
options: {
|
|
300
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &
|
|
301
|
+
Pick<
|
|
302
|
+
DefinedInitialDataOptions<
|
|
303
|
+
Awaited<ReturnType<typeof getService>>,
|
|
304
|
+
TError,
|
|
305
|
+
Awaited<ReturnType<typeof getService>>
|
|
306
|
+
>,
|
|
307
|
+
"initialData"
|
|
308
|
+
>;
|
|
309
|
+
request?: SecondParameter<typeof customInstance>;
|
|
310
|
+
},
|
|
311
|
+
queryClient?: QueryClient,
|
|
312
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
313
|
+
export function useGetService<
|
|
314
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
315
|
+
TError = ErrorType<AsError | void>,
|
|
316
|
+
>(
|
|
317
|
+
mId: number,
|
|
318
|
+
options?: {
|
|
319
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &
|
|
320
|
+
Pick<
|
|
321
|
+
UndefinedInitialDataOptions<
|
|
322
|
+
Awaited<ReturnType<typeof getService>>,
|
|
323
|
+
TError,
|
|
324
|
+
Awaited<ReturnType<typeof getService>>
|
|
325
|
+
>,
|
|
326
|
+
"initialData"
|
|
327
|
+
>;
|
|
328
|
+
request?: SecondParameter<typeof customInstance>;
|
|
329
|
+
},
|
|
330
|
+
queryClient?: QueryClient,
|
|
331
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
332
|
+
export function useGetService<
|
|
333
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
334
|
+
TError = ErrorType<AsError | void>,
|
|
335
|
+
>(
|
|
336
|
+
mId: number,
|
|
337
|
+
options?: {
|
|
338
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
339
|
+
request?: SecondParameter<typeof customInstance>;
|
|
340
|
+
},
|
|
341
|
+
queryClient?: QueryClient,
|
|
342
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
197
343
|
/**
|
|
198
344
|
* @summary Gets a specific Merchant
|
|
199
345
|
*/
|
|
@@ -204,13 +350,16 @@ export function useGetService<
|
|
|
204
350
|
>(
|
|
205
351
|
mId: number,
|
|
206
352
|
options?: {
|
|
207
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
353
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
208
354
|
request?: SecondParameter<typeof customInstance>;
|
|
209
355
|
},
|
|
210
|
-
|
|
356
|
+
queryClient?: QueryClient,
|
|
357
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
211
358
|
const queryOptions = getGetServiceQueryOptions(mId, options);
|
|
212
359
|
|
|
213
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
360
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
361
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
362
|
+
};
|
|
214
363
|
|
|
215
364
|
query.queryKey = queryOptions.queryKey;
|
|
216
365
|
|
|
@@ -236,7 +385,7 @@ export const getGetServiceSuspenseQueryOptions = <
|
|
|
236
385
|
>(
|
|
237
386
|
mId: number,
|
|
238
387
|
options?: {
|
|
239
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
388
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
240
389
|
request?: SecondParameter<typeof customInstance>;
|
|
241
390
|
},
|
|
242
391
|
) => {
|
|
@@ -251,12 +400,45 @@ export const getGetServiceSuspenseQueryOptions = <
|
|
|
251
400
|
Awaited<ReturnType<typeof getService>>,
|
|
252
401
|
TError,
|
|
253
402
|
TData
|
|
254
|
-
> & { queryKey: QueryKey };
|
|
403
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
255
404
|
};
|
|
256
405
|
|
|
257
406
|
export type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
|
|
258
407
|
export type GetServiceSuspenseQueryError = ErrorType<AsError | void>;
|
|
259
408
|
|
|
409
|
+
export function useGetServiceSuspense<
|
|
410
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
411
|
+
TError = ErrorType<AsError | void>,
|
|
412
|
+
>(
|
|
413
|
+
mId: number,
|
|
414
|
+
options: {
|
|
415
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
416
|
+
request?: SecondParameter<typeof customInstance>;
|
|
417
|
+
},
|
|
418
|
+
queryClient?: QueryClient,
|
|
419
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
420
|
+
export function useGetServiceSuspense<
|
|
421
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
422
|
+
TError = ErrorType<AsError | void>,
|
|
423
|
+
>(
|
|
424
|
+
mId: number,
|
|
425
|
+
options?: {
|
|
426
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
427
|
+
request?: SecondParameter<typeof customInstance>;
|
|
428
|
+
},
|
|
429
|
+
queryClient?: QueryClient,
|
|
430
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
431
|
+
export function useGetServiceSuspense<
|
|
432
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
433
|
+
TError = ErrorType<AsError | void>,
|
|
434
|
+
>(
|
|
435
|
+
mId: number,
|
|
436
|
+
options?: {
|
|
437
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
438
|
+
request?: SecondParameter<typeof customInstance>;
|
|
439
|
+
},
|
|
440
|
+
queryClient?: QueryClient,
|
|
441
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
260
442
|
/**
|
|
261
443
|
* @summary Gets a specific Merchant
|
|
262
444
|
*/
|
|
@@ -267,15 +449,17 @@ export function useGetServiceSuspense<
|
|
|
267
449
|
>(
|
|
268
450
|
mId: number,
|
|
269
451
|
options?: {
|
|
270
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
452
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
271
453
|
request?: SecondParameter<typeof customInstance>;
|
|
272
454
|
},
|
|
273
|
-
|
|
455
|
+
queryClient?: QueryClient,
|
|
456
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
274
457
|
const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);
|
|
275
458
|
|
|
276
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
277
|
-
|
|
278
|
-
|
|
459
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
460
|
+
TData,
|
|
461
|
+
TError
|
|
462
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
279
463
|
|
|
280
464
|
query.queryKey = queryOptions.queryKey;
|
|
281
465
|
|