@squonk/account-server-client 4.2.1 → 4.3.1
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/asset/asset.cjs +99 -126
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +99 -99
- package/asset/asset.d.ts +99 -99
- package/asset/asset.js +107 -134
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +73 -85
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +47 -47
- package/charges/charges.d.ts +47 -47
- package/charges/charges.js +78 -90
- package/charges/charges.js.map +1 -1
- package/chunk-3WKSNKHE.js +25 -0
- package/chunk-3WKSNKHE.js.map +1 -0
- package/chunk-NY2VJJG7.cjs +25 -0
- package/chunk-NY2VJJG7.cjs.map +1 -0
- package/{chunk-TKLTUR4R.cjs → chunk-RB2KVIEK.cjs} +1 -1
- package/chunk-RB2KVIEK.cjs.map +1 -0
- package/{chunk-EBOQPVLG.js → chunk-XYDLYMQ2.js} +1 -1
- package/chunk-XYDLYMQ2.js.map +1 -0
- package/event-stream/event-stream.cjs +53 -61
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +45 -45
- package/event-stream/event-stream.d.ts +45 -45
- package/event-stream/event-stream.js +58 -66
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +49 -57
- package/index.cjs.map +1 -1
- package/index.d.cts +796 -773
- package/index.d.ts +796 -773
- package/index.js +48 -56
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +38 -45
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +25 -25
- package/merchant/merchant.d.ts +25 -25
- package/merchant/merchant.js +42 -49
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +77 -87
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +72 -70
- package/organisation/organisation.d.ts +72 -70
- package/organisation/organisation.js +83 -93
- package/organisation/organisation.js.map +1 -1
- package/package.json +13 -16
- package/product/product.cjs +143 -153
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +100 -100
- package/product/product.d.ts +100 -100
- package/product/product.js +153 -163
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +863 -856
- package/src/asset/asset.ts +899 -634
- package/src/charges/charges.ts +822 -498
- package/src/custom-instance.ts +3 -3
- package/src/event-stream/event-stream.ts +531 -345
- package/src/index.ts +2 -2
- package/src/merchant/merchant.ts +355 -234
- package/src/options-mutator.ts +27 -0
- package/src/organisation/organisation.ts +812 -504
- package/src/product/product.ts +1373 -841
- package/src/state/state.ts +174 -127
- package/src/unit/unit.ts +1273 -603
- package/src/user/user.ts +895 -564
- package/state/state.cjs +22 -24
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +14 -14
- package/state/state.d.ts +14 -14
- package/state/state.js +24 -26
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +171 -106
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +200 -90
- package/unit/unit.d.ts +200 -90
- package/unit/unit.js +179 -114
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +94 -110
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +77 -77
- package/user/user.d.ts +77 -77
- package/user/user.js +101 -117
- package/user/user.js.map +1 -1
- package/chunk-EBOQPVLG.js.map +0 -1
- package/chunk-TKLTUR4R.cjs.map +0 -1
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
/**
|
|
3
|
-
* Generated by orval v7.
|
|
2
|
+
* Generated by orval v7.10.0 🍺
|
|
4
3
|
* Do not edit manually.
|
|
5
4
|
* Account Server API
|
|
6
5
|
* The Informatics Matters Account Server API.
|
|
7
6
|
|
|
8
7
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
9
8
|
|
|
10
|
-
* OpenAPI spec version: 4.
|
|
9
|
+
* OpenAPI spec version: 4.3
|
|
11
10
|
*/
|
|
12
|
-
import {
|
|
13
|
-
useMutation,
|
|
14
|
-
useQuery,
|
|
15
|
-
useSuspenseQuery
|
|
16
|
-
} from '@tanstack/react-query'
|
|
11
|
+
import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
|
|
17
12
|
import type {
|
|
18
13
|
DataTag,
|
|
19
14
|
DefinedInitialDataOptions,
|
|
20
15
|
DefinedUseQueryResult,
|
|
21
16
|
MutationFunction,
|
|
17
|
+
QueryClient,
|
|
22
18
|
QueryFunction,
|
|
23
19
|
QueryKey,
|
|
24
20
|
UndefinedInitialDataOptions,
|
|
@@ -27,307 +23,455 @@ import type {
|
|
|
27
23
|
UseQueryOptions,
|
|
28
24
|
UseQueryResult,
|
|
29
25
|
UseSuspenseQueryOptions,
|
|
30
|
-
UseSuspenseQueryResult
|
|
31
|
-
} from
|
|
26
|
+
UseSuspenseQueryResult,
|
|
27
|
+
} from "@tanstack/react-query";
|
|
28
|
+
|
|
32
29
|
import type {
|
|
33
30
|
AsError,
|
|
34
31
|
EventStreamGetPostResponse,
|
|
35
32
|
EventStreamPostBodyBody,
|
|
36
|
-
EventStreamVersionGetResponse
|
|
37
|
-
} from
|
|
38
|
-
import { customInstance } from '.././custom-instance';
|
|
39
|
-
import type { ErrorType } from '.././custom-instance';
|
|
40
|
-
|
|
33
|
+
EventStreamVersionGetResponse,
|
|
34
|
+
} from "../account-server-api.schemas";
|
|
41
35
|
|
|
42
|
-
|
|
36
|
+
import { customInstance } from ".././custom-instance";
|
|
37
|
+
import type { ErrorType } from ".././custom-instance";
|
|
38
|
+
import { queryMutator } from ".././options-mutator";
|
|
39
|
+
import { mutationMutator } from ".././options-mutator";
|
|
43
40
|
|
|
41
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
44
42
|
|
|
45
43
|
/**
|
|
46
|
-
* Gets the details of the installed event stream, which includes its **
|
|
44
|
+
* Gets the details of the installed event stream, which includes its **protocol**, and **name**.
|
|
47
45
|
|
|
48
46
|
* @summary Gets the details of the installed event stream
|
|
49
47
|
*/
|
|
50
48
|
export const getEventStreamVersion = (
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
options?: SecondParameter<typeof customInstance>,
|
|
50
|
+
signal?: AbortSignal,
|
|
53
51
|
) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
options);
|
|
60
|
-
}
|
|
61
|
-
|
|
52
|
+
return customInstance<EventStreamVersionGetResponse>(
|
|
53
|
+
{ url: `/event-stream/version`, method: "GET", signal },
|
|
54
|
+
options,
|
|
55
|
+
);
|
|
56
|
+
};
|
|
62
57
|
|
|
63
58
|
export const getGetEventStreamVersionQueryKey = () => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
59
|
+
return [`/event-stream/version`] as const;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const useGetEventStreamVersionQueryOptions = <
|
|
63
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
64
|
+
TError = ErrorType<void | AsError>,
|
|
65
|
+
>(options?: {
|
|
66
|
+
query?: Partial<
|
|
67
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
68
|
+
>;
|
|
69
|
+
request?: SecondParameter<typeof customInstance>;
|
|
70
|
+
}) => {
|
|
71
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
72
|
+
|
|
73
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();
|
|
74
|
+
|
|
75
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>
|
|
76
|
+
getEventStreamVersion(requestOptions, signal);
|
|
77
|
+
|
|
78
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
79
|
+
|
|
80
|
+
return customOptions as UseQueryOptions<
|
|
81
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
82
|
+
TError,
|
|
83
|
+
TData
|
|
84
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type GetEventStreamVersionQueryResult = NonNullable<
|
|
88
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
89
|
+
>;
|
|
90
|
+
export type GetEventStreamVersionQueryError = ErrorType<void | AsError>;
|
|
91
|
+
|
|
92
|
+
export function useGetEventStreamVersion<
|
|
93
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
94
|
+
TError = ErrorType<void | AsError>,
|
|
95
|
+
>(
|
|
96
|
+
options: {
|
|
97
|
+
query: Partial<
|
|
98
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
99
|
+
> &
|
|
100
|
+
Pick<
|
|
92
101
|
DefinedInitialDataOptions<
|
|
93
102
|
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
94
103
|
TError,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
104
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
105
|
+
>,
|
|
106
|
+
"initialData"
|
|
107
|
+
>;
|
|
108
|
+
request?: SecondParameter<typeof customInstance>;
|
|
109
|
+
},
|
|
110
|
+
queryClient?: QueryClient,
|
|
111
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
112
|
+
export function useGetEventStreamVersion<
|
|
113
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
114
|
+
TError = ErrorType<void | AsError>,
|
|
115
|
+
>(
|
|
116
|
+
options?: {
|
|
117
|
+
query?: Partial<
|
|
118
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
119
|
+
> &
|
|
120
|
+
Pick<
|
|
102
121
|
UndefinedInitialDataOptions<
|
|
103
122
|
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
104
123
|
TError,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
125
|
+
>,
|
|
126
|
+
"initialData"
|
|
127
|
+
>;
|
|
128
|
+
request?: SecondParameter<typeof customInstance>;
|
|
129
|
+
},
|
|
130
|
+
queryClient?: QueryClient,
|
|
131
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
132
|
+
export function useGetEventStreamVersion<
|
|
133
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
134
|
+
TError = ErrorType<void | AsError>,
|
|
135
|
+
>(
|
|
136
|
+
options?: {
|
|
137
|
+
query?: Partial<
|
|
138
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
139
|
+
>;
|
|
140
|
+
request?: SecondParameter<typeof customInstance>;
|
|
141
|
+
},
|
|
142
|
+
queryClient?: QueryClient,
|
|
143
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
114
144
|
/**
|
|
115
145
|
* @summary Gets the details of the installed event stream
|
|
116
146
|
*/
|
|
117
147
|
|
|
118
|
-
export function useGetEventStreamVersion<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
148
|
+
export function useGetEventStreamVersion<
|
|
149
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
150
|
+
TError = ErrorType<void | AsError>,
|
|
151
|
+
>(
|
|
152
|
+
options?: {
|
|
153
|
+
query?: Partial<
|
|
154
|
+
UseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
155
|
+
>;
|
|
156
|
+
request?: SecondParameter<typeof customInstance>;
|
|
157
|
+
},
|
|
158
|
+
queryClient?: QueryClient,
|
|
159
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
160
|
+
const queryOptions = useGetEventStreamVersionQueryOptions(options);
|
|
161
|
+
|
|
162
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
163
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
query.queryKey = queryOptions.queryKey;
|
|
128
167
|
|
|
129
168
|
return query;
|
|
130
169
|
}
|
|
131
170
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
export
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
171
|
+
export const useGetEventStreamVersionSuspenseQueryOptions = <
|
|
172
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
173
|
+
TError = ErrorType<void | AsError>,
|
|
174
|
+
>(options?: {
|
|
175
|
+
query?: Partial<
|
|
176
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
177
|
+
>;
|
|
178
|
+
request?: SecondParameter<typeof customInstance>;
|
|
179
|
+
}) => {
|
|
180
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
181
|
+
|
|
182
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamVersionQueryKey();
|
|
183
|
+
|
|
184
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamVersion>>> = ({ signal }) =>
|
|
185
|
+
getEventStreamVersion(requestOptions, signal);
|
|
186
|
+
|
|
187
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
188
|
+
|
|
189
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
190
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
191
|
+
TError,
|
|
192
|
+
TData
|
|
193
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export type GetEventStreamVersionSuspenseQueryResult = NonNullable<
|
|
197
|
+
Awaited<ReturnType<typeof getEventStreamVersion>>
|
|
198
|
+
>;
|
|
199
|
+
export type GetEventStreamVersionSuspenseQueryError = ErrorType<void | AsError>;
|
|
200
|
+
|
|
201
|
+
export function useGetEventStreamVersionSuspense<
|
|
202
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
203
|
+
TError = ErrorType<void | AsError>,
|
|
204
|
+
>(
|
|
205
|
+
options: {
|
|
206
|
+
query: Partial<
|
|
207
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
208
|
+
>;
|
|
209
|
+
request?: SecondParameter<typeof customInstance>;
|
|
210
|
+
},
|
|
211
|
+
queryClient?: QueryClient,
|
|
212
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
213
|
+
export function useGetEventStreamVersionSuspense<
|
|
214
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
215
|
+
TError = ErrorType<void | AsError>,
|
|
216
|
+
>(
|
|
217
|
+
options?: {
|
|
218
|
+
query?: Partial<
|
|
219
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
220
|
+
>;
|
|
221
|
+
request?: SecondParameter<typeof customInstance>;
|
|
222
|
+
},
|
|
223
|
+
queryClient?: QueryClient,
|
|
224
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
225
|
+
export function useGetEventStreamVersionSuspense<
|
|
226
|
+
TData = Awaited<ReturnType<typeof getEventStreamVersion>>,
|
|
227
|
+
TError = ErrorType<void | AsError>,
|
|
228
|
+
>(
|
|
229
|
+
options?: {
|
|
230
|
+
query?: Partial<
|
|
231
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamVersion>>, TError, TData>
|
|
232
|
+
>;
|
|
233
|
+
request?: SecondParameter<typeof customInstance>;
|
|
234
|
+
},
|
|
235
|
+
queryClient?: QueryClient,
|
|
236
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
168
237
|
/**
|
|
169
238
|
* @summary Gets the details of the installed event stream
|
|
170
239
|
*/
|
|
171
240
|
|
|
172
|
-
export function useGetEventStreamVersionSuspense<
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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 customInstance>;
|
|
250
|
+
},
|
|
251
|
+
queryClient?: QueryClient,
|
|
252
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
253
|
+
const queryOptions = useGetEventStreamVersionSuspenseQueryOptions(options);
|
|
254
|
+
|
|
255
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
256
|
+
TData,
|
|
257
|
+
TError
|
|
258
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
259
|
+
|
|
260
|
+
query.queryKey = queryOptions.queryKey;
|
|
182
261
|
|
|
183
262
|
return query;
|
|
184
263
|
}
|
|
185
264
|
|
|
186
|
-
|
|
187
|
-
|
|
188
265
|
/**
|
|
189
266
|
* Gets the details of your event stream, if you have created one. The response includes the event stream **id** and the **location** where events can be accessed.
|
|
190
267
|
|
|
191
268
|
* @summary Gets the details of your event stream
|
|
192
269
|
*/
|
|
193
270
|
export const getEventStream = (
|
|
194
|
-
|
|
195
|
-
|
|
271
|
+
options?: SecondParameter<typeof customInstance>,
|
|
272
|
+
signal?: AbortSignal,
|
|
196
273
|
) => {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
options);
|
|
203
|
-
}
|
|
204
|
-
|
|
274
|
+
return customInstance<EventStreamGetPostResponse>(
|
|
275
|
+
{ url: `/event-stream`, method: "GET", signal },
|
|
276
|
+
options,
|
|
277
|
+
);
|
|
278
|
+
};
|
|
205
279
|
|
|
206
280
|
export const getGetEventStreamQueryKey = () => {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
export
|
|
234
|
-
|
|
281
|
+
return [`/event-stream`] as const;
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
export const useGetEventStreamQueryOptions = <
|
|
285
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
286
|
+
TError = ErrorType<void | AsError>,
|
|
287
|
+
>(options?: {
|
|
288
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
289
|
+
request?: SecondParameter<typeof customInstance>;
|
|
290
|
+
}) => {
|
|
291
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
292
|
+
|
|
293
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
|
|
294
|
+
|
|
295
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>
|
|
296
|
+
getEventStream(requestOptions, signal);
|
|
297
|
+
|
|
298
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
299
|
+
|
|
300
|
+
return customOptions as UseQueryOptions<
|
|
301
|
+
Awaited<ReturnType<typeof getEventStream>>,
|
|
302
|
+
TError,
|
|
303
|
+
TData
|
|
304
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
export type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
|
|
308
|
+
export type GetEventStreamQueryError = ErrorType<void | AsError>;
|
|
309
|
+
|
|
310
|
+
export function useGetEventStream<
|
|
311
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
312
|
+
TError = ErrorType<void | AsError>,
|
|
313
|
+
>(
|
|
314
|
+
options: {
|
|
315
|
+
query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &
|
|
316
|
+
Pick<
|
|
235
317
|
DefinedInitialDataOptions<
|
|
236
318
|
Awaited<ReturnType<typeof getEventStream>>,
|
|
237
319
|
TError,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
320
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
321
|
+
>,
|
|
322
|
+
"initialData"
|
|
323
|
+
>;
|
|
324
|
+
request?: SecondParameter<typeof customInstance>;
|
|
325
|
+
},
|
|
326
|
+
queryClient?: QueryClient,
|
|
327
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
328
|
+
export function useGetEventStream<
|
|
329
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
330
|
+
TError = ErrorType<void | AsError>,
|
|
331
|
+
>(
|
|
332
|
+
options?: {
|
|
333
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> &
|
|
334
|
+
Pick<
|
|
245
335
|
UndefinedInitialDataOptions<
|
|
246
336
|
Awaited<ReturnType<typeof getEventStream>>,
|
|
247
337
|
TError,
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
338
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
339
|
+
>,
|
|
340
|
+
"initialData"
|
|
341
|
+
>;
|
|
342
|
+
request?: SecondParameter<typeof customInstance>;
|
|
343
|
+
},
|
|
344
|
+
queryClient?: QueryClient,
|
|
345
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
346
|
+
export function useGetEventStream<
|
|
347
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
348
|
+
TError = ErrorType<void | AsError>,
|
|
349
|
+
>(
|
|
350
|
+
options?: {
|
|
351
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
352
|
+
request?: SecondParameter<typeof customInstance>;
|
|
353
|
+
},
|
|
354
|
+
queryClient?: QueryClient,
|
|
355
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
257
356
|
/**
|
|
258
357
|
* @summary Gets the details of your event stream
|
|
259
358
|
*/
|
|
260
359
|
|
|
261
|
-
export function useGetEventStream<
|
|
262
|
-
|
|
360
|
+
export function useGetEventStream<
|
|
361
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
362
|
+
TError = ErrorType<void | AsError>,
|
|
363
|
+
>(
|
|
364
|
+
options?: {
|
|
365
|
+
query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
|
|
366
|
+
request?: SecondParameter<typeof customInstance>;
|
|
367
|
+
},
|
|
368
|
+
queryClient?: QueryClient,
|
|
369
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
370
|
+
const queryOptions = useGetEventStreamQueryOptions(options);
|
|
263
371
|
|
|
264
|
-
|
|
372
|
+
const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
|
|
373
|
+
queryKey: DataTag<QueryKey, TData, TError>;
|
|
374
|
+
};
|
|
265
375
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
269
|
-
|
|
270
|
-
query.queryKey = queryOptions.queryKey ;
|
|
376
|
+
query.queryKey = queryOptions.queryKey;
|
|
271
377
|
|
|
272
378
|
return query;
|
|
273
379
|
}
|
|
274
380
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
export
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
381
|
+
export const useGetEventStreamSuspenseQueryOptions = <
|
|
382
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
383
|
+
TError = ErrorType<void | AsError>,
|
|
384
|
+
>(options?: {
|
|
385
|
+
query?: Partial<
|
|
386
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
387
|
+
>;
|
|
388
|
+
request?: SecondParameter<typeof customInstance>;
|
|
389
|
+
}) => {
|
|
390
|
+
const { query: queryOptions, request: requestOptions } = options ?? {};
|
|
391
|
+
|
|
392
|
+
const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
|
|
393
|
+
|
|
394
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) =>
|
|
395
|
+
getEventStream(requestOptions, signal);
|
|
396
|
+
|
|
397
|
+
const customOptions = queryMutator({ ...queryOptions, queryKey, queryFn });
|
|
398
|
+
|
|
399
|
+
return customOptions as UseSuspenseQueryOptions<
|
|
400
|
+
Awaited<ReturnType<typeof getEventStream>>,
|
|
401
|
+
TError,
|
|
402
|
+
TData
|
|
403
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
export type GetEventStreamSuspenseQueryResult = NonNullable<
|
|
407
|
+
Awaited<ReturnType<typeof getEventStream>>
|
|
408
|
+
>;
|
|
409
|
+
export type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
|
|
410
|
+
|
|
411
|
+
export function useGetEventStreamSuspense<
|
|
412
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
413
|
+
TError = ErrorType<void | AsError>,
|
|
414
|
+
>(
|
|
415
|
+
options: {
|
|
416
|
+
query: Partial<
|
|
417
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
418
|
+
>;
|
|
419
|
+
request?: SecondParameter<typeof customInstance>;
|
|
420
|
+
},
|
|
421
|
+
queryClient?: QueryClient,
|
|
422
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
423
|
+
export function useGetEventStreamSuspense<
|
|
424
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
425
|
+
TError = ErrorType<void | AsError>,
|
|
426
|
+
>(
|
|
427
|
+
options?: {
|
|
428
|
+
query?: Partial<
|
|
429
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
430
|
+
>;
|
|
431
|
+
request?: SecondParameter<typeof customInstance>;
|
|
432
|
+
},
|
|
433
|
+
queryClient?: QueryClient,
|
|
434
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
435
|
+
export function useGetEventStreamSuspense<
|
|
436
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
437
|
+
TError = ErrorType<void | AsError>,
|
|
438
|
+
>(
|
|
439
|
+
options?: {
|
|
440
|
+
query?: Partial<
|
|
441
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
442
|
+
>;
|
|
443
|
+
request?: SecondParameter<typeof customInstance>;
|
|
444
|
+
},
|
|
445
|
+
queryClient?: QueryClient,
|
|
446
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
311
447
|
/**
|
|
312
448
|
* @summary Gets the details of your event stream
|
|
313
449
|
*/
|
|
314
450
|
|
|
315
|
-
export function useGetEventStreamSuspense<
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
451
|
+
export function useGetEventStreamSuspense<
|
|
452
|
+
TData = Awaited<ReturnType<typeof getEventStream>>,
|
|
453
|
+
TError = ErrorType<void | AsError>,
|
|
454
|
+
>(
|
|
455
|
+
options?: {
|
|
456
|
+
query?: Partial<
|
|
457
|
+
UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>
|
|
458
|
+
>;
|
|
459
|
+
request?: SecondParameter<typeof customInstance>;
|
|
460
|
+
},
|
|
461
|
+
queryClient?: QueryClient,
|
|
462
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
463
|
+
const queryOptions = useGetEventStreamSuspenseQueryOptions(options);
|
|
464
|
+
|
|
465
|
+
const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
|
|
466
|
+
TData,
|
|
467
|
+
TError
|
|
468
|
+
> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
469
|
+
|
|
470
|
+
query.queryKey = queryOptions.queryKey;
|
|
325
471
|
|
|
326
472
|
return query;
|
|
327
473
|
}
|
|
328
474
|
|
|
329
|
-
|
|
330
|
-
|
|
331
475
|
/**
|
|
332
476
|
* Creates a new event stream for the authenticated user. Event streams deliver near-real-time events to the user, typically through a long-running *Socket*. The protocol is dependent on the Event Stream Service that has been installed. Our **Python FastAPI WebSocket** service is one such service.
|
|
333
477
|
|
|
@@ -342,125 +486,167 @@ A user is only permitted one event stream.
|
|
|
342
486
|
* @summary Create a new event stream
|
|
343
487
|
*/
|
|
344
488
|
export const createEventStream = (
|
|
345
|
-
|
|
346
|
-
|
|
489
|
+
eventStreamPostBodyBody: EventStreamPostBodyBody,
|
|
490
|
+
options?: SecondParameter<typeof customInstance>,
|
|
491
|
+
signal?: AbortSignal,
|
|
347
492
|
) => {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
headers: {
|
|
353
|
-
data: eventStreamPostBodyBody,
|
|
493
|
+
return customInstance<EventStreamGetPostResponse>(
|
|
494
|
+
{
|
|
495
|
+
url: `/event-stream`,
|
|
496
|
+
method: "POST",
|
|
497
|
+
headers: { "Content-Type": "application/json" },
|
|
498
|
+
data: eventStreamPostBodyBody,
|
|
499
|
+
signal,
|
|
354
500
|
},
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
501
|
+
options,
|
|
502
|
+
);
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
export const useCreateEventStreamMutationOptions = <
|
|
506
|
+
TError = ErrorType<AsError | void>,
|
|
507
|
+
TContext = unknown,
|
|
508
|
+
>(options?: {
|
|
509
|
+
mutation?: UseMutationOptions<
|
|
510
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
511
|
+
TError,
|
|
512
|
+
{ data: EventStreamPostBodyBody },
|
|
513
|
+
TContext
|
|
514
|
+
>;
|
|
515
|
+
request?: SecondParameter<typeof customInstance>;
|
|
516
|
+
}): UseMutationOptions<
|
|
517
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
518
|
+
TError,
|
|
519
|
+
{ data: EventStreamPostBodyBody },
|
|
520
|
+
TContext
|
|
521
|
+
> => {
|
|
522
|
+
const mutationKey = ["createEventStream"];
|
|
523
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
524
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
525
|
+
? options
|
|
526
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
527
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
528
|
+
|
|
529
|
+
const mutationFn: MutationFunction<
|
|
530
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
531
|
+
{ data: EventStreamPostBodyBody }
|
|
532
|
+
> = (props) => {
|
|
533
|
+
const { data } = props ?? {};
|
|
534
|
+
|
|
535
|
+
return createEventStream(data, requestOptions);
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
539
|
+
|
|
540
|
+
return customOptions;
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
export type CreateEventStreamMutationResult = NonNullable<
|
|
544
|
+
Awaited<ReturnType<typeof createEventStream>>
|
|
545
|
+
>;
|
|
546
|
+
export type CreateEventStreamMutationBody = EventStreamPostBodyBody;
|
|
547
|
+
export type CreateEventStreamMutationError = ErrorType<AsError | void>;
|
|
358
548
|
|
|
359
|
-
|
|
360
|
-
export const getCreateEventStreamMutationOptions = <TData = Awaited<ReturnType<typeof createEventStream>>, TError = ErrorType<AsError | void>,
|
|
361
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: EventStreamPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
362
|
-
) => {
|
|
363
|
-
const mutationKey = ['createEventStream'];
|
|
364
|
-
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
365
|
-
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
366
|
-
options
|
|
367
|
-
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
368
|
-
: {mutation: { mutationKey, }, request: undefined};
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, {data: EventStreamPostBodyBody}> = (props) => {
|
|
374
|
-
const {data} = props ?? {};
|
|
375
|
-
|
|
376
|
-
return createEventStream(data,requestOptions)
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{data: EventStreamPostBodyBody}, TContext>}
|
|
383
|
-
|
|
384
|
-
export type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>
|
|
385
|
-
export type CreateEventStreamMutationBody = EventStreamPostBodyBody
|
|
386
|
-
export type CreateEventStreamMutationError = ErrorType<AsError | void>
|
|
387
|
-
|
|
388
|
-
/**
|
|
549
|
+
/**
|
|
389
550
|
* @summary Create a new event stream
|
|
390
551
|
*/
|
|
391
|
-
export const useCreateEventStream = <
|
|
392
|
-
|
|
552
|
+
export const useCreateEventStream = <TError = ErrorType<AsError | void>, TContext = unknown>(
|
|
553
|
+
options?: {
|
|
554
|
+
mutation?: UseMutationOptions<
|
|
555
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
556
|
+
TError,
|
|
557
|
+
{ data: EventStreamPostBodyBody },
|
|
558
|
+
TContext
|
|
559
|
+
>;
|
|
560
|
+
request?: SecondParameter<typeof customInstance>;
|
|
561
|
+
},
|
|
562
|
+
queryClient?: QueryClient,
|
|
393
563
|
): UseMutationResult<
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
/**
|
|
564
|
+
Awaited<ReturnType<typeof createEventStream>>,
|
|
565
|
+
TError,
|
|
566
|
+
{ data: EventStreamPostBodyBody },
|
|
567
|
+
TContext
|
|
568
|
+
> => {
|
|
569
|
+
const mutationOptions = useCreateEventStreamMutationOptions(options);
|
|
570
|
+
|
|
571
|
+
return useMutation(mutationOptions, queryClient);
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
405
574
|
* You must be the user who created the event stream.
|
|
406
575
|
|
|
407
576
|
* @summary Deletes an existing event stream (that you created)
|
|
408
577
|
*/
|
|
409
578
|
export const deleteEventStream = (
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
return customInstance<void>(
|
|
415
|
-
{url: `/event-stream/${eventStreamId}`, method: 'DELETE'
|
|
416
|
-
},
|
|
417
|
-
options);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
export const getDeleteEventStreamMutationOptions = <TData = Awaited<ReturnType<typeof deleteEventStream>>, TError = ErrorType<void | AsError>,
|
|
423
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
579
|
+
eventStreamId: number,
|
|
580
|
+
options?: SecondParameter<typeof customInstance>,
|
|
424
581
|
) => {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
582
|
+
return customInstance<void>({ url: `/event-stream/${eventStreamId}`, method: "DELETE" }, options);
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
export const useDeleteEventStreamMutationOptions = <
|
|
586
|
+
TError = ErrorType<void | AsError>,
|
|
587
|
+
TContext = unknown,
|
|
588
|
+
>(options?: {
|
|
589
|
+
mutation?: UseMutationOptions<
|
|
590
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
591
|
+
TError,
|
|
592
|
+
{ eventStreamId: number },
|
|
593
|
+
TContext
|
|
594
|
+
>;
|
|
595
|
+
request?: SecondParameter<typeof customInstance>;
|
|
596
|
+
}): UseMutationOptions<
|
|
597
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
598
|
+
TError,
|
|
599
|
+
{ eventStreamId: number },
|
|
600
|
+
TContext
|
|
601
|
+
> => {
|
|
602
|
+
const mutationKey = ["deleteEventStream"];
|
|
603
|
+
const { mutation: mutationOptions, request: requestOptions } = options
|
|
604
|
+
? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey
|
|
605
|
+
? options
|
|
606
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
607
|
+
: { mutation: { mutationKey }, request: undefined };
|
|
608
|
+
|
|
609
|
+
const mutationFn: MutationFunction<
|
|
610
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
611
|
+
{ eventStreamId: number }
|
|
612
|
+
> = (props) => {
|
|
613
|
+
const { eventStreamId } = props ?? {};
|
|
614
|
+
|
|
615
|
+
return deleteEventStream(eventStreamId, requestOptions);
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
const customOptions = mutationMutator({ ...mutationOptions, mutationFn });
|
|
619
|
+
|
|
620
|
+
return customOptions;
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
export type DeleteEventStreamMutationResult = NonNullable<
|
|
624
|
+
Awaited<ReturnType<typeof deleteEventStream>>
|
|
625
|
+
>;
|
|
626
|
+
|
|
627
|
+
export type DeleteEventStreamMutationError = ErrorType<void | AsError>;
|
|
440
628
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{eventStreamId: number}, TContext>}
|
|
445
|
-
|
|
446
|
-
export type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>
|
|
447
|
-
|
|
448
|
-
export type DeleteEventStreamMutationError = ErrorType<void | AsError>
|
|
449
|
-
|
|
450
|
-
/**
|
|
629
|
+
/**
|
|
451
630
|
* @summary Deletes an existing event stream (that you created)
|
|
452
631
|
*/
|
|
453
|
-
export const useDeleteEventStream = <
|
|
454
|
-
|
|
632
|
+
export const useDeleteEventStream = <TError = ErrorType<void | AsError>, TContext = unknown>(
|
|
633
|
+
options?: {
|
|
634
|
+
mutation?: UseMutationOptions<
|
|
635
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
636
|
+
TError,
|
|
637
|
+
{ eventStreamId: number },
|
|
638
|
+
TContext
|
|
639
|
+
>;
|
|
640
|
+
request?: SecondParameter<typeof customInstance>;
|
|
641
|
+
},
|
|
642
|
+
queryClient?: QueryClient,
|
|
455
643
|
): UseMutationResult<
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
644
|
+
Awaited<ReturnType<typeof deleteEventStream>>,
|
|
645
|
+
TError,
|
|
646
|
+
{ eventStreamId: number },
|
|
647
|
+
TContext
|
|
648
|
+
> => {
|
|
649
|
+
const mutationOptions = useDeleteEventStreamMutationOptions(options);
|
|
650
|
+
|
|
651
|
+
return useMutation(mutationOptions, queryClient);
|
|
652
|
+
};
|