@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,
|
|
@@ -58,7 +62,9 @@ export const getGetEventStreamVersionQueryOptions = <
|
|
|
58
62
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
59
63
|
TError = ErrorType<void | AsError>,
|
|
60
64
|
>(options?: {
|
|
61
|
-
query?:
|
|
65
|
+
query?: Partial<
|
|
66
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
67
|
+
>;
|
|
62
68
|
request?: SecondParameter<typeof customInstance>;
|
|
63
69
|
}) => {
|
|
64
70
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -72,7 +78,7 @@ export const getGetEventStreamVersionQueryOptions = <
|
|
|
72
78
|
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
73
79
|
TError,
|
|
74
80
|
TData
|
|
75
|
-
> & { queryKey: QueryKey };
|
|
81
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
76
82
|
};
|
|
77
83
|
|
|
78
84
|
export type GetEventStreamVersionQueryResult = NonNullable<
|
|
@@ -80,6 +86,58 @@ export type GetEventStreamVersionQueryResult = NonNullable<
|
|
|
80
86
|
>;
|
|
81
87
|
export type GetEventStreamVersionQueryError = ErrorType<void | AsError>;
|
|
82
88
|
|
|
89
|
+
export function useGetEventStreamVersion<
|
|
90
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
91
|
+
TError = ErrorType<void | AsError>,
|
|
92
|
+
>(
|
|
93
|
+
options: {
|
|
94
|
+
query: Partial<
|
|
95
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
96
|
+
> &
|
|
97
|
+
Pick<
|
|
98
|
+
DefinedInitialDataOptions<
|
|
99
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
100
|
+
TError,
|
|
101
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
102
|
+
>,
|
|
103
|
+
"initialData"
|
|
104
|
+
>;
|
|
105
|
+
request?: SecondParameter<typeof customInstance>;
|
|
106
|
+
},
|
|
107
|
+
queryClient?: QueryClient,
|
|
108
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
109
|
+
export function useGetEventStreamVersion<
|
|
110
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
111
|
+
TError = ErrorType<void | AsError>,
|
|
112
|
+
>(
|
|
113
|
+
options?: {
|
|
114
|
+
query?: Partial<
|
|
115
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
116
|
+
> &
|
|
117
|
+
Pick<
|
|
118
|
+
UndefinedInitialDataOptions<
|
|
119
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
120
|
+
TError,
|
|
121
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
122
|
+
>,
|
|
123
|
+
"initialData"
|
|
124
|
+
>;
|
|
125
|
+
request?: SecondParameter<typeof customInstance>;
|
|
126
|
+
},
|
|
127
|
+
queryClient?: QueryClient,
|
|
128
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
129
|
+
export function useGetEventStreamVersion<
|
|
130
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
131
|
+
TError = ErrorType<void | AsError>,
|
|
132
|
+
>(
|
|
133
|
+
options?: {
|
|
134
|
+
query?: Partial<
|
|
135
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
136
|
+
>;
|
|
137
|
+
request?: SecondParameter<typeof customInstance>;
|
|
138
|
+
},
|
|
139
|
+
queryClient?: QueryClient,
|
|
140
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
83
141
|
/**
|
|
84
142
|
* @summary Gets the details of the installed event stream
|
|
85
143
|
*/
|
|
@@ -87,13 +145,20 @@ export type GetEventStreamVersionQueryError = ErrorType<void | AsError>;
|
|
|
87
145
|
export function useGetEventStreamVersion<
|
|
88
146
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
89
147
|
TError = ErrorType<void | AsError>,
|
|
90
|
-
>(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
148
|
+
>(
|
|
149
|
+
options?: {
|
|
150
|
+
query?: Partial<
|
|
151
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
152
|
+
>;
|
|
153
|
+
request?: SecondParameter<typeof customInstance>;
|
|
154
|
+
},
|
|
155
|
+
queryClient?: QueryClient,
|
|
156
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
94
157
|
const queryOptions = getGetEventStreamVersionQueryOptions(options);
|
|
95
158
|
|
|
96
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
159
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
160
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
161
|
+
};
|
|
97
162
|
|
|
98
163
|
query.queryKey = queryOptions.queryKey;
|
|
99
164
|
|
|
@@ -116,7 +181,9 @@ export const getGetEventStreamVersionSuspenseQueryOptions = <
|
|
|
116
181
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
117
182
|
TError = ErrorType<void | AsError>,
|
|
118
183
|
>(options?: {
|
|
119
|
-
query?:
|
|
184
|
+
query?: Partial<
|
|
185
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
186
|
+
>;
|
|
120
187
|
request?: SecondParameter<typeof customInstance>;
|
|
121
188
|
}) => {
|
|
122
189
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -130,7 +197,7 @@ export const getGetEventStreamVersionSuspenseQueryOptions = <
|
|
|
130
197
|
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
131
198
|
TError,
|
|
132
199
|
TData
|
|
133
|
-
> & { queryKey: QueryKey };
|
|
200
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
134
201
|
};
|
|
135
202
|
|
|
136
203
|
export type GetEventStreamVersionSuspenseQueryResult = NonNullable<
|
|
@@ -138,6 +205,42 @@ export type GetEventStreamVersionSuspenseQueryResult = NonNullable<
|
|
|
138
205
|
>;
|
|
139
206
|
export type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;
|
|
140
207
|
|
|
208
|
+
export function useGetEventStreamVersionSuspense<
|
|
209
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
210
|
+
TError = ErrorType<void | AsError>,
|
|
211
|
+
>(
|
|
212
|
+
options: {
|
|
213
|
+
query: Partial<
|
|
214
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
215
|
+
>;
|
|
216
|
+
request?: SecondParameter<typeof customInstance>;
|
|
217
|
+
},
|
|
218
|
+
queryClient?: QueryClient,
|
|
219
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
220
|
+
export function useGetEventStreamVersionSuspense<
|
|
221
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
222
|
+
TError = ErrorType<void | AsError>,
|
|
223
|
+
>(
|
|
224
|
+
options?: {
|
|
225
|
+
query?: Partial<
|
|
226
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
227
|
+
>;
|
|
228
|
+
request?: SecondParameter<typeof customInstance>;
|
|
229
|
+
},
|
|
230
|
+
queryClient?: QueryClient,
|
|
231
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
232
|
+
export function useGetEventStreamVersionSuspense<
|
|
233
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
234
|
+
TError = ErrorType<void | AsError>,
|
|
235
|
+
>(
|
|
236
|
+
options?: {
|
|
237
|
+
query?: Partial<
|
|
238
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
239
|
+
>;
|
|
240
|
+
request?: SecondParameter<typeof customInstance>;
|
|
241
|
+
},
|
|
242
|
+
queryClient?: QueryClient,
|
|
243
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
141
244
|
/**
|
|
142
245
|
* @summary Gets the details of the installed event stream
|
|
143
246
|
*/
|
|
@@ -145,15 +248,21 @@ export type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
145
248
|
export function useGetEventStreamVersionSuspense<
|
|
146
249
|
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
147
250
|
TError = ErrorType<void | AsError>,
|
|
148
|
-
>(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
251
|
+
>(
|
|
252
|
+
options?: {
|
|
253
|
+
query?: Partial<
|
|
254
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
255
|
+
>;
|
|
256
|
+
request?: SecondParameter<typeof customInstance>;
|
|
257
|
+
},
|
|
258
|
+
queryClient?: QueryClient,
|
|
259
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
152
260
|
const queryOptions = getGetEventStreamVersionSuspenseQueryOptions(options);
|
|
153
261
|
|
|
154
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
155
|
-
|
|
156
|
-
|
|
262
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
263
|
+
TData,
|
|
264
|
+
TError
|
|
265
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
157
266
|
|
|
158
267
|
query.queryKey = queryOptions.queryKey;
|
|
159
268
|
|
|
@@ -183,7 +292,7 @@ export const getGetEventStreamQueryOptions = <
|
|
|
183
292
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
184
293
|
TError = ErrorType<void | AsError>,
|
|
185
294
|
>(options?: {
|
|
186
|
-
query?: UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData
|
|
295
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
187
296
|
request?: SecondParameter<typeof customInstance>;
|
|
188
297
|
}) => {
|
|
189
298
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -197,12 +306,58 @@ export const getGetEventStreamQueryOptions = <
|
|
|
197
306
|
Awaited<ReturnType<typeof getEventStream>>,
|
|
198
307
|
TError,
|
|
199
308
|
TData
|
|
200
|
-
> & { queryKey: QueryKey };
|
|
309
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
201
310
|
};
|
|
202
311
|
|
|
203
312
|
export type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
|
|
204
313
|
export type GetEventStreamQueryError = ErrorType<void | AsError>;
|
|
205
314
|
|
|
315
|
+
export function useGetEventStream<
|
|
316
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
317
|
+
TError = ErrorType<void | AsError>,
|
|
318
|
+
>(
|
|
319
|
+
options: {
|
|
320
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &
|
|
321
|
+
Pick<
|
|
322
|
+
DefinedInitialDataOptions<
|
|
323
|
+
Awaited<ReturnType<typeof getEventStream>>,
|
|
324
|
+
TError,
|
|
325
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
326
|
+
>,
|
|
327
|
+
"initialData"
|
|
328
|
+
>;
|
|
329
|
+
request?: SecondParameter<typeof customInstance>;
|
|
330
|
+
},
|
|
331
|
+
queryClient?: QueryClient,
|
|
332
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
333
|
+
export function useGetEventStream<
|
|
334
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
335
|
+
TError = ErrorType<void | AsError>,
|
|
336
|
+
>(
|
|
337
|
+
options?: {
|
|
338
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &
|
|
339
|
+
Pick<
|
|
340
|
+
UndefinedInitialDataOptions<
|
|
341
|
+
Awaited<ReturnType<typeof getEventStream>>,
|
|
342
|
+
TError,
|
|
343
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
344
|
+
>,
|
|
345
|
+
"initialData"
|
|
346
|
+
>;
|
|
347
|
+
request?: SecondParameter<typeof customInstance>;
|
|
348
|
+
},
|
|
349
|
+
queryClient?: QueryClient,
|
|
350
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
351
|
+
export function useGetEventStream<
|
|
352
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
353
|
+
TError = ErrorType<void | AsError>,
|
|
354
|
+
>(
|
|
355
|
+
options?: {
|
|
356
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
357
|
+
request?: SecondParameter<typeof customInstance>;
|
|
358
|
+
},
|
|
359
|
+
queryClient?: QueryClient,
|
|
360
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
206
361
|
/**
|
|
207
362
|
* @summary Gets the details of your event stream
|
|
208
363
|
*/
|
|
@@ -210,13 +365,18 @@ export type GetEventStreamQueryError = ErrorType<void | AsError>;
|
|
|
210
365
|
export function useGetEventStream<
|
|
211
366
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
212
367
|
TError = ErrorType<void | AsError>,
|
|
213
|
-
>(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
368
|
+
>(
|
|
369
|
+
options?: {
|
|
370
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
371
|
+
request?: SecondParameter<typeof customInstance>;
|
|
372
|
+
},
|
|
373
|
+
queryClient?: QueryClient,
|
|
374
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
217
375
|
const queryOptions = getGetEventStreamQueryOptions(options);
|
|
218
376
|
|
|
219
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
377
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
378
|
+
queryKey: DataTag<QueryKey, TData>;
|
|
379
|
+
};
|
|
220
380
|
|
|
221
381
|
query.queryKey = queryOptions.queryKey;
|
|
222
382
|
|
|
@@ -239,7 +399,9 @@ export const getGetEventStreamSuspenseQueryOptions = <
|
|
|
239
399
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
240
400
|
TError = ErrorType<void | AsError>,
|
|
241
401
|
>(options?: {
|
|
242
|
-
query?:
|
|
402
|
+
query?: Partial<
|
|
403
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
404
|
+
>;
|
|
243
405
|
request?: SecondParameter<typeof customInstance>;
|
|
244
406
|
}) => {
|
|
245
407
|
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
@@ -253,7 +415,7 @@ export const getGetEventStreamSuspenseQueryOptions = <
|
|
|
253
415
|
Awaited<ReturnType<typeof getEventStream>>,
|
|
254
416
|
TError,
|
|
255
417
|
TData
|
|
256
|
-
> & { queryKey: QueryKey };
|
|
418
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
257
419
|
};
|
|
258
420
|
|
|
259
421
|
export type GetEventStreamSuspenseQueryResult = NonNullable<
|
|
@@ -261,6 +423,42 @@ export type GetEventStreamSuspenseQueryResult = NonNullable<
|
|
|
261
423
|
>;
|
|
262
424
|
export type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
|
|
263
425
|
|
|
426
|
+
export function useGetEventStreamSuspense<
|
|
427
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
428
|
+
TError = ErrorType<void | AsError>,
|
|
429
|
+
>(
|
|
430
|
+
options: {
|
|
431
|
+
query: Partial<
|
|
432
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
433
|
+
>;
|
|
434
|
+
request?: SecondParameter<typeof customInstance>;
|
|
435
|
+
},
|
|
436
|
+
queryClient?: QueryClient,
|
|
437
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
438
|
+
export function useGetEventStreamSuspense<
|
|
439
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
440
|
+
TError = ErrorType<void | AsError>,
|
|
441
|
+
>(
|
|
442
|
+
options?: {
|
|
443
|
+
query?: Partial<
|
|
444
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
445
|
+
>;
|
|
446
|
+
request?: SecondParameter<typeof customInstance>;
|
|
447
|
+
},
|
|
448
|
+
queryClient?: QueryClient,
|
|
449
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
450
|
+
export function useGetEventStreamSuspense<
|
|
451
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
452
|
+
TError = ErrorType<void | AsError>,
|
|
453
|
+
>(
|
|
454
|
+
options?: {
|
|
455
|
+
query?: Partial<
|
|
456
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
457
|
+
>;
|
|
458
|
+
request?: SecondParameter<typeof customInstance>;
|
|
459
|
+
},
|
|
460
|
+
queryClient?: QueryClient,
|
|
461
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
|
|
264
462
|
/**
|
|
265
463
|
* @summary Gets the details of your event stream
|
|
266
464
|
*/
|
|
@@ -268,15 +466,21 @@ export type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
|
|
|
268
466
|
export function useGetEventStreamSuspense<
|
|
269
467
|
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
270
468
|
TError = ErrorType<void | AsError>,
|
|
271
|
-
>(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
469
|
+
>(
|
|
470
|
+
options?: {
|
|
471
|
+
query?: Partial<
|
|
472
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
473
|
+
>;
|
|
474
|
+
request?: SecondParameter<typeof customInstance>;
|
|
475
|
+
},
|
|
476
|
+
queryClient?: QueryClient,
|
|
477
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
|
|
275
478
|
const queryOptions = getGetEventStreamSuspenseQueryOptions(options);
|
|
276
479
|
|
|
277
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<
|
|
278
|
-
|
|
279
|
-
|
|
480
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
481
|
+
TData,
|
|
482
|
+
TError
|
|
483
|
+
> & { queryKey: DataTag<QueryKey, TData> };
|
|
280
484
|
|
|
281
485
|
query.queryKey = queryOptions.queryKey;
|
|
282
486
|
|
|
@@ -358,18 +562,18 @@ export type CreateEventStreamMutationError = ErrorType<AsError | void>;
|
|
|
358
562
|
/**
|
|
359
563
|
* @summary Create a new event stream
|
|
360
564
|
*/
|
|
361
|
-
export const useCreateEventStream = <
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
565
|
+
export const useCreateEventStream = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
566
|
+
options?: {
|
|
567
|
+
mutation?: UseMutationOptions<
|
|
568
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
569
|
+
TError,
|
|
570
|
+
{ data: EventStreamPostBodyBody },
|
|
571
|
+
TContext
|
|
572
|
+
>;
|
|
573
|
+
request?: SecondParameter<typeof customInstance>;
|
|
574
|
+
},
|
|
575
|
+
queryClient?: QueryClient,
|
|
576
|
+
): UseMutationResult<
|
|
373
577
|
Awaited<ReturnType<typeof createEventStream>>,
|
|
374
578
|
TError,
|
|
375
579
|
{ data: EventStreamPostBodyBody },
|
|
@@ -377,7 +581,7 @@ export const useCreateEventStream = <
|
|
|
377
581
|
> => {
|
|
378
582
|
const mutationOptions = getCreateEventStreamMutationOptions(options);
|
|
379
583
|
|
|
380
|
-
return useMutation(mutationOptions);
|
|
584
|
+
return useMutation(mutationOptions, queryClient);
|
|
381
585
|
};
|
|
382
586
|
/**
|
|
383
587
|
* You must be the user who created the event stream.
|
|
@@ -436,18 +640,18 @@ export type DeleteEventStreamMutationError = ErrorType<void | AsError>;
|
|
|
436
640
|
/**
|
|
437
641
|
* @summary Deletes an existing event stream (that you created)
|
|
438
642
|
*/
|
|
439
|
-
export const useDeleteEventStream = <
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
643
|
+
export const useDeleteEventStream = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
644
|
+
options?: {
|
|
645
|
+
mutation?: UseMutationOptions<
|
|
646
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
647
|
+
TError,
|
|
648
|
+
{ eventStreamId: number },
|
|
649
|
+
TContext
|
|
650
|
+
>;
|
|
651
|
+
request?: SecondParameter<typeof customInstance>;
|
|
652
|
+
},
|
|
653
|
+
queryClient?: QueryClient,
|
|
654
|
+
): UseMutationResult<
|
|
451
655
|
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
452
656
|
TError,
|
|
453
657
|
{ eventStreamId: number },
|
|
@@ -455,5 +659,5 @@ export const useDeleteEventStream = <
|
|
|
455
659
|
> => {
|
|
456
660
|
const mutationOptions = getDeleteEventStreamMutationOptions(options);
|
|
457
661
|
|
|
458
|
-
return useMutation(mutationOptions);
|
|
662
|
+
return useMutation(mutationOptions, queryClient);
|
|
459
663
|
};
|