@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.
- package/admin/admin.cjs +14 -7
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +33 -0
- package/admin/admin.d.ts +4 -1
- package/admin/admin.js +14 -7
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +44 -19
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +243 -0
- package/asset/asset.d.ts +49 -23
- package/asset/asset.js +37 -12
- package/asset/asset.js.map +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
- package/chunk-J22A7LHX.cjs.map +1 -0
- package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
- package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
- package/{custom-instance-35e5d4fd.d.ts → custom-instance-37bb38c1.d.ts} +159 -159
- package/event-stream/event-stream.cjs +34 -18
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +108 -0
- package/event-stream/event-stream.d.ts +16 -4
- package/event-stream/event-stream.js +31 -15
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +23 -13
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +57 -0
- package/merchant/merchant.d.ts +7 -1
- package/merchant/merchant.js +22 -12
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +50 -25
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +203 -0
- package/organisation/organisation.d.ts +31 -10
- package/organisation/organisation.js +44 -19
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +80 -44
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +280 -0
- package/product/product.d.ts +40 -10
- package/product/product.js +71 -35
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +268 -276
- package/src/admin/admin.ts +72 -78
- package/src/asset/asset.ts +453 -560
- package/src/event-stream/event-stream.ts +222 -268
- package/src/merchant/merchant.ts +125 -136
- package/src/organisation/organisation.ts +394 -484
- package/src/product/product.ts +557 -682
- package/src/state/state.ts +70 -69
- package/src/unit/unit.ts +494 -593
- package/src/user/user.ts +377 -463
- package/state/state.cjs +13 -7
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +29 -0
- package/state/state.d.ts +4 -1
- package/state/state.js +13 -7
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +59 -28
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +254 -0
- package/unit/unit.d.ts +43 -16
- package/unit/unit.js +52 -21
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +52 -21
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +220 -0
- package/user/user.d.ts +31 -10
- package/user/user.js +46 -15
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
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 {
|
|
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
|
-
|
|
17
|
+
QueryFunction,
|
|
18
18
|
QueryKey,
|
|
19
|
-
|
|
19
|
+
UseMutationOptions,
|
|
20
|
+
UseQueryOptions,
|
|
21
|
+
UseQueryResult
|
|
22
|
+
} from '@tanstack/react-query'
|
|
20
23
|
import type {
|
|
21
|
-
EventStreamGetPostResponse,
|
|
22
24
|
AsError,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import
|
|
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
|
-
|
|
42
|
-
|
|
46
|
+
|
|
47
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
43
48
|
) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
export type
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export const useGetEventStream = <
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
);
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
eventStreamId:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
TData
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const queryKey
|
|
216
|
-
|
|
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
|
-
|
|
268
|
-
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
+
|