@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,11 +10,15 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
10
10
|
*/
|
|
11
11
|
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
12
12
|
import type {
|
|
13
|
+
DataTag,
|
|
14
|
+
DefinedInitialDataOptions,
|
|
15
|
+
DefinedUseQueryResult,
|
|
13
16
|
InvalidateOptions,
|
|
14
17
|
MutationFunction,
|
|
15
18
|
QueryClient,
|
|
16
19
|
QueryFunction,
|
|
17
20
|
QueryKey,
|
|
21
|
+
UndefinedInitialDataOptions,
|
|
18
22
|
UseMutationOptions,
|
|
19
23
|
UseMutationResult,
|
|
20
24
|
UseQueryOptions,
|
|
@@ -79,7 +83,9 @@ export const getGetEventStreamVersionQueryOptions = <
|
|
|
79
83
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
80
84
|
TError = ErrorType<void | AsError>,
|
|
81
85
|
>(options?: {
|
|
82
|
-
query?:
|
|
86
|
+
query?: Partial<
|
|
87
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
88
|
+
>;
|
|
83
89
|
request?: SecondParameter<typeof customFetch>;
|
|
84
90
|
}) => {
|
|
85
91
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -93,7 +99,7 @@ export const getGetEventStreamVersionQueryOptions = <
|
|
|
93
99
|
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
94
100
|
TError,
|
|
95
101
|
TData
|
|
96
|
-
> & { queryKey: QueryKey };
|
|
102
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
97
103
|
};
|
|
98
104
|
|
|
99
105
|
export type GetEventStreamVersionQueryResult = NonNullable<
|
|
@@ -101,6 +107,58 @@ export type GetEventStreamVersionQueryResult = NonNullable<
|
|
|
101
107
|
>;
|
|
102
108
|
export type GetEventStreamVersionQueryError = ErrorType<void | AsError>;
|
|
103
109
|
|
|
110
|
+
export function useGetEventStreamVersion<
|
|
111
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
112
|
+
TError = ErrorType<void | AsError>,
|
|
113
|
+
>(
|
|
114
|
+
options: {
|
|
115
|
+
query: Partial<
|
|
116
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
117
|
+
> &
|
|
118
|
+
Pick<
|
|
119
|
+
DefinedInitialDataOptions<
|
|
120
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
121
|
+
TError,
|
|
122
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
123
|
+
>,
|
|
124
|
+
"initialData"
|
|
125
|
+
>;
|
|
126
|
+
request?: SecondParameter<typeof customFetch>;
|
|
127
|
+
},
|
|
128
|
+
queryClient?: QueryClient,
|
|
129
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
130
|
+
export function useGetEventStreamVersion<
|
|
131
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
132
|
+
TError = ErrorType<void | AsError>,
|
|
133
|
+
>(
|
|
134
|
+
options?: {
|
|
135
|
+
query?: Partial<
|
|
136
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
137
|
+
> &
|
|
138
|
+
Pick<
|
|
139
|
+
UndefinedInitialDataOptions<
|
|
140
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
141
|
+
TError,
|
|
142
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
143
|
+
>,
|
|
144
|
+
"initialData"
|
|
145
|
+
>;
|
|
146
|
+
request?: SecondParameter<typeof customFetch>;
|
|
147
|
+
},
|
|
148
|
+
queryClient?: QueryClient,
|
|
149
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
150
|
+
export function useGetEventStreamVersion<
|
|
151
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
152
|
+
TError = ErrorType<void | AsError>,
|
|
153
|
+
>(
|
|
154
|
+
options?: {
|
|
155
|
+
query?: Partial<
|
|
156
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
157
|
+
>;
|
|
158
|
+
request?: SecondParameter<typeof customFetch>;
|
|
159
|
+
},
|
|
160
|
+
queryClient?: QueryClient,
|
|
161
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
104
162
|
/**
|
|
105
163
|
* @summary Gets the details of the installed event stream
|
|
106
164
|
*/
|
|
@@ -108,13 +166,20 @@ export type GetEventStreamVersionQueryError = ErrorType<void | AsError>;
|
|
|
108
166
|
export function useGetEventStreamVersion<
|
|
109
167
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
110
168
|
TError = ErrorType<void | AsError>,
|
|
111
|
-
>(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
169
|
+
>(
|
|
170
|
+
options?: {
|
|
171
|
+
query?: Partial<
|
|
172
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
173
|
+
>;
|
|
174
|
+
request?: SecondParameter<typeof customFetch>;
|
|
175
|
+
},
|
|
176
|
+
queryClient?: QueryClient,
|
|
177
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
115
178
|
const queryOptions = getGetEventStreamVersionQueryOptions(options);
|
|
116
179
|
|
|
117
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
180
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
181
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
182
|
+
};
|
|
118
183
|
|
|
119
184
|
query.queryKey = queryOptions.queryKey;
|
|
120
185
|
|
|
@@ -137,7 +202,9 @@ export const getGetEventStreamVersionSuspenseQueryOptions = <
|
|
|
137
202
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
138
203
|
TError = ErrorType<void | AsError>,
|
|
139
204
|
>(options?: {
|
|
140
|
-
query?:
|
|
205
|
+
query?: Partial<
|
|
206
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
207
|
+
>;
|
|
141
208
|
request?: SecondParameter<typeof customFetch>;
|
|
142
209
|
}) => {
|
|
143
210
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -151,7 +218,7 @@ export const getGetEventStreamVersionSuspenseQueryOptions = <
|
|
|
151
218
|
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
152
219
|
TError,
|
|
153
220
|
TData
|
|
154
|
-
> & { queryKey: QueryKey };
|
|
221
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
155
222
|
};
|
|
156
223
|
|
|
157
224
|
export type GetEventStreamVersionSuspenseQueryResult = NonNullable<
|
|
@@ -159,6 +226,42 @@ export type GetEventStreamVersionSuspenseQueryResult = NonNullable<
|
|
|
159
226
|
>;
|
|
160
227
|
export type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;
|
|
161
228
|
|
|
229
|
+
export function useGetEventStreamVersionSuspense<
|
|
230
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
231
|
+
TError = ErrorType<void | AsError>,
|
|
232
|
+
>(
|
|
233
|
+
options: {
|
|
234
|
+
query: Partial<
|
|
235
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
236
|
+
>;
|
|
237
|
+
request?: SecondParameter<typeof customFetch>;
|
|
238
|
+
},
|
|
239
|
+
queryClient?: QueryClient,
|
|
240
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
241
|
+
export function useGetEventStreamVersionSuspense<
|
|
242
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
243
|
+
TError = ErrorType<void | AsError>,
|
|
244
|
+
>(
|
|
245
|
+
options?: {
|
|
246
|
+
query?: Partial<
|
|
247
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
248
|
+
>;
|
|
249
|
+
request?: SecondParameter<typeof customFetch>;
|
|
250
|
+
},
|
|
251
|
+
queryClient?: QueryClient,
|
|
252
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
253
|
+
export function useGetEventStreamVersionSuspense<
|
|
254
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
255
|
+
TError = ErrorType<void | AsError>,
|
|
256
|
+
>(
|
|
257
|
+
options?: {
|
|
258
|
+
query?: Partial<
|
|
259
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
260
|
+
>;
|
|
261
|
+
request?: SecondParameter<typeof customFetch>;
|
|
262
|
+
},
|
|
263
|
+
queryClient?: QueryClient,
|
|
264
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
162
265
|
/**
|
|
163
266
|
* @summary Gets the details of the installed event stream
|
|
164
267
|
*/
|
|
@@ -166,15 +269,21 @@ export type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
166
269
|
export function useGetEventStreamVersionSuspense<
|
|
167
270
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
168
271
|
TError = ErrorType<void | AsError>,
|
|
169
|
-
>(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
272
|
+
>(
|
|
273
|
+
options?: {
|
|
274
|
+
query?: Partial<
|
|
275
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
276
|
+
>;
|
|
277
|
+
request?: SecondParameter<typeof customFetch>;
|
|
278
|
+
},
|
|
279
|
+
queryClient?: QueryClient,
|
|
280
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
173
281
|
const queryOptions = getGetEventStreamVersionSuspenseQueryOptions(options);
|
|
174
282
|
|
|
175
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
176
|
-
|
|
177
|
-
|
|
283
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
284
|
+
TData,
|
|
285
|
+
TError
|
|
286
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
178
287
|
|
|
179
288
|
query.queryKey = queryOptions.queryKey;
|
|
180
289
|
|
|
@@ -216,7 +325,7 @@ export const getGetEventStreamQueryOptions = <
|
|
|
216
325
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
217
326
|
TError = ErrorType<void | AsError>,
|
|
218
327
|
>(options?: {
|
|
219
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData
|
|
328
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
220
329
|
request?: SecondParameter<typeof customFetch>;
|
|
221
330
|
}) => {
|
|
222
331
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -230,12 +339,58 @@ export const getGetEventStreamQueryOptions = <
|
|
|
230
339
|
Awaited<ReturnType<typeof getEventStream>>,
|
|
231
340
|
TError,
|
|
232
341
|
TData
|
|
233
|
-
> & { queryKey: QueryKey };
|
|
342
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
234
343
|
};
|
|
235
344
|
|
|
236
345
|
export type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
|
|
237
346
|
export type GetEventStreamQueryError = ErrorType<void | AsError>;
|
|
238
347
|
|
|
348
|
+
export function useGetEventStream<
|
|
349
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
350
|
+
TError = ErrorType<void | AsError>,
|
|
351
|
+
>(
|
|
352
|
+
options: {
|
|
353
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &
|
|
354
|
+
Pick<
|
|
355
|
+
DefinedInitialDataOptions<
|
|
356
|
+
Awaited<ReturnType<typeof getEventStream>>,
|
|
357
|
+
TError,
|
|
358
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
359
|
+
>,
|
|
360
|
+
"initialData"
|
|
361
|
+
>;
|
|
362
|
+
request?: SecondParameter<typeof customFetch>;
|
|
363
|
+
},
|
|
364
|
+
queryClient?: QueryClient,
|
|
365
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
366
|
+
export function useGetEventStream<
|
|
367
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
368
|
+
TError = ErrorType<void | AsError>,
|
|
369
|
+
>(
|
|
370
|
+
options?: {
|
|
371
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &
|
|
372
|
+
Pick<
|
|
373
|
+
UndefinedInitialDataOptions<
|
|
374
|
+
Awaited<ReturnType<typeof getEventStream>>,
|
|
375
|
+
TError,
|
|
376
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
377
|
+
>,
|
|
378
|
+
"initialData"
|
|
379
|
+
>;
|
|
380
|
+
request?: SecondParameter<typeof customFetch>;
|
|
381
|
+
},
|
|
382
|
+
queryClient?: QueryClient,
|
|
383
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
384
|
+
export function useGetEventStream<
|
|
385
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
386
|
+
TError = ErrorType<void | AsError>,
|
|
387
|
+
>(
|
|
388
|
+
options?: {
|
|
389
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
390
|
+
request?: SecondParameter<typeof customFetch>;
|
|
391
|
+
},
|
|
392
|
+
queryClient?: QueryClient,
|
|
393
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
239
394
|
/**
|
|
240
395
|
* @summary Gets the details of your event stream
|
|
241
396
|
*/
|
|
@@ -243,13 +398,18 @@ export type GetEventStreamQueryError = ErrorType<void | AsError>;
|
|
|
243
398
|
export function useGetEventStream<
|
|
244
399
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
245
400
|
TError = ErrorType<void | AsError>,
|
|
246
|
-
>(
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
401
|
+
>(
|
|
402
|
+
options?: {
|
|
403
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
404
|
+
request?: SecondParameter<typeof customFetch>;
|
|
405
|
+
},
|
|
406
|
+
queryClient?: QueryClient,
|
|
407
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
250
408
|
const queryOptions = getGetEventStreamQueryOptions(options);
|
|
251
409
|
|
|
252
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
410
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
411
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
412
|
+
};
|
|
253
413
|
|
|
254
414
|
query.queryKey = queryOptions.queryKey;
|
|
255
415
|
|
|
@@ -272,7 +432,9 @@ export const getGetEventStreamSuspenseQueryOptions = <
|
|
|
272
432
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
273
433
|
TError = ErrorType<void | AsError>,
|
|
274
434
|
>(options?: {
|
|
275
|
-
query?:
|
|
435
|
+
query?: Partial<
|
|
436
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
437
|
+
>;
|
|
276
438
|
request?: SecondParameter<typeof customFetch>;
|
|
277
439
|
}) => {
|
|
278
440
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -286,7 +448,7 @@ export const getGetEventStreamSuspenseQueryOptions = <
|
|
|
286
448
|
Awaited<ReturnType<typeof getEventStream>>,
|
|
287
449
|
TError,
|
|
288
450
|
TData
|
|
289
|
-
> & { queryKey: QueryKey };
|
|
451
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
290
452
|
};
|
|
291
453
|
|
|
292
454
|
export type GetEventStreamSuspenseQueryResult = NonNullable<
|
|
@@ -294,6 +456,42 @@ export type GetEventStreamSuspenseQueryResult = NonNullable<
|
|
|
294
456
|
>;
|
|
295
457
|
export type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
|
|
296
458
|
|
|
459
|
+
export function useGetEventStreamSuspense<
|
|
460
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
461
|
+
TError = ErrorType<void | AsError>,
|
|
462
|
+
>(
|
|
463
|
+
options: {
|
|
464
|
+
query: Partial<
|
|
465
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
466
|
+
>;
|
|
467
|
+
request?: SecondParameter<typeof customFetch>;
|
|
468
|
+
},
|
|
469
|
+
queryClient?: QueryClient,
|
|
470
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
471
|
+
export function useGetEventStreamSuspense<
|
|
472
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
473
|
+
TError = ErrorType<void | AsError>,
|
|
474
|
+
>(
|
|
475
|
+
options?: {
|
|
476
|
+
query?: Partial<
|
|
477
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
478
|
+
>;
|
|
479
|
+
request?: SecondParameter<typeof customFetch>;
|
|
480
|
+
},
|
|
481
|
+
queryClient?: QueryClient,
|
|
482
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
483
|
+
export function useGetEventStreamSuspense<
|
|
484
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
485
|
+
TError = ErrorType<void | AsError>,
|
|
486
|
+
>(
|
|
487
|
+
options?: {
|
|
488
|
+
query?: Partial<
|
|
489
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
490
|
+
>;
|
|
491
|
+
request?: SecondParameter<typeof customFetch>;
|
|
492
|
+
},
|
|
493
|
+
queryClient?: QueryClient,
|
|
494
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
297
495
|
/**
|
|
298
496
|
* @summary Gets the details of your event stream
|
|
299
497
|
*/
|
|
@@ -301,15 +499,21 @@ export type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
301
499
|
export function useGetEventStreamSuspense<
|
|
302
500
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
303
501
|
TError = ErrorType<void | AsError>,
|
|
304
|
-
>(
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
502
|
+
>(
|
|
503
|
+
options?: {
|
|
504
|
+
query?: Partial<
|
|
505
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
506
|
+
>;
|
|
507
|
+
request?: SecondParameter<typeof customFetch>;
|
|
508
|
+
},
|
|
509
|
+
queryClient?: QueryClient,
|
|
510
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
308
511
|
const queryOptions = getGetEventStreamSuspenseQueryOptions(options);
|
|
309
512
|
|
|
310
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
311
|
-
|
|
312
|
-
|
|
513
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
514
|
+
TData,
|
|
515
|
+
TError
|
|
516
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
313
517
|
|
|
314
518
|
query.queryKey = queryOptions.queryKey;
|
|
315
519
|
|
|
@@ -412,18 +616,18 @@ export type CreateEventStreamMutationError = ErrorType<AsError | void>;
|
|
|
412
616
|
/**
|
|
413
617
|
* @summary Create a new event stream
|
|
414
618
|
*/
|
|
415
|
-
export const useCreateEventStream = <
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
619
|
+
export const useCreateEventStream = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
620
|
+
options?: {
|
|
621
|
+
mutation?: UseMutationOptions<
|
|
622
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
623
|
+
TError,
|
|
624
|
+
{ data: EventStreamPostBodyBody },
|
|
625
|
+
TContext
|
|
626
|
+
>;
|
|
627
|
+
request?: SecondParameter<typeof customFetch>;
|
|
628
|
+
},
|
|
629
|
+
queryClient?: QueryClient,
|
|
630
|
+
): UseMutationResult<
|
|
427
631
|
Awaited<ReturnType<typeof createEventStream>>,
|
|
428
632
|
TError,
|
|
429
633
|
{ data: EventStreamPostBodyBody },
|
|
@@ -431,7 +635,7 @@ export const useCreateEventStream = <
|
|
|
431
635
|
> => {
|
|
432
636
|
const mutationOptions = getCreateEventStreamMutationOptions(options);
|
|
433
637
|
|
|
434
|
-
return useMutation(mutationOptions);
|
|
638
|
+
return useMutation(mutationOptions, queryClient);
|
|
435
639
|
};
|
|
436
640
|
/**
|
|
437
641
|
* You must be the user who created the event stream.
|
|
@@ -516,18 +720,18 @@ export type DeleteEventStreamMutationError = ErrorType<void | AsError>;
|
|
|
516
720
|
/**
|
|
517
721
|
* @summary Deletes an existing event stream (that you created)
|
|
518
722
|
*/
|
|
519
|
-
export const useDeleteEventStream = <
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
723
|
+
export const useDeleteEventStream = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
724
|
+
options?: {
|
|
725
|
+
mutation?: UseMutationOptions<
|
|
726
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
727
|
+
TError,
|
|
728
|
+
{ eventStreamId: number },
|
|
729
|
+
TContext
|
|
730
|
+
>;
|
|
731
|
+
request?: SecondParameter<typeof customFetch>;
|
|
732
|
+
},
|
|
733
|
+
queryClient?: QueryClient,
|
|
734
|
+
): UseMutationResult<
|
|
531
735
|
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
532
736
|
TError,
|
|
533
737
|
{ eventStreamId: number },
|
|
@@ -535,5 +739,5 @@ export const useDeleteEventStream = <
|
|
|
535
739
|
> => {
|
|
536
740
|
const mutationOptions = getDeleteEventStreamMutationOptions(options);
|
|
537
741
|
|
|
538
|
-
return useMutation(mutationOptions);
|
|
742
|
+
return useMutation(mutationOptions, queryClient);
|
|
539
743
|
};
|