@squonk/account-server-client 2.1.0-rc.2 → 2.1.0-rc.4

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.
Files changed (77) hide show
  1. package/admin/admin.cjs +14 -7
  2. package/admin/admin.cjs.map +1 -1
  3. package/admin/admin.d.cts +33 -0
  4. package/admin/admin.d.ts +4 -1
  5. package/admin/admin.js +14 -7
  6. package/admin/admin.js.map +1 -1
  7. package/asset/asset.cjs +44 -19
  8. package/asset/asset.cjs.map +1 -1
  9. package/asset/asset.d.cts +243 -0
  10. package/asset/asset.d.ts +49 -23
  11. package/asset/asset.js +37 -12
  12. package/asset/asset.js.map +1 -1
  13. package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
  14. package/chunk-J22A7LHX.cjs.map +1 -0
  15. package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
  16. package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
  17. package/{custom-instance-35e5d4fd.d.ts → custom-instance-37bb38c1.d.ts} +159 -159
  18. package/event-stream/event-stream.cjs +34 -18
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +108 -0
  21. package/event-stream/event-stream.d.ts +16 -4
  22. package/event-stream/event-stream.js +31 -15
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +10 -10
  25. package/index.cjs.map +1 -1
  26. package/index.d.cts +2 -0
  27. package/index.d.ts +1 -1
  28. package/index.js +9 -9
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +23 -13
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +57 -0
  33. package/merchant/merchant.d.ts +7 -1
  34. package/merchant/merchant.js +22 -12
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +50 -25
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +203 -0
  39. package/organisation/organisation.d.ts +31 -10
  40. package/organisation/organisation.js +44 -19
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +12 -12
  43. package/product/product.cjs +80 -44
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +280 -0
  46. package/product/product.d.ts +40 -10
  47. package/product/product.js +71 -35
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +268 -276
  50. package/src/admin/admin.ts +72 -78
  51. package/src/asset/asset.ts +453 -560
  52. package/src/event-stream/event-stream.ts +222 -268
  53. package/src/merchant/merchant.ts +125 -136
  54. package/src/organisation/organisation.ts +394 -484
  55. package/src/product/product.ts +557 -682
  56. package/src/state/state.ts +70 -69
  57. package/src/unit/unit.ts +494 -593
  58. package/src/user/user.ts +377 -463
  59. package/state/state.cjs +13 -7
  60. package/state/state.cjs.map +1 -1
  61. package/state/state.d.cts +29 -0
  62. package/state/state.d.ts +4 -1
  63. package/state/state.js +13 -7
  64. package/state/state.js.map +1 -1
  65. package/unit/unit.cjs +59 -28
  66. package/unit/unit.cjs.map +1 -1
  67. package/unit/unit.d.cts +254 -0
  68. package/unit/unit.d.ts +43 -16
  69. package/unit/unit.js +52 -21
  70. package/unit/unit.js.map +1 -1
  71. package/user/user.cjs +52 -21
  72. package/user/user.cjs.map +1 -1
  73. package/user/user.d.cts +220 -0
  74. package/user/user.d.ts +31 -10
  75. package/user/user.js +46 -15
  76. package/user/user.js.map +1 -1
  77. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.15.0 🍺
2
+ * Generated by orval v6.20.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,99 +8,98 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 2.1
10
10
  */
11
- import { useQuery, useMutation } from "@tanstack/react-query";
11
+ import {
12
+ useMutation,
13
+ useQuery
14
+ } from '@tanstack/react-query'
12
15
  import type {
13
- UseQueryOptions,
14
- UseMutationOptions,
15
- QueryFunction,
16
16
  MutationFunction,
17
- UseQueryResult,
17
+ QueryFunction,
18
18
  QueryKey,
19
- } from "@tanstack/react-query";
19
+ UseMutationOptions,
20
+ UseQueryOptions,
21
+ UseQueryResult
22
+ } from '@tanstack/react-query'
20
23
  import type {
21
- EventStreamGetPostResponse,
22
24
  AsError,
23
- } from "../account-server-api.schemas";
24
- import { customInstance } from ".././custom-instance";
25
- import type { ErrorType } from ".././custom-instance";
25
+ EventStreamGetPostResponse
26
+ } from '../account-server-api.schemas'
27
+ import { customInstance } from '.././custom-instance';
28
+ import type { ErrorType } from '.././custom-instance';
29
+
26
30
 
27
31
  // eslint-disable-next-line
28
- type SecondParameter<T extends (...args: any) => any> = T extends (
32
+ type SecondParameter<T extends (...args: any) => any> = T extends (
29
33
  config: any,
30
- args: infer P
34
+ args: infer P,
31
35
  ) => any
32
36
  ? P
33
37
  : never;
34
38
 
39
+
35
40
  /**
36
41
  * Gets your EventStream ID and read token, if you have created one.
37
42
 
38
43
  * @summary Gets the details of your EventStream
39
44
  */
40
45
  export const getEventStream = (
41
- options?: SecondParameter<typeof customInstance>,
42
- signal?: AbortSignal
46
+
47
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
43
48
  ) => {
44
- return customInstance<EventStreamGetPostResponse>(
45
- { url: `/event-stream`, method: "get", signal },
46
- options
47
- );
48
- };
49
-
50
- export const getGetEventStreamQueryKey = () => ["account-server-api", `/event-stream`] as const;
51
-
52
- export const getGetEventStreamQueryOptions = <
53
- TData = Awaited<ReturnType<typeof getEventStream>>,
54
- TError = ErrorType<void | AsError>
55
- >(options?: {
56
- query?: UseQueryOptions<
57
- Awaited<ReturnType<typeof getEventStream>>,
58
- TError,
59
- TData
60
- >;
61
- request?: SecondParameter<typeof customInstance>;
62
- }): UseQueryOptions<
63
- Awaited<ReturnType<typeof getEventStream>>,
64
- TError,
65
- TData
66
- > & { queryKey: QueryKey } => {
67
- const { query: queryOptions, request: requestOptions } = options ?? {};
68
-
69
- const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
70
-
71
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({
72
- signal,
73
- }) => getEventStream(requestOptions, signal);
74
-
75
- return { queryKey, queryFn, ...queryOptions };
76
- };
77
-
78
- export type GetEventStreamQueryResult = NonNullable<
79
- Awaited<ReturnType<typeof getEventStream>>
80
- >;
81
- export type GetEventStreamQueryError = ErrorType<void | AsError>;
82
-
83
- export const useGetEventStream = <
84
- TData = Awaited<ReturnType<typeof getEventStream>>,
85
- TError = ErrorType<void | AsError>
86
- >(options?: {
87
- query?: UseQueryOptions<
88
- Awaited<ReturnType<typeof getEventStream>>,
89
- TError,
90
- TData
91
- >;
92
- request?: SecondParameter<typeof customInstance>;
93
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
94
- const queryOptions = getGetEventStreamQueryOptions(options);
95
-
96
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
97
- queryKey: QueryKey;
98
- };
99
-
100
- query.queryKey = queryOptions.queryKey;
49
+
50
+
51
+ return customInstance<EventStreamGetPostResponse>(
52
+ {url: `/event-stream`, method: 'get', signal
53
+ },
54
+ options);
55
+ }
56
+
57
+
58
+ export const getGetEventStreamQueryKey = () => {
59
+
60
+ return ["account-server-api", `/event-stream`] as const;
61
+ }
62
+
63
+
64
+ export const getGetEventStreamQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
65
+ ) => {
66
+
67
+ const {query: queryOptions, request: requestOptions} = options ?? {};
68
+
69
+ const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
70
+
71
+
72
+
73
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);
74
+
75
+
76
+
77
+
78
+
79
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }
80
+ }
81
+
82
+ export type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>
83
+ export type GetEventStreamQueryError = ErrorType<void | AsError>
84
+
85
+ /**
86
+ * @summary Gets the details of your EventStream
87
+ */
88
+ export const useGetEventStream = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(
89
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
90
+
91
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
92
+
93
+ const queryOptions = getGetEventStreamQueryOptions(options)
94
+
95
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
96
+
97
+ query.queryKey = queryOptions.queryKey ;
101
98
 
102
99
  return query;
103
- };
100
+ }
101
+
102
+
104
103
 
105
104
  /**
106
105
  * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.
@@ -110,68 +109,55 @@ A user is only permitted one event stream.
110
109
  * @summary Create a new Server-Sent Events EventStream
111
110
  */
112
111
  export const createEventStream = (
113
- options?: SecondParameter<typeof customInstance>
112
+
113
+ options?: SecondParameter<typeof customInstance>,) => {
114
+
115
+
116
+ return customInstance<EventStreamGetPostResponse>(
117
+ {url: `/event-stream`, method: 'post'
118
+ },
119
+ options);
120
+ }
121
+
122
+
123
+
124
+ export const getCreateEventStreamMutationOptions = <TError = ErrorType<AsError | void>,
125
+ TVariables = void,
126
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,TVariables, TContext>, request?: SecondParameter<typeof customInstance>}
127
+ ): UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,TVariables, TContext> => {
128
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
129
+
130
+
131
+
132
+
133
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, TVariables> = () => {
134
+
135
+
136
+ return createEventStream(requestOptions)
137
+ }
138
+
139
+
140
+
141
+
142
+ return { mutationFn, ...mutationOptions }}
143
+
144
+ export type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>
145
+
146
+ export type CreateEventStreamMutationError = ErrorType<AsError | void>
147
+
148
+ /**
149
+ * @summary Create a new Server-Sent Events EventStream
150
+ */
151
+ export const useCreateEventStream = <TError = ErrorType<AsError | void>,
152
+ TVariables = void,
153
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,TVariables, TContext>, request?: SecondParameter<typeof customInstance>}
114
154
  ) => {
115
- return customInstance<EventStreamGetPostResponse>(
116
- { url: `/event-stream`, method: "post" },
117
- options
118
- );
119
- };
120
-
121
- export const getCreateEventStreamMutationOptions = <
122
- TError = ErrorType<AsError | void>,
123
- TVariables = void,
124
- TContext = unknown
125
- >(options?: {
126
- mutation?: UseMutationOptions<
127
- Awaited<ReturnType<typeof createEventStream>>,
128
- TError,
129
- TVariables,
130
- TContext
131
- >;
132
- request?: SecondParameter<typeof customInstance>;
133
- }): UseMutationOptions<
134
- Awaited<ReturnType<typeof createEventStream>>,
135
- TError,
136
- TVariables,
137
- TContext
138
- > => {
139
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
140
-
141
- const mutationFn: MutationFunction<
142
- Awaited<ReturnType<typeof createEventStream>>,
143
- TVariables
144
- > = () => {
145
- return createEventStream(requestOptions);
146
- };
147
-
148
- return { mutationFn, ...mutationOptions };
149
- };
150
-
151
- export type CreateEventStreamMutationResult = NonNullable<
152
- Awaited<ReturnType<typeof createEventStream>>
153
- >;
154
-
155
- export type CreateEventStreamMutationError = ErrorType<AsError | void>;
156
-
157
- export const useCreateEventStream = <
158
- TError = ErrorType<AsError | void>,
159
- TVariables = void,
160
- TContext = unknown
161
- >(options?: {
162
- mutation?: UseMutationOptions<
163
- Awaited<ReturnType<typeof createEventStream>>,
164
- TError,
165
- TVariables,
166
- TContext
167
- >;
168
- request?: SecondParameter<typeof customInstance>;
169
- }) => {
170
- const mutationOptions = getCreateEventStreamMutationOptions(options);
171
-
172
- return useMutation(mutationOptions);
173
- };
174
- /**
155
+
156
+ const mutationOptions = getCreateEventStreamMutationOptions(options);
157
+
158
+ return useMutation(mutationOptions);
159
+ }
160
+ /**
175
161
  * Gets events that you are entitled to receive. Events are delivered as **Server Sent Events** and you are expected to continuously read form this endpoint or it will be closed.
176
162
 
177
163
  This is an un-authenticated endpoint. In order to read from the stream the caller must provide the **read token** they were allocated when the stream was created The token must be provided in the request header property `X-IM-AS-EventStreamReadToken`.
@@ -179,82 +165,63 @@ This is an un-authenticated endpoint. In order to read from the stream the calle
179
165
  * @summary Subscribe to Server-Sent Events events from an EventStream
180
166
  */
181
167
  export const getEventStreamEvents = (
182
- eventStreamId: number,
183
- options?: SecondParameter<typeof customInstance>,
184
- signal?: AbortSignal
168
+ eventStreamId: number,
169
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
170
+ ) => {
171
+
172
+
173
+ return customInstance<string>(
174
+ {url: `/event-stream/${eventStreamId}`, method: 'get', signal
175
+ },
176
+ options);
177
+ }
178
+
179
+
180
+ export const getGetEventStreamEventsQueryKey = (eventStreamId: number,) => {
181
+
182
+ return ["account-server-api", `/event-stream/${eventStreamId}`] as const;
183
+ }
184
+
185
+
186
+ export const getGetEventStreamEventsQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
185
187
  ) => {
186
- return customInstance<string>(
187
- { url: `/event-stream/${eventStreamId}`, method: "get", signal },
188
- options
189
- );
190
- };
191
-
192
- export const getGetEventStreamEventsQueryKey = (eventStreamId: number) =>
193
- ["account-server-api", `/event-stream/${eventStreamId}`] as const;
194
-
195
- export const getGetEventStreamEventsQueryOptions = <
196
- TData = Awaited<ReturnType<typeof getEventStreamEvents>>,
197
- TError = ErrorType<void | AsError>
198
- >(
199
- eventStreamId: number,
200
- options?: {
201
- query?: UseQueryOptions<
202
- Awaited<ReturnType<typeof getEventStreamEvents>>,
203
- TError,
204
- TData
205
- >;
206
- request?: SecondParameter<typeof customInstance>;
207
- }
208
- ): UseQueryOptions<
209
- Awaited<ReturnType<typeof getEventStreamEvents>>,
210
- TError,
211
- TData
212
- > & { queryKey: QueryKey } => {
213
- const { query: queryOptions, request: requestOptions } = options ?? {};
214
-
215
- const queryKey =
216
- queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);
217
-
218
- const queryFn: QueryFunction<
219
- Awaited<ReturnType<typeof getEventStreamEvents>>
220
- > = ({ signal }) =>
221
- getEventStreamEvents(eventStreamId, requestOptions, signal);
222
-
223
- return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };
224
- };
225
-
226
- export type GetEventStreamEventsQueryResult = NonNullable<
227
- Awaited<ReturnType<typeof getEventStreamEvents>>
228
- >;
229
- export type GetEventStreamEventsQueryError = ErrorType<void | AsError>;
230
-
231
- export const useGetEventStreamEvents = <
232
- TData = Awaited<ReturnType<typeof getEventStreamEvents>>,
233
- TError = ErrorType<void | AsError>
234
- >(
235
- eventStreamId: number,
236
- options?: {
237
- query?: UseQueryOptions<
238
- Awaited<ReturnType<typeof getEventStreamEvents>>,
239
- TError,
240
- TData
241
- >;
242
- request?: SecondParameter<typeof customInstance>;
243
- }
244
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
245
- const queryOptions = getGetEventStreamEventsQueryOptions(
246
- eventStreamId,
247
- options
248
- );
249
-
250
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
251
- queryKey: QueryKey;
252
- };
253
-
254
- query.queryKey = queryOptions.queryKey;
188
+
189
+ const {query: queryOptions, request: requestOptions} = options ?? {};
190
+
191
+ const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);
192
+
193
+
194
+
195
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);
196
+
197
+
198
+
199
+
200
+
201
+ return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }
202
+ }
203
+
204
+ export type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>
205
+ export type GetEventStreamEventsQueryError = ErrorType<void | AsError>
206
+
207
+ /**
208
+ * @summary Subscribe to Server-Sent Events events from an EventStream
209
+ */
210
+ export const useGetEventStreamEvents = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(
211
+ eventStreamId: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
212
+
213
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
214
+
215
+ const queryOptions = getGetEventStreamEventsQueryOptions(eventStreamId,options)
216
+
217
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
218
+
219
+ query.queryKey = queryOptions.queryKey ;
255
220
 
256
221
  return query;
257
- };
222
+ }
223
+
224
+
258
225
 
259
226
  /**
260
227
  * Deletes an Event Stream.
@@ -264,65 +231,52 @@ You must be the user who created the event stream.
264
231
  * @summary Deletes an existing EventStream (that you created)
265
232
  */
266
233
  export const deleteEventStream = (
267
- eventStreamId: number,
268
- options?: SecondParameter<typeof customInstance>
234
+ eventStreamId: number,
235
+ options?: SecondParameter<typeof customInstance>,) => {
236
+
237
+
238
+ return customInstance<void>(
239
+ {url: `/event-stream/${eventStreamId}`, method: 'delete'
240
+ },
241
+ options);
242
+ }
243
+
244
+
245
+
246
+ export const getDeleteEventStreamMutationOptions = <TError = ErrorType<AsError>,
247
+
248
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
249
+ ): UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext> => {
250
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
251
+
252
+
253
+
254
+
255
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteEventStream>>, {eventStreamId: number}> = (props) => {
256
+ const {eventStreamId} = props ?? {};
257
+
258
+ return deleteEventStream(eventStreamId,requestOptions)
259
+ }
260
+
261
+
262
+
263
+
264
+ return { mutationFn, ...mutationOptions }}
265
+
266
+ export type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>
267
+
268
+ export type DeleteEventStreamMutationError = ErrorType<AsError>
269
+
270
+ /**
271
+ * @summary Deletes an existing EventStream (that you created)
272
+ */
273
+ export const useDeleteEventStream = <TError = ErrorType<AsError>,
274
+
275
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
269
276
  ) => {
270
- return customInstance<void>(
271
- { url: `/event-stream/${eventStreamId}`, method: "delete" },
272
- options
273
- );
274
- };
275
-
276
- export const getDeleteEventStreamMutationOptions = <
277
- TError = ErrorType<AsError>,
278
- TContext = unknown
279
- >(options?: {
280
- mutation?: UseMutationOptions<
281
- Awaited<ReturnType<typeof deleteEventStream>>,
282
- TError,
283
- { eventStreamId: number },
284
- TContext
285
- >;
286
- request?: SecondParameter<typeof customInstance>;
287
- }): UseMutationOptions<
288
- Awaited<ReturnType<typeof deleteEventStream>>,
289
- TError,
290
- { eventStreamId: number },
291
- TContext
292
- > => {
293
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
294
-
295
- const mutationFn: MutationFunction<
296
- Awaited<ReturnType<typeof deleteEventStream>>,
297
- { eventStreamId: number }
298
- > = (props) => {
299
- const { eventStreamId } = props ?? {};
300
-
301
- return deleteEventStream(eventStreamId, requestOptions);
302
- };
303
-
304
- return { mutationFn, ...mutationOptions };
305
- };
306
-
307
- export type DeleteEventStreamMutationResult = NonNullable<
308
- Awaited<ReturnType<typeof deleteEventStream>>
309
- >;
310
-
311
- export type DeleteEventStreamMutationError = ErrorType<AsError>;
312
-
313
- export const useDeleteEventStream = <
314
- TError = ErrorType<AsError>,
315
- TContext = unknown
316
- >(options?: {
317
- mutation?: UseMutationOptions<
318
- Awaited<ReturnType<typeof deleteEventStream>>,
319
- TError,
320
- { eventStreamId: number },
321
- TContext
322
- >;
323
- request?: SecondParameter<typeof customInstance>;
324
- }) => {
325
- const mutationOptions = getDeleteEventStreamMutationOptions(options);
326
-
327
- return useMutation(mutationOptions);
328
- };
277
+
278
+ const mutationOptions = getDeleteEventStreamMutationOptions(options);
279
+
280
+ return useMutation(mutationOptions);
281
+ }
282
+