@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,
|
|
@@ -67,7 +71,7 @@ export const getGetMerchantsQueryOptions = <
|
|
|
67
71
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
68
72
|
TError = ErrorType<AsError | void>,
|
|
69
73
|
>(options?: {
|
|
70
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData
|
|
74
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
71
75
|
request?: SecondParameter<typeof customFetch>;
|
|
72
76
|
}) => {
|
|
73
77
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -81,12 +85,58 @@ export const getGetMerchantsQueryOptions = <
|
|
|
81
85
|
Awaited<ReturnType<typeof getMerchants>>,
|
|
82
86
|
TError,
|
|
83
87
|
TData
|
|
84
|
-
> & { queryKey: QueryKey };
|
|
88
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
85
89
|
};
|
|
86
90
|
|
|
87
91
|
export type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
|
|
88
92
|
export type GetMerchantsQueryError = ErrorType<AsError | void>;
|
|
89
93
|
|
|
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
|
+
DefinedInitialDataOptions<
|
|
102
|
+
Awaited<ReturnType<typeof getMerchants>>,
|
|
103
|
+
TError,
|
|
104
|
+
Awaited<ReturnType<typeof getMerchants>>
|
|
105
|
+
>,
|
|
106
|
+
"initialData"
|
|
107
|
+
>;
|
|
108
|
+
request?: SecondParameter<typeof customFetch>;
|
|
109
|
+
},
|
|
110
|
+
queryClient?: QueryClient,
|
|
111
|
+
): DefinedUseQueryResult<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
|
+
Pick<
|
|
119
|
+
UndefinedInitialDataOptions<
|
|
120
|
+
Awaited<ReturnType<typeof getMerchants>>,
|
|
121
|
+
TError,
|
|
122
|
+
Awaited<ReturnType<typeof getMerchants>>
|
|
123
|
+
>,
|
|
124
|
+
"initialData"
|
|
125
|
+
>;
|
|
126
|
+
request?: SecondParameter<typeof customFetch>;
|
|
127
|
+
},
|
|
128
|
+
queryClient?: QueryClient,
|
|
129
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
130
|
+
export function useGetMerchants<
|
|
131
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
132
|
+
TError = ErrorType<AsError | void>,
|
|
133
|
+
>(
|
|
134
|
+
options?: {
|
|
135
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
136
|
+
request?: SecondParameter<typeof customFetch>;
|
|
137
|
+
},
|
|
138
|
+
queryClient?: QueryClient,
|
|
139
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
90
140
|
/**
|
|
91
141
|
* @summary Gets all Merchants
|
|
92
142
|
*/
|
|
@@ -94,13 +144,18 @@ export type GetMerchantsQueryError = ErrorType<AsError | void>;
|
|
|
94
144
|
export function useGetMerchants<
|
|
95
145
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
96
146
|
TError = ErrorType<AsError | void>,
|
|
97
|
-
>(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
147
|
+
>(
|
|
148
|
+
options?: {
|
|
149
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
150
|
+
request?: SecondParameter<typeof customFetch>;
|
|
151
|
+
},
|
|
152
|
+
queryClient?: QueryClient,
|
|
153
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
101
154
|
const queryOptions = getGetMerchantsQueryOptions(options);
|
|
102
155
|
|
|
103
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
156
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
157
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
158
|
+
};
|
|
104
159
|
|
|
105
160
|
query.queryKey = queryOptions.queryKey;
|
|
106
161
|
|
|
@@ -123,7 +178,7 @@ export const getGetMerchantsSuspenseQueryOptions = <
|
|
|
123
178
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
124
179
|
TError = ErrorType<AsError | void>,
|
|
125
180
|
>(options?: {
|
|
126
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData
|
|
181
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>;
|
|
127
182
|
request?: SecondParameter<typeof customFetch>;
|
|
128
183
|
}) => {
|
|
129
184
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -137,12 +192,48 @@ export const getGetMerchantsSuspenseQueryOptions = <
|
|
|
137
192
|
Awaited<ReturnType<typeof getMerchants>>,
|
|
138
193
|
TError,
|
|
139
194
|
TData
|
|
140
|
-
> & { queryKey: QueryKey };
|
|
195
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
141
196
|
};
|
|
142
197
|
|
|
143
198
|
export type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>;
|
|
144
199
|
export type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;
|
|
145
200
|
|
|
201
|
+
export function useGetMerchantsSuspense<
|
|
202
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
203
|
+
TError = ErrorType<AsError | void>,
|
|
204
|
+
>(
|
|
205
|
+
options: {
|
|
206
|
+
query: Partial<
|
|
207
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
208
|
+
>;
|
|
209
|
+
request?: SecondParameter<typeof customFetch>;
|
|
210
|
+
},
|
|
211
|
+
queryClient?: QueryClient,
|
|
212
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
213
|
+
export function useGetMerchantsSuspense<
|
|
214
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
215
|
+
TError = ErrorType<AsError | void>,
|
|
216
|
+
>(
|
|
217
|
+
options?: {
|
|
218
|
+
query?: Partial<
|
|
219
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
220
|
+
>;
|
|
221
|
+
request?: SecondParameter<typeof customFetch>;
|
|
222
|
+
},
|
|
223
|
+
queryClient?: QueryClient,
|
|
224
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
225
|
+
export function useGetMerchantsSuspense<
|
|
226
|
+
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
227
|
+
TError = ErrorType<AsError | void>,
|
|
228
|
+
>(
|
|
229
|
+
options?: {
|
|
230
|
+
query?: Partial<
|
|
231
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
232
|
+
>;
|
|
233
|
+
request?: SecondParameter<typeof customFetch>;
|
|
234
|
+
},
|
|
235
|
+
queryClient?: QueryClient,
|
|
236
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
146
237
|
/**
|
|
147
238
|
* @summary Gets all Merchants
|
|
148
239
|
*/
|
|
@@ -150,15 +241,21 @@ export type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>;
|
|
|
150
241
|
export function useGetMerchantsSuspense<
|
|
151
242
|
TData = Awaited<ReturnType<typeof getMerchants>>,
|
|
152
243
|
TError = ErrorType<AsError | void>,
|
|
153
|
-
>(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
244
|
+
>(
|
|
245
|
+
options?: {
|
|
246
|
+
query?: Partial<
|
|
247
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>
|
|
248
|
+
>;
|
|
249
|
+
request?: SecondParameter<typeof customFetch>;
|
|
250
|
+
},
|
|
251
|
+
queryClient?: QueryClient,
|
|
252
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
157
253
|
const queryOptions = getGetMerchantsSuspenseQueryOptions(options);
|
|
158
254
|
|
|
159
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
160
|
-
|
|
161
|
-
|
|
255
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
256
|
+
TData,
|
|
257
|
+
TError
|
|
258
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
162
259
|
|
|
163
260
|
query.queryKey = queryOptions.queryKey;
|
|
164
261
|
|
|
@@ -208,7 +305,7 @@ export const getGetServiceQueryOptions = <
|
|
|
208
305
|
>(
|
|
209
306
|
mId: number,
|
|
210
307
|
options?: {
|
|
211
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
308
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
212
309
|
request?: SecondParameter<typeof customFetch>;
|
|
213
310
|
},
|
|
214
311
|
) => {
|
|
@@ -223,12 +320,61 @@ export const getGetServiceQueryOptions = <
|
|
|
223
320
|
Awaited<ReturnType<typeof getService>>,
|
|
224
321
|
TError,
|
|
225
322
|
TData
|
|
226
|
-
> & { queryKey: QueryKey };
|
|
323
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
227
324
|
};
|
|
228
325
|
|
|
229
326
|
export type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
|
|
230
327
|
export type GetServiceQueryError = ErrorType<AsError | void>;
|
|
231
328
|
|
|
329
|
+
export function useGetService<
|
|
330
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
331
|
+
TError = ErrorType<AsError | void>,
|
|
332
|
+
>(
|
|
333
|
+
mId: number,
|
|
334
|
+
options: {
|
|
335
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &
|
|
336
|
+
Pick<
|
|
337
|
+
DefinedInitialDataOptions<
|
|
338
|
+
Awaited<ReturnType<typeof getService>>,
|
|
339
|
+
TError,
|
|
340
|
+
Awaited<ReturnType<typeof getService>>
|
|
341
|
+
>,
|
|
342
|
+
"initialData"
|
|
343
|
+
>;
|
|
344
|
+
request?: SecondParameter<typeof customFetch>;
|
|
345
|
+
},
|
|
346
|
+
queryClient?: QueryClient,
|
|
347
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
348
|
+
export function useGetService<
|
|
349
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
350
|
+
TError = ErrorType<AsError | void>,
|
|
351
|
+
>(
|
|
352
|
+
mId: number,
|
|
353
|
+
options?: {
|
|
354
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>> &
|
|
355
|
+
Pick<
|
|
356
|
+
UndefinedInitialDataOptions<
|
|
357
|
+
Awaited<ReturnType<typeof getService>>,
|
|
358
|
+
TError,
|
|
359
|
+
Awaited<ReturnType<typeof getService>>
|
|
360
|
+
>,
|
|
361
|
+
"initialData"
|
|
362
|
+
>;
|
|
363
|
+
request?: SecondParameter<typeof customFetch>;
|
|
364
|
+
},
|
|
365
|
+
queryClient?: QueryClient,
|
|
366
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
367
|
+
export function useGetService<
|
|
368
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
369
|
+
TError = ErrorType<AsError | void>,
|
|
370
|
+
>(
|
|
371
|
+
mId: number,
|
|
372
|
+
options?: {
|
|
373
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
374
|
+
request?: SecondParameter<typeof customFetch>;
|
|
375
|
+
},
|
|
376
|
+
queryClient?: QueryClient,
|
|
377
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
232
378
|
/**
|
|
233
379
|
* @summary Gets a specific Merchant
|
|
234
380
|
*/
|
|
@@ -239,13 +385,16 @@ export function useGetService<
|
|
|
239
385
|
>(
|
|
240
386
|
mId: number,
|
|
241
387
|
options?: {
|
|
242
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
388
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
243
389
|
request?: SecondParameter<typeof customFetch>;
|
|
244
390
|
},
|
|
245
|
-
|
|
391
|
+
queryClient?: QueryClient,
|
|
392
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
246
393
|
const queryOptions = getGetServiceQueryOptions(mId, options);
|
|
247
394
|
|
|
248
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
395
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
396
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
397
|
+
};
|
|
249
398
|
|
|
250
399
|
query.queryKey = queryOptions.queryKey;
|
|
251
400
|
|
|
@@ -271,7 +420,7 @@ export const getGetServiceSuspenseQueryOptions = <
|
|
|
271
420
|
>(
|
|
272
421
|
mId: number,
|
|
273
422
|
options?: {
|
|
274
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
423
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
275
424
|
request?: SecondParameter<typeof customFetch>;
|
|
276
425
|
},
|
|
277
426
|
) => {
|
|
@@ -286,12 +435,45 @@ export const getGetServiceSuspenseQueryOptions = <
|
|
|
286
435
|
Awaited<ReturnType<typeof getService>>,
|
|
287
436
|
TError,
|
|
288
437
|
TData
|
|
289
|
-
> & { queryKey: QueryKey };
|
|
438
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
290
439
|
};
|
|
291
440
|
|
|
292
441
|
export type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>;
|
|
293
442
|
export type GetServiceSuspenseQueryError = ErrorType<AsError | void>;
|
|
294
443
|
|
|
444
|
+
export function useGetServiceSuspense<
|
|
445
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
446
|
+
TError = ErrorType<AsError | void>,
|
|
447
|
+
>(
|
|
448
|
+
mId: number,
|
|
449
|
+
options: {
|
|
450
|
+
query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
451
|
+
request?: SecondParameter<typeof customFetch>;
|
|
452
|
+
},
|
|
453
|
+
queryClient?: QueryClient,
|
|
454
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
455
|
+
export function useGetServiceSuspense<
|
|
456
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
457
|
+
TError = ErrorType<AsError | void>,
|
|
458
|
+
>(
|
|
459
|
+
mId: number,
|
|
460
|
+
options?: {
|
|
461
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
462
|
+
request?: SecondParameter<typeof customFetch>;
|
|
463
|
+
},
|
|
464
|
+
queryClient?: QueryClient,
|
|
465
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
466
|
+
export function useGetServiceSuspense<
|
|
467
|
+
TData = Awaited<ReturnType<typeof getService>>,
|
|
468
|
+
TError = ErrorType<AsError | void>,
|
|
469
|
+
>(
|
|
470
|
+
mId: number,
|
|
471
|
+
options?: {
|
|
472
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
473
|
+
request?: SecondParameter<typeof customFetch>;
|
|
474
|
+
},
|
|
475
|
+
queryClient?: QueryClient,
|
|
476
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
295
477
|
/**
|
|
296
478
|
* @summary Gets a specific Merchant
|
|
297
479
|
*/
|
|
@@ -302,15 +484,17 @@ export function useGetServiceSuspense<
|
|
|
302
484
|
>(
|
|
303
485
|
mId: number,
|
|
304
486
|
options?: {
|
|
305
|
-
query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData
|
|
487
|
+
query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>;
|
|
306
488
|
request?: SecondParameter<typeof customFetch>;
|
|
307
489
|
},
|
|
308
|
-
|
|
490
|
+
queryClient?: QueryClient,
|
|
491
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
309
492
|
const queryOptions = getGetServiceSuspenseQueryOptions(mId, options);
|
|
310
493
|
|
|
311
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
312
|
-
|
|
313
|
-
|
|
494
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
495
|
+
TData,
|
|
496
|
+
TError
|
|
497
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
314
498
|
|
|
315
499
|
query.queryKey = queryOptions.queryKey;
|
|
316
500
|
|