@squonk/account-server-client 3.1.0-alpha.3 → 4.0.0-beta.3

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 (70) hide show
  1. package/asset/asset.cjs +24 -24
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.cts +137 -102
  4. package/asset/asset.d.ts +137 -102
  5. package/asset/asset.js +24 -24
  6. package/asset/asset.js.map +1 -1
  7. package/charges/charges.cjs +16 -16
  8. package/charges/charges.cjs.map +1 -1
  9. package/charges/charges.d.cts +137 -65
  10. package/charges/charges.d.ts +137 -65
  11. package/charges/charges.js +16 -16
  12. package/charges/charges.js.map +1 -1
  13. package/chunk-TKLTUR4R.cjs.map +1 -1
  14. package/event-stream/event-stream.cjs +8 -8
  15. package/event-stream/event-stream.cjs.map +1 -1
  16. package/event-stream/event-stream.d.cts +82 -47
  17. package/event-stream/event-stream.d.ts +82 -47
  18. package/event-stream/event-stream.js +8 -8
  19. package/event-stream/event-stream.js.map +1 -1
  20. package/index.cjs.map +1 -1
  21. package/index.d.cts +62 -14
  22. package/index.d.ts +62 -14
  23. package/index.js.map +1 -1
  24. package/merchant/merchant.cjs +8 -8
  25. package/merchant/merchant.cjs.map +1 -1
  26. package/merchant/merchant.d.cts +69 -33
  27. package/merchant/merchant.d.ts +69 -33
  28. package/merchant/merchant.js +8 -8
  29. package/merchant/merchant.js.map +1 -1
  30. package/organisation/organisation.cjs +14 -14
  31. package/organisation/organisation.cjs.map +1 -1
  32. package/organisation/organisation.d.cts +128 -75
  33. package/organisation/organisation.d.ts +128 -75
  34. package/organisation/organisation.js +14 -14
  35. package/organisation/organisation.js.map +1 -1
  36. package/package.json +7 -7
  37. package/product/product.cjs +24 -24
  38. package/product/product.cjs.map +1 -1
  39. package/product/product.d.cts +229 -122
  40. package/product/product.d.ts +229 -122
  41. package/product/product.js +24 -24
  42. package/product/product.js.map +1 -1
  43. package/src/account-server-api.schemas.ts +63 -14
  44. package/src/asset/asset.ts +185 -65
  45. package/src/charges/charges.ts +200 -18
  46. package/src/event-stream/event-stream.ts +114 -19
  47. package/src/merchant/merchant.ts +94 -10
  48. package/src/organisation/organisation.ts +171 -31
  49. package/src/product/product.ts +301 -41
  50. package/src/state/state.ts +50 -6
  51. package/src/unit/unit.ts +188 -38
  52. package/src/user/user.ts +183 -38
  53. package/state/state.cjs +4 -4
  54. package/state/state.cjs.map +1 -1
  55. package/state/state.d.cts +35 -17
  56. package/state/state.d.ts +35 -17
  57. package/state/state.js +4 -4
  58. package/state/state.js.map +1 -1
  59. package/unit/unit.cjs +12 -12
  60. package/unit/unit.cjs.map +1 -1
  61. package/unit/unit.d.cts +140 -87
  62. package/unit/unit.d.ts +140 -87
  63. package/unit/unit.js +12 -12
  64. package/unit/unit.js.map +1 -1
  65. package/user/user.cjs +12 -12
  66. package/user/user.cjs.map +1 -1
  67. package/user/user.d.cts +139 -86
  68. package/user/user.d.ts +139 -86
  69. package/user/user.js +12 -12
  70. package/user/user.js.map +1 -1
@@ -1,5 +1,4 @@
1
- import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
2
- import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
1
+ import { UseQueryOptions, QueryKey, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
3
2
  import { customInstance, EventStreamGetPostResponse, ErrorType, AsError } from '../index.cjs';
4
3
  import 'axios';
5
4
 
@@ -12,37 +11,55 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
12
11
  declare const getEventStream: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<EventStreamGetPostResponse>;
13
12
  declare const getGetEventStreamQueryKey: () => readonly ["account-server-api", "/event-stream"];
14
13
  declare const getGetEventStreamQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
15
- query?: Partial<UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
14
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
16
15
  request?: SecondParameter<typeof customInstance>;
17
- } | undefined) => UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
16
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & {
18
17
  queryKey: QueryKey;
19
18
  };
20
19
  type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
21
20
  type GetEventStreamQueryError = ErrorType<void | AsError>;
22
- /**
23
- * @summary Gets the details of your EventStream
24
- */
25
- declare const useGetEventStream: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
26
- query?: Partial<UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
21
+ declare function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options: {
22
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>, 'initialData'>;
23
+ request?: SecondParameter<typeof customInstance>;
24
+ }): DefinedUseQueryResult<TData, TError> & {
25
+ queryKey: QueryKey;
26
+ };
27
+ declare function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
28
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>, 'initialData'>;
29
+ request?: SecondParameter<typeof customInstance>;
30
+ }): UseQueryResult<TData, TError> & {
31
+ queryKey: QueryKey;
32
+ };
33
+ declare function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
34
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
27
35
  request?: SecondParameter<typeof customInstance>;
28
- } | undefined) => UseQueryResult<TData, TError> & {
36
+ }): UseQueryResult<TData, TError> & {
29
37
  queryKey: QueryKey;
30
38
  };
31
39
  declare const getGetEventStreamSuspenseQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
32
- query?: Partial<UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
40
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
33
41
  request?: SecondParameter<typeof customInstance>;
34
- } | undefined) => UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
42
+ }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & {
35
43
  queryKey: QueryKey;
36
44
  };
37
45
  type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
38
46
  type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
39
- /**
40
- * @summary Gets the details of your EventStream
41
- */
42
- declare const useGetEventStreamSuspense: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
43
- query?: Partial<UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
47
+ declare function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options: {
48
+ query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
49
+ request?: SecondParameter<typeof customInstance>;
50
+ }): UseSuspenseQueryResult<TData, TError> & {
51
+ queryKey: QueryKey;
52
+ };
53
+ declare function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
54
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
55
+ request?: SecondParameter<typeof customInstance>;
56
+ }): UseSuspenseQueryResult<TData, TError> & {
57
+ queryKey: QueryKey;
58
+ };
59
+ declare function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
60
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
44
61
  request?: SecondParameter<typeof customInstance>;
45
- } | undefined) => UseSuspenseQueryResult<TData, TError> & {
62
+ }): UseSuspenseQueryResult<TData, TError> & {
46
63
  queryKey: QueryKey;
47
64
  };
48
65
  /**
@@ -54,18 +71,18 @@ A user is only permitted one event stream.
54
71
  */
55
72
  declare const createEventStream: (options?: SecondParameter<typeof customInstance>) => Promise<EventStreamGetPostResponse>;
56
73
  declare const getCreateEventStreamMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
57
- mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext> | undefined;
74
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
58
75
  request?: SecondParameter<typeof customInstance>;
59
- } | undefined) => UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext>;
76
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
60
77
  type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>;
61
78
  type CreateEventStreamMutationError = ErrorType<AsError | void>;
62
79
  /**
63
80
  * @summary Create a new Server-Sent Events EventStream
64
81
  */
65
82
  declare const useCreateEventStream: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
66
- mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext> | undefined;
83
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
67
84
  request?: SecondParameter<typeof customInstance>;
68
- } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<EventStreamGetPostResponse, TError, void, TContext>;
85
+ }) => UseMutationResult<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
69
86
  /**
70
87
  * 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.
71
88
 
@@ -76,37 +93,55 @@ This is an un-authenticated endpoint. In order to read from the stream the calle
76
93
  declare const getEventStreamEvents: (eventStreamId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<string>;
77
94
  declare const getGetEventStreamEventsQueryKey: (eventStreamId: number) => readonly ["account-server-api", `/event-stream/${number}`];
78
95
  declare const getGetEventStreamEventsQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
79
- query?: Partial<UseQueryOptions<string, TError, TData, QueryKey>> | undefined;
96
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
80
97
  request?: SecondParameter<typeof customInstance>;
81
- } | undefined) => UseQueryOptions<string, TError, TData, QueryKey> & {
98
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & {
82
99
  queryKey: QueryKey;
83
100
  };
84
101
  type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
85
102
  type GetEventStreamEventsQueryError = ErrorType<void | AsError>;
86
- /**
87
- * @summary Subscribe to Server-Sent Events events from an EventStream
88
- */
89
- declare const useGetEventStreamEvents: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
90
- query?: Partial<UseQueryOptions<string, TError, TData, QueryKey>> | undefined;
103
+ declare function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options: {
104
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>, 'initialData'>;
105
+ request?: SecondParameter<typeof customInstance>;
106
+ }): DefinedUseQueryResult<TData, TError> & {
107
+ queryKey: QueryKey;
108
+ };
109
+ declare function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
110
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>, 'initialData'>;
111
+ request?: SecondParameter<typeof customInstance>;
112
+ }): UseQueryResult<TData, TError> & {
113
+ queryKey: QueryKey;
114
+ };
115
+ declare function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
116
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
91
117
  request?: SecondParameter<typeof customInstance>;
92
- } | undefined) => UseQueryResult<TData, TError> & {
118
+ }): UseQueryResult<TData, TError> & {
93
119
  queryKey: QueryKey;
94
120
  };
95
121
  declare const getGetEventStreamEventsSuspenseQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
96
- query?: Partial<UseSuspenseQueryOptions<string, TError, TData, QueryKey>> | undefined;
122
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
97
123
  request?: SecondParameter<typeof customInstance>;
98
- } | undefined) => UseSuspenseQueryOptions<string, TError, TData, QueryKey> & {
124
+ }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & {
99
125
  queryKey: QueryKey;
100
126
  };
101
127
  type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
102
128
  type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>;
103
- /**
104
- * @summary Subscribe to Server-Sent Events events from an EventStream
105
- */
106
- declare const useGetEventStreamEventsSuspense: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
107
- query?: Partial<UseSuspenseQueryOptions<string, TError, TData, QueryKey>> | undefined;
129
+ declare function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options: {
130
+ query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
131
+ request?: SecondParameter<typeof customInstance>;
132
+ }): UseSuspenseQueryResult<TData, TError> & {
133
+ queryKey: QueryKey;
134
+ };
135
+ declare function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
136
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
137
+ request?: SecondParameter<typeof customInstance>;
138
+ }): UseSuspenseQueryResult<TData, TError> & {
139
+ queryKey: QueryKey;
140
+ };
141
+ declare function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
142
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
108
143
  request?: SecondParameter<typeof customInstance>;
109
- } | undefined) => UseSuspenseQueryResult<TData, TError> & {
144
+ }): UseSuspenseQueryResult<TData, TError> & {
110
145
  queryKey: QueryKey;
111
146
  };
112
147
  /**
@@ -117,25 +152,25 @@ You must be the user who created the event stream.
117
152
  * @summary Deletes an existing EventStream (that you created)
118
153
  */
119
154
  declare const deleteEventStream: (eventStreamId: number, options?: SecondParameter<typeof customInstance>) => Promise<void>;
120
- declare const getDeleteEventStreamMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
121
- mutation?: UseMutationOptions<void, TError, {
155
+ declare const getDeleteEventStreamMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
156
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
122
157
  eventStreamId: number;
123
- }, TContext> | undefined;
158
+ }, TContext>;
124
159
  request?: SecondParameter<typeof customInstance>;
125
- } | undefined) => UseMutationOptions<void, TError, {
160
+ }) => UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
126
161
  eventStreamId: number;
127
162
  }, TContext>;
128
163
  type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>;
129
- type DeleteEventStreamMutationError = ErrorType<AsError>;
164
+ type DeleteEventStreamMutationError = ErrorType<void | AsError>;
130
165
  /**
131
166
  * @summary Deletes an existing EventStream (that you created)
132
167
  */
133
- declare const useDeleteEventStream: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
134
- mutation?: UseMutationOptions<void, TError, {
168
+ declare const useDeleteEventStream: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
169
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
135
170
  eventStreamId: number;
136
- }, TContext> | undefined;
171
+ }, TContext>;
137
172
  request?: SecondParameter<typeof customInstance>;
138
- } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
173
+ }) => UseMutationResult<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
139
174
  eventStreamId: number;
140
175
  }, TContext>;
141
176
 
@@ -1,5 +1,4 @@
1
- import * as _tanstack_react_query_build_legacy_types from '@tanstack/react-query/build/legacy/types';
2
- import { UseQueryOptions, QueryKey, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions } from '@tanstack/react-query';
1
+ import { UseQueryOptions, QueryKey, DefinedInitialDataOptions, DefinedUseQueryResult, UndefinedInitialDataOptions, UseQueryResult, UseSuspenseQueryOptions, UseSuspenseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
3
2
  import { customInstance, EventStreamGetPostResponse, ErrorType, AsError } from '../index.js';
4
3
  import 'axios';
5
4
 
@@ -12,37 +11,55 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
12
11
  declare const getEventStream: (options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<EventStreamGetPostResponse>;
13
12
  declare const getGetEventStreamQueryKey: () => readonly ["account-server-api", "/event-stream"];
14
13
  declare const getGetEventStreamQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
15
- query?: Partial<UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
14
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
16
15
  request?: SecondParameter<typeof customInstance>;
17
- } | undefined) => UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
16
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & {
18
17
  queryKey: QueryKey;
19
18
  };
20
19
  type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
21
20
  type GetEventStreamQueryError = ErrorType<void | AsError>;
22
- /**
23
- * @summary Gets the details of your EventStream
24
- */
25
- declare const useGetEventStream: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
26
- query?: Partial<UseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
21
+ declare function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options: {
22
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>, 'initialData'>;
23
+ request?: SecondParameter<typeof customInstance>;
24
+ }): DefinedUseQueryResult<TData, TError> & {
25
+ queryKey: QueryKey;
26
+ };
27
+ declare function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
28
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>, 'initialData'>;
29
+ request?: SecondParameter<typeof customInstance>;
30
+ }): UseQueryResult<TData, TError> & {
31
+ queryKey: QueryKey;
32
+ };
33
+ declare function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
34
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
27
35
  request?: SecondParameter<typeof customInstance>;
28
- } | undefined) => UseQueryResult<TData, TError> & {
36
+ }): UseQueryResult<TData, TError> & {
29
37
  queryKey: QueryKey;
30
38
  };
31
39
  declare const getGetEventStreamSuspenseQueryOptions: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
32
- query?: Partial<UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
40
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
33
41
  request?: SecondParameter<typeof customInstance>;
34
- } | undefined) => UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey> & {
42
+ }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & {
35
43
  queryKey: QueryKey;
36
44
  };
37
45
  type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>;
38
46
  type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>;
39
- /**
40
- * @summary Gets the details of your EventStream
41
- */
42
- declare const useGetEventStreamSuspense: <TData = EventStreamGetPostResponse, TError = ErrorType<void | AsError>>(options?: {
43
- query?: Partial<UseSuspenseQueryOptions<EventStreamGetPostResponse, TError, TData, QueryKey>> | undefined;
47
+ declare function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options: {
48
+ query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
49
+ request?: SecondParameter<typeof customInstance>;
50
+ }): UseSuspenseQueryResult<TData, TError> & {
51
+ queryKey: QueryKey;
52
+ };
53
+ declare function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
54
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
55
+ request?: SecondParameter<typeof customInstance>;
56
+ }): UseSuspenseQueryResult<TData, TError> & {
57
+ queryKey: QueryKey;
58
+ };
59
+ declare function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(options?: {
60
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>;
44
61
  request?: SecondParameter<typeof customInstance>;
45
- } | undefined) => UseSuspenseQueryResult<TData, TError> & {
62
+ }): UseSuspenseQueryResult<TData, TError> & {
46
63
  queryKey: QueryKey;
47
64
  };
48
65
  /**
@@ -54,18 +71,18 @@ A user is only permitted one event stream.
54
71
  */
55
72
  declare const createEventStream: (options?: SecondParameter<typeof customInstance>) => Promise<EventStreamGetPostResponse>;
56
73
  declare const getCreateEventStreamMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
57
- mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext> | undefined;
74
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
58
75
  request?: SecondParameter<typeof customInstance>;
59
- } | undefined) => UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext>;
76
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
60
77
  type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>;
61
78
  type CreateEventStreamMutationError = ErrorType<AsError | void>;
62
79
  /**
63
80
  * @summary Create a new Server-Sent Events EventStream
64
81
  */
65
82
  declare const useCreateEventStream: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
66
- mutation?: UseMutationOptions<EventStreamGetPostResponse, TError, void, TContext> | undefined;
83
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
67
84
  request?: SecondParameter<typeof customInstance>;
68
- } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<EventStreamGetPostResponse, TError, void, TContext>;
85
+ }) => UseMutationResult<Awaited<ReturnType<typeof createEventStream>>, TError, void, TContext>;
69
86
  /**
70
87
  * 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.
71
88
 
@@ -76,37 +93,55 @@ This is an un-authenticated endpoint. In order to read from the stream the calle
76
93
  declare const getEventStreamEvents: (eventStreamId: number, options?: SecondParameter<typeof customInstance>, signal?: AbortSignal) => Promise<string>;
77
94
  declare const getGetEventStreamEventsQueryKey: (eventStreamId: number) => readonly ["account-server-api", `/event-stream/${number}`];
78
95
  declare const getGetEventStreamEventsQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
79
- query?: Partial<UseQueryOptions<string, TError, TData, QueryKey>> | undefined;
96
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
80
97
  request?: SecondParameter<typeof customInstance>;
81
- } | undefined) => UseQueryOptions<string, TError, TData, QueryKey> & {
98
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & {
82
99
  queryKey: QueryKey;
83
100
  };
84
101
  type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
85
102
  type GetEventStreamEventsQueryError = ErrorType<void | AsError>;
86
- /**
87
- * @summary Subscribe to Server-Sent Events events from an EventStream
88
- */
89
- declare const useGetEventStreamEvents: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
90
- query?: Partial<UseQueryOptions<string, TError, TData, QueryKey>> | undefined;
103
+ declare function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options: {
104
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>> & Pick<DefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>, 'initialData'>;
105
+ request?: SecondParameter<typeof customInstance>;
106
+ }): DefinedUseQueryResult<TData, TError> & {
107
+ queryKey: QueryKey;
108
+ };
109
+ declare function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
110
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>> & Pick<UndefinedInitialDataOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>, 'initialData'>;
111
+ request?: SecondParameter<typeof customInstance>;
112
+ }): UseQueryResult<TData, TError> & {
113
+ queryKey: QueryKey;
114
+ };
115
+ declare function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
116
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
91
117
  request?: SecondParameter<typeof customInstance>;
92
- } | undefined) => UseQueryResult<TData, TError> & {
118
+ }): UseQueryResult<TData, TError> & {
93
119
  queryKey: QueryKey;
94
120
  };
95
121
  declare const getGetEventStreamEventsSuspenseQueryOptions: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
96
- query?: Partial<UseSuspenseQueryOptions<string, TError, TData, QueryKey>> | undefined;
122
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
97
123
  request?: SecondParameter<typeof customInstance>;
98
- } | undefined) => UseSuspenseQueryOptions<string, TError, TData, QueryKey> & {
124
+ }) => UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & {
99
125
  queryKey: QueryKey;
100
126
  };
101
127
  type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>;
102
128
  type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>;
103
- /**
104
- * @summary Subscribe to Server-Sent Events events from an EventStream
105
- */
106
- declare const useGetEventStreamEventsSuspense: <TData = string, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
107
- query?: Partial<UseSuspenseQueryOptions<string, TError, TData, QueryKey>> | undefined;
129
+ declare function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options: {
130
+ query: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
131
+ request?: SecondParameter<typeof customInstance>;
132
+ }): UseSuspenseQueryResult<TData, TError> & {
133
+ queryKey: QueryKey;
134
+ };
135
+ declare function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
136
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
137
+ request?: SecondParameter<typeof customInstance>;
138
+ }): UseSuspenseQueryResult<TData, TError> & {
139
+ queryKey: QueryKey;
140
+ };
141
+ declare function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: {
142
+ query?: Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>;
108
143
  request?: SecondParameter<typeof customInstance>;
109
- } | undefined) => UseSuspenseQueryResult<TData, TError> & {
144
+ }): UseSuspenseQueryResult<TData, TError> & {
110
145
  queryKey: QueryKey;
111
146
  };
112
147
  /**
@@ -117,25 +152,25 @@ You must be the user who created the event stream.
117
152
  * @summary Deletes an existing EventStream (that you created)
118
153
  */
119
154
  declare const deleteEventStream: (eventStreamId: number, options?: SecondParameter<typeof customInstance>) => Promise<void>;
120
- declare const getDeleteEventStreamMutationOptions: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
121
- mutation?: UseMutationOptions<void, TError, {
155
+ declare const getDeleteEventStreamMutationOptions: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
156
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
122
157
  eventStreamId: number;
123
- }, TContext> | undefined;
158
+ }, TContext>;
124
159
  request?: SecondParameter<typeof customInstance>;
125
- } | undefined) => UseMutationOptions<void, TError, {
160
+ }) => UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
126
161
  eventStreamId: number;
127
162
  }, TContext>;
128
163
  type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>;
129
- type DeleteEventStreamMutationError = ErrorType<AsError>;
164
+ type DeleteEventStreamMutationError = ErrorType<void | AsError>;
130
165
  /**
131
166
  * @summary Deletes an existing EventStream (that you created)
132
167
  */
133
- declare const useDeleteEventStream: <TError = ErrorType<AsError>, TContext = unknown>(options?: {
134
- mutation?: UseMutationOptions<void, TError, {
168
+ declare const useDeleteEventStream: <TError = ErrorType<void | AsError>, TContext = unknown>(options?: {
169
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
135
170
  eventStreamId: number;
136
- }, TContext> | undefined;
171
+ }, TContext>;
137
172
  request?: SecondParameter<typeof customInstance>;
138
- } | undefined) => _tanstack_react_query_build_legacy_types.UseMutationResult<void, TError, {
173
+ }) => UseMutationResult<Awaited<ReturnType<typeof deleteEventStream>>, TError, {
139
174
  eventStreamId: number;
140
175
  }, TContext>;
141
176
 
@@ -27,24 +27,24 @@ var getGetEventStreamQueryOptions = (options) => {
27
27
  const queryFn = ({ signal }) => getEventStream(requestOptions, signal);
28
28
  return { queryKey, queryFn, ...queryOptions };
29
29
  };
30
- var useGetEventStream = (options) => {
30
+ function useGetEventStream(options) {
31
31
  const queryOptions = getGetEventStreamQueryOptions(options);
32
32
  const query = useQuery(queryOptions);
33
33
  query.queryKey = queryOptions.queryKey;
34
34
  return query;
35
- };
35
+ }
36
36
  var getGetEventStreamSuspenseQueryOptions = (options) => {
37
37
  const { query: queryOptions, request: requestOptions } = options ?? {};
38
38
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetEventStreamQueryKey();
39
39
  const queryFn = ({ signal }) => getEventStream(requestOptions, signal);
40
40
  return { queryKey, queryFn, ...queryOptions };
41
41
  };
42
- var useGetEventStreamSuspense = (options) => {
42
+ function useGetEventStreamSuspense(options) {
43
43
  const queryOptions = getGetEventStreamSuspenseQueryOptions(options);
44
44
  const query = useSuspenseQuery(queryOptions);
45
45
  query.queryKey = queryOptions.queryKey;
46
46
  return query;
47
- };
47
+ }
48
48
  var createEventStream = (options) => {
49
49
  return customInstance(
50
50
  {
@@ -84,24 +84,24 @@ var getGetEventStreamEventsQueryOptions = (eventStreamId, options) => {
84
84
  const queryFn = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);
85
85
  return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };
86
86
  };
87
- var useGetEventStreamEvents = (eventStreamId, options) => {
87
+ function useGetEventStreamEvents(eventStreamId, options) {
88
88
  const queryOptions = getGetEventStreamEventsQueryOptions(eventStreamId, options);
89
89
  const query = useQuery(queryOptions);
90
90
  query.queryKey = queryOptions.queryKey;
91
91
  return query;
92
- };
92
+ }
93
93
  var getGetEventStreamEventsSuspenseQueryOptions = (eventStreamId, options) => {
94
94
  const { query: queryOptions, request: requestOptions } = options ?? {};
95
95
  const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetEventStreamEventsQueryKey(eventStreamId);
96
96
  const queryFn = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);
97
97
  return { queryKey, queryFn, enabled: !!eventStreamId, ...queryOptions };
98
98
  };
99
- var useGetEventStreamEventsSuspense = (eventStreamId, options) => {
99
+ function useGetEventStreamEventsSuspense(eventStreamId, options) {
100
100
  const queryOptions = getGetEventStreamEventsSuspenseQueryOptions(eventStreamId, options);
101
101
  const query = useSuspenseQuery(queryOptions);
102
102
  query.queryKey = queryOptions.queryKey;
103
103
  return query;
104
- };
104
+ }
105
105
  var deleteEventStream = (eventStreamId, options) => {
106
106
  return customInstance(
107
107
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/event-stream/event-stream.ts"],"sourcesContent":["/**\n * Generated by orval v6.25.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 3.1\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n MutationFunction,\n QueryFunction,\n QueryKey,\n UseMutationOptions,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n EventStreamGetPostResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets your EventStream ID and read token, if you have created one.\n\n * @summary Gets the details of your EventStream\n */\nexport const getEventStream = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<EventStreamGetPostResponse>(\n {url: `/event-stream`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetEventStreamQueryKey = () => {\n return [\"account-server-api\", `/event-stream`] as const;\n }\n\n \nexport const getGetEventStreamQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>\nexport type GetEventStreamQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets the details of your EventStream\n */\nexport const useGetEventStream = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetEventStreamSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>\nexport type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Gets the details of your EventStream\n */\nexport const useGetEventStreamSuspense = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.\n\nA user is only permitted one event stream.\n\n * @summary Create a new Server-Sent Events EventStream\n */\nexport const createEventStream = (\n \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<EventStreamGetPostResponse>(\n {url: `/event-stream`, method: 'POST'\n },\n options);\n }\n \n\n\nexport const getCreateEventStreamMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, void> = () => {\n \n\n return createEventStream(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>\n \n export type CreateEventStreamMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Server-Sent Events EventStream\n */\nexport const useCreateEventStream = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getCreateEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * 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.\n\nThis is an un-authenticated endpoint. In order to read from the stream the caller must provide either the User access token that belongs to the event stream or the **read token** that was allocated when the stream was created. The **read token** must be provided in the request header property `X-IM-AS-EventStreamReadToken`.\n\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const getEventStreamEvents = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<string>(\n {url: `/event-stream/${eventStreamId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetEventStreamEventsQueryKey = (eventStreamId: number,) => {\n return [\"account-server-api\", `/event-stream/${eventStreamId}`] as const;\n }\n\n \nexport const getGetEventStreamEventsQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>\nexport type GetEventStreamEventsQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const useGetEventStreamEvents = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamEventsQueryOptions(eventStreamId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetEventStreamEventsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>\nexport type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>\n\n/**\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const useGetEventStreamEventsSuspense = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n\n const queryOptions = getGetEventStreamEventsSuspenseQueryOptions(eventStreamId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Deletes an Event Stream.\n\nYou must be the user who created the event stream.\n\n * @summary Deletes an existing EventStream (that you created)\n */\nexport const deleteEventStream = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/event-stream/${eventStreamId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteEventStreamMutationOptions = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext> => {\n const {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteEventStream>>, {eventStreamId: number}> = (props) => {\n const {eventStreamId} = props ?? {};\n\n return deleteEventStream(eventStreamId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>\n \n export type DeleteEventStreamMutationError = ErrorType<AsError>\n\n /**\n * @summary Deletes an existing EventStream (that you created)\n */\nexport const useDeleteEventStream = <TError = ErrorType<AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}\n) => {\n\n const mutationOptions = getDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../src/event-stream/event-stream.ts"],"sourcesContent":["// @ts-nocheck\n/**\n * Generated by orval v7.2.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.\n\n * OpenAPI spec version: 4.0\n */\nimport {\n useMutation,\n useQuery,\n useSuspenseQuery\n} from '@tanstack/react-query'\nimport type {\n DefinedInitialDataOptions,\n DefinedUseQueryResult,\n MutationFunction,\n QueryFunction,\n QueryKey,\n UndefinedInitialDataOptions,\n UseMutationOptions,\n UseMutationResult,\n UseQueryOptions,\n UseQueryResult,\n UseSuspenseQueryOptions,\n UseSuspenseQueryResult\n} from '@tanstack/react-query'\nimport type {\n AsError,\n EventStreamGetPostResponse\n} from '../account-server-api.schemas'\nimport { customInstance } from '.././custom-instance';\nimport type { ErrorType } from '.././custom-instance';\n\n\ntype SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];\n\n\n/**\n * Gets your EventStream ID and read token, if you have created one.\n\n * @summary Gets the details of your EventStream\n */\nexport const getEventStream = (\n \n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<EventStreamGetPostResponse>(\n {url: `/event-stream`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetEventStreamQueryKey = () => {\n return [\"account-server-api\", `/event-stream`] as const;\n }\n\n \nexport const getGetEventStreamQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>\nexport type GetEventStreamQueryError = ErrorType<void | AsError>\n\n\nexport function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStream>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey }\n/**\n * @summary Gets the details of your EventStream\n */\n\nexport function useGetEventStream<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n\n const queryOptions = getGetEventStreamQueryOptions(options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetEventStreamSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>\nexport type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>\n\n\nexport function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }\n/**\n * @summary Gets the details of your EventStream\n */\n\nexport function useGetEventStreamSuspense<TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(\n options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n\n const queryOptions = getGetEventStreamSuspenseQueryOptions(options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.\n\nA user is only permitted one event stream.\n\n * @summary Create a new Server-Sent Events EventStream\n */\nexport const createEventStream = (\n \n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<EventStreamGetPostResponse>(\n {url: `/event-stream`, method: 'POST'\n },\n options);\n }\n \n\n\nexport const getCreateEventStreamMutationOptions = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext> => {\nconst {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, void> = () => {\n \n\n return createEventStream(requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type CreateEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof createEventStream>>>\n \n export type CreateEventStreamMutationError = ErrorType<AsError | void>\n\n /**\n * @summary Create a new Server-Sent Events EventStream\n */\nexport const useCreateEventStream = <TError = ErrorType<AsError | void>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationResult<\n Awaited<ReturnType<typeof createEventStream>>,\n TError,\n void,\n TContext\n > => {\n\n const mutationOptions = getCreateEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n /**\n * 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.\n\nThis is an un-authenticated endpoint. In order to read from the stream the caller must provide either the User access token that belongs to the event stream or the **read token** that was allocated when the stream was created. The **read token** must be provided in the request header property `X-IM-AS-EventStreamReadToken`.\n\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\nexport const getEventStreamEvents = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,signal?: AbortSignal\n) => {\n \n \n return customInstance<string>(\n {url: `/event-stream/${eventStreamId}`, method: 'GET', signal\n },\n options);\n }\n \n\nexport const getGetEventStreamEventsQueryKey = (eventStreamId: number,) => {\n return [\"account-server-api\", `/event-stream/${eventStreamId}`] as const;\n }\n\n \nexport const getGetEventStreamEventsQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamEventsQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>\nexport type GetEventStreamEventsQueryError = ErrorType<void | AsError>\n\n\nexport function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>> & Pick<\n DefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>> & Pick<\n UndefinedInitialDataOptions<\n Awaited<ReturnType<typeof getEventStreamEvents>>,\n TError,\n TData\n > , 'initialData'\n >, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey }\n/**\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\n\nexport function useGetEventStreamEvents<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {\n\n const queryOptions = getGetEventStreamEventsQueryOptions(eventStreamId,options)\n\n const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\nexport const getGetEventStreamEventsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n) => {\n\nconst {query: queryOptions, request: requestOptions} = options ?? {};\n\n const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);\n\n \n\n const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);\n\n \n\n \n\n return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }\n}\n\nexport type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>\nexport type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>\n\n\nexport function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }\nexport function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }\n/**\n * @summary Subscribe to Server-Sent Events events from an EventStream\n */\n\nexport function useGetEventStreamEventsSuspense<TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(\n eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}\n\n ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {\n\n const queryOptions = getGetEventStreamEventsSuspenseQueryOptions(eventStreamId,options)\n\n const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };\n\n query.queryKey = queryOptions.queryKey ;\n\n return query;\n}\n\n\n\n/**\n * Deletes an Event Stream.\n\nYou must be the user who created the event stream.\n\n * @summary Deletes an existing EventStream (that you created)\n */\nexport const deleteEventStream = (\n eventStreamId: number,\n options?: SecondParameter<typeof customInstance>,) => {\n \n \n return customInstance<void>(\n {url: `/event-stream/${eventStreamId}`, method: 'DELETE'\n },\n options);\n }\n \n\n\nexport const getDeleteEventStreamMutationOptions = <TError = ErrorType<void | AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext> => {\nconst {mutation: mutationOptions, request: requestOptions} = options ?? {};\n\n \n\n\n const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteEventStream>>, {eventStreamId: number}> = (props) => {\n const {eventStreamId} = props ?? {};\n\n return deleteEventStream(eventStreamId,requestOptions)\n }\n\n \n\n\n return { mutationFn, ...mutationOptions }}\n\n export type DeleteEventStreamMutationResult = NonNullable<Awaited<ReturnType<typeof deleteEventStream>>>\n \n export type DeleteEventStreamMutationError = ErrorType<void | AsError>\n\n /**\n * @summary Deletes an existing EventStream (that you created)\n */\nexport const useDeleteEventStream = <TError = ErrorType<void | AsError>,\n TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}\n): UseMutationResult<\n Awaited<ReturnType<typeof deleteEventStream>>,\n TError,\n {eventStreamId: number},\n TContext\n > => {\n\n const mutationOptions = getDeleteEventStreamMutationOptions(options);\n\n return useMutation(mutationOptions);\n }\n "],"mappings":"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","names":[]}