@squonk/account-server-client 2.1.0-rc.8 → 2.1.0

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 (79) hide show
  1. package/README.md +1 -1
  2. package/admin/admin.cjs +19 -4
  3. package/admin/admin.cjs.map +1 -1
  4. package/admin/admin.d.cts +23 -6
  5. package/admin/admin.d.ts +23 -6
  6. package/admin/admin.js +19 -4
  7. package/admin/admin.js.map +1 -1
  8. package/asset/asset.cjs +33 -18
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +31 -14
  11. package/asset/asset.d.ts +31 -14
  12. package/asset/asset.js +25 -10
  13. package/asset/asset.js.map +1 -1
  14. package/{chunk-UKA7G3OB.js → chunk-EBOQPVLG.js} +2 -2
  15. package/{chunk-UKA7G3OB.js.map → chunk-EBOQPVLG.js.map} +1 -1
  16. package/{chunk-J22A7LHX.cjs → chunk-TKLTUR4R.cjs} +2 -2
  17. package/chunk-TKLTUR4R.cjs.map +1 -0
  18. package/event-stream/event-stream.cjs +39 -10
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +51 -17
  21. package/event-stream/event-stream.d.ts +51 -17
  22. package/event-stream/event-stream.js +36 -7
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +2 -2
  25. package/index.cjs.map +1 -1
  26. package/index.d.cts +702 -2
  27. package/index.d.ts +702 -2
  28. package/index.js +1 -1
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +35 -6
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +42 -8
  33. package/merchant/merchant.d.ts +42 -8
  34. package/merchant/merchant.js +34 -5
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +73 -16
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +84 -16
  39. package/organisation/organisation.d.ts +84 -16
  40. package/organisation/organisation.js +66 -9
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +12 -12
  43. package/product/product.cjs +121 -22
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +141 -22
  46. package/product/product.d.ts +141 -22
  47. package/product/product.js +111 -12
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +4 -2
  50. package/src/admin/admin.ts +50 -14
  51. package/src/asset/asset.ts +57 -35
  52. package/src/custom-instance.ts +3 -4
  53. package/src/event-stream/event-stream.ts +100 -29
  54. package/src/merchant/merchant.ts +93 -18
  55. package/src/organisation/organisation.ts +184 -35
  56. package/src/product/product.ts +313 -47
  57. package/src/state/state.ts +50 -14
  58. package/src/unit/unit.ts +190 -45
  59. package/src/user/user.ts +140 -34
  60. package/state/state.cjs +19 -4
  61. package/state/state.cjs.map +1 -1
  62. package/state/state.d.cts +23 -6
  63. package/state/state.d.ts +23 -6
  64. package/state/state.js +19 -4
  65. package/state/state.js.map +1 -1
  66. package/unit/unit.cjs +77 -20
  67. package/unit/unit.cjs.map +1 -1
  68. package/unit/unit.d.cts +91 -23
  69. package/unit/unit.d.ts +91 -23
  70. package/unit/unit.js +68 -11
  71. package/unit/unit.js.map +1 -1
  72. package/user/user.cjs +59 -16
  73. package/user/user.cjs.map +1 -1
  74. package/user/user.d.cts +66 -15
  75. package/user/user.d.ts +66 -15
  76. package/user/user.js +53 -10
  77. package/user/user.js.map +1 -1
  78. package/chunk-J22A7LHX.cjs.map +0 -1
  79. package/custom-instance-6780910b.d.ts +0 -700
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.20.0 🍺
2
+ * Generated by orval v6.25.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -10,7 +10,8 @@ A service that provides access to the Account Server, which gives *registered* u
10
10
  */
11
11
  import {
12
12
  useMutation,
13
- useQuery
13
+ useQuery,
14
+ useSuspenseQuery
14
15
  } from '@tanstack/react-query'
15
16
  import type {
16
17
  MutationFunction,
@@ -18,7 +19,9 @@ import type {
18
19
  QueryKey,
19
20
  UseMutationOptions,
20
21
  UseQueryOptions,
21
- UseQueryResult
22
+ UseQueryResult,
23
+ UseSuspenseQueryOptions,
24
+ UseSuspenseQueryResult
22
25
  } from '@tanstack/react-query'
23
26
  import type {
24
27
  AsError,
@@ -28,13 +31,7 @@ import { customInstance } from '.././custom-instance';
28
31
  import type { ErrorType } from '.././custom-instance';
29
32
 
30
33
 
31
- // eslint-disable-next-line
32
- type SecondParameter<T extends (...args: any) => any> = T extends (
33
- config: any,
34
- args: infer P,
35
- ) => any
36
- ? P
37
- : never;
34
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
38
35
 
39
36
 
40
37
  /**
@@ -49,19 +46,18 @@ export const getEventStream = (
49
46
 
50
47
 
51
48
  return customInstance<EventStreamGetPostResponse>(
52
- {url: `/event-stream`, method: 'get', signal
49
+ {url: `/event-stream`, method: 'GET', signal
53
50
  },
54
51
  options);
55
52
  }
56
53
 
57
54
 
58
55
  export const getGetEventStreamQueryKey = () => {
59
-
60
56
  return ["account-server-api", `/event-stream`] as const;
61
57
  }
62
58
 
63
59
 
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>}
60
+ export 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>}
65
61
  ) => {
66
62
 
67
63
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -86,7 +82,7 @@ export type GetEventStreamQueryError = ErrorType<void | AsError>
86
82
  * @summary Gets the details of your EventStream
87
83
  */
88
84
  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>}
85
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
90
86
 
91
87
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
92
88
 
@@ -101,6 +97,46 @@ export const useGetEventStream = <TData = Awaited<ReturnType<typeof getEventStre
101
97
 
102
98
 
103
99
 
100
+ export 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>}
101
+ ) => {
102
+
103
+ const {query: queryOptions, request: requestOptions} = options ?? {};
104
+
105
+ const queryKey = queryOptions?.queryKey ?? getGetEventStreamQueryKey();
106
+
107
+
108
+
109
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStream>>> = ({ signal }) => getEventStream(requestOptions, signal);
110
+
111
+
112
+
113
+
114
+
115
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData> & { queryKey: QueryKey }
116
+ }
117
+
118
+ export type GetEventStreamSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStream>>>
119
+ export type GetEventStreamSuspenseQueryError = ErrorType<void | AsError>
120
+
121
+ /**
122
+ * @summary Gets the details of your EventStream
123
+ */
124
+ export const useGetEventStreamSuspense = <TData = Awaited<ReturnType<typeof getEventStream>>, TError = ErrorType<void | AsError>>(
125
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStream>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
126
+
127
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
128
+
129
+ const queryOptions = getGetEventStreamSuspenseQueryOptions(options)
130
+
131
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
132
+
133
+ query.queryKey = queryOptions.queryKey ;
134
+
135
+ return query;
136
+ }
137
+
138
+
139
+
104
140
  /**
105
141
  * Creates a new event stream (based on the **Server Sent Events** framework) for the authenticated user.
106
142
 
@@ -114,7 +150,7 @@ export const createEventStream = (
114
150
 
115
151
 
116
152
  return customInstance<EventStreamGetPostResponse>(
117
- {url: `/event-stream`, method: 'post'
153
+ {url: `/event-stream`, method: 'POST'
118
154
  },
119
155
  options);
120
156
  }
@@ -122,15 +158,14 @@ export const createEventStream = (
122
158
 
123
159
 
124
160
  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> => {
161
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}
162
+ ): UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext> => {
128
163
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
129
164
 
130
165
 
131
166
 
132
167
 
133
- const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, TVariables> = () => {
168
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof createEventStream>>, void> = () => {
134
169
 
135
170
 
136
171
  return createEventStream(requestOptions)
@@ -149,8 +184,7 @@ export const getCreateEventStreamMutationOptions = <TError = ErrorType<AsError |
149
184
  * @summary Create a new Server-Sent Events EventStream
150
185
  */
151
186
  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>}
187
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createEventStream>>, TError,void, TContext>, request?: SecondParameter<typeof customInstance>}
154
188
  ) => {
155
189
 
156
190
  const mutationOptions = getCreateEventStreamMutationOptions(options);
@@ -160,7 +194,7 @@ export const useCreateEventStream = <TError = ErrorType<AsError | void>,
160
194
  /**
161
195
  * 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.
162
196
 
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`.
197
+ This 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`.
164
198
 
165
199
  * @summary Subscribe to Server-Sent Events events from an EventStream
166
200
  */
@@ -171,19 +205,18 @@ export const getEventStreamEvents = (
171
205
 
172
206
 
173
207
  return customInstance<string>(
174
- {url: `/event-stream/${eventStreamId}`, method: 'get', signal
208
+ {url: `/event-stream/${eventStreamId}`, method: 'GET', signal
175
209
  },
176
210
  options);
177
211
  }
178
212
 
179
213
 
180
214
  export const getGetEventStreamEventsQueryKey = (eventStreamId: number,) => {
181
-
182
215
  return ["account-server-api", `/event-stream/${eventStreamId}`] as const;
183
216
  }
184
217
 
185
218
 
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>}
219
+ export 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>}
187
220
  ) => {
188
221
 
189
222
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -208,7 +241,7 @@ export type GetEventStreamEventsQueryError = ErrorType<void | AsError>
208
241
  * @summary Subscribe to Server-Sent Events events from an EventStream
209
242
  */
210
243
  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>}
244
+ eventStreamId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
212
245
 
213
246
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
214
247
 
@@ -223,6 +256,46 @@ export const useGetEventStreamEvents = <TData = Awaited<ReturnType<typeof getEve
223
256
 
224
257
 
225
258
 
259
+ export 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>}
260
+ ) => {
261
+
262
+ const {query: queryOptions, request: requestOptions} = options ?? {};
263
+
264
+ const queryKey = queryOptions?.queryKey ?? getGetEventStreamEventsQueryKey(eventStreamId);
265
+
266
+
267
+
268
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getEventStreamEvents>>> = ({ signal }) => getEventStreamEvents(eventStreamId, requestOptions, signal);
269
+
270
+
271
+
272
+
273
+
274
+ return { queryKey, queryFn, enabled: !!(eventStreamId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData> & { queryKey: QueryKey }
275
+ }
276
+
277
+ export type GetEventStreamEventsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getEventStreamEvents>>>
278
+ export type GetEventStreamEventsSuspenseQueryError = ErrorType<void | AsError>
279
+
280
+ /**
281
+ * @summary Subscribe to Server-Sent Events events from an EventStream
282
+ */
283
+ export const useGetEventStreamEventsSuspense = <TData = Awaited<ReturnType<typeof getEventStreamEvents>>, TError = ErrorType<void | AsError>>(
284
+ eventStreamId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getEventStreamEvents>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
285
+
286
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
287
+
288
+ const queryOptions = getGetEventStreamEventsSuspenseQueryOptions(eventStreamId,options)
289
+
290
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
291
+
292
+ query.queryKey = queryOptions.queryKey ;
293
+
294
+ return query;
295
+ }
296
+
297
+
298
+
226
299
  /**
227
300
  * Deletes an Event Stream.
228
301
 
@@ -236,7 +309,7 @@ export const deleteEventStream = (
236
309
 
237
310
 
238
311
  return customInstance<void>(
239
- {url: `/event-stream/${eventStreamId}`, method: 'delete'
312
+ {url: `/event-stream/${eventStreamId}`, method: 'DELETE'
240
313
  },
241
314
  options);
242
315
  }
@@ -244,7 +317,6 @@ export const deleteEventStream = (
244
317
 
245
318
 
246
319
  export const getDeleteEventStreamMutationOptions = <TError = ErrorType<AsError>,
247
-
248
320
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
249
321
  ): UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext> => {
250
322
  const {mutation: mutationOptions, request: requestOptions} = options ?? {};
@@ -271,7 +343,6 @@ export const getDeleteEventStreamMutationOptions = <TError = ErrorType<AsError>,
271
343
  * @summary Deletes an existing EventStream (that you created)
272
344
  */
273
345
  export const useDeleteEventStream = <TError = ErrorType<AsError>,
274
-
275
346
  TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteEventStream>>, TError,{eventStreamId: number}, TContext>, request?: SecondParameter<typeof customInstance>}
276
347
  ) => {
277
348
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.20.0 🍺
2
+ * Generated by orval v6.25.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -9,13 +9,16 @@ A service that provides access to the Account Server, which gives *registered* u
9
9
  * OpenAPI spec version: 2.1
10
10
  */
11
11
  import {
12
- useQuery
12
+ useQuery,
13
+ useSuspenseQuery
13
14
  } from '@tanstack/react-query'
14
15
  import type {
15
16
  QueryFunction,
16
17
  QueryKey,
17
18
  UseQueryOptions,
18
- UseQueryResult
19
+ UseQueryResult,
20
+ UseSuspenseQueryOptions,
21
+ UseSuspenseQueryResult
19
22
  } from '@tanstack/react-query'
20
23
  import type {
21
24
  AsError,
@@ -26,13 +29,7 @@ import { customInstance } from '.././custom-instance';
26
29
  import type { ErrorType } from '.././custom-instance';
27
30
 
28
31
 
29
- // eslint-disable-next-line
30
- type SecondParameter<T extends (...args: any) => any> = T extends (
31
- config: any,
32
- args: infer P,
33
- ) => any
34
- ? P
35
- : never;
32
+ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
36
33
 
37
34
 
38
35
  /**
@@ -49,19 +46,18 @@ export const getMerchants = (
49
46
 
50
47
 
51
48
  return customInstance<MerchantsGetResponse>(
52
- {url: `/merchant`, method: 'get', signal
49
+ {url: `/merchant`, method: 'GET', signal
53
50
  },
54
51
  options);
55
52
  }
56
53
 
57
54
 
58
55
  export const getGetMerchantsQueryKey = () => {
59
-
60
56
  return ["account-server-api", `/merchant`] as const;
61
57
  }
62
58
 
63
59
 
64
- export const getGetMerchantsQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
60
+ export const getGetMerchantsQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
65
61
  ) => {
66
62
 
67
63
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -86,7 +82,7 @@ export type GetMerchantsQueryError = ErrorType<AsError | void>
86
82
  * @summary Gets all Merchants
87
83
  */
88
84
  export const useGetMerchants = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(
89
- options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
85
+ options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
90
86
 
91
87
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
92
88
 
@@ -101,6 +97,46 @@ export const useGetMerchants = <TData = Awaited<ReturnType<typeof getMerchants>>
101
97
 
102
98
 
103
99
 
100
+ export const getGetMerchantsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
101
+ ) => {
102
+
103
+ const {query: queryOptions, request: requestOptions} = options ?? {};
104
+
105
+ const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
106
+
107
+
108
+
109
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);
110
+
111
+
112
+
113
+
114
+
115
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: QueryKey }
116
+ }
117
+
118
+ export type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>
119
+ export type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>
120
+
121
+ /**
122
+ * @summary Gets all Merchants
123
+ */
124
+ export const useGetMerchantsSuspense = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(
125
+ options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
126
+
127
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
128
+
129
+ const queryOptions = getGetMerchantsSuspenseQueryOptions(options)
130
+
131
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
132
+
133
+ query.queryKey = queryOptions.queryKey ;
134
+
135
+ return query;
136
+ }
137
+
138
+
139
+
104
140
  /**
105
141
  * Gets a known Merchant
106
142
 
@@ -113,19 +149,18 @@ export const getService = (
113
149
 
114
150
 
115
151
  return customInstance<MerchantDetail>(
116
- {url: `/merchant/${mId}`, method: 'get', signal
152
+ {url: `/merchant/${mId}`, method: 'GET', signal
117
153
  },
118
154
  options);
119
155
  }
120
156
 
121
157
 
122
158
  export const getGetServiceQueryKey = (mId: number,) => {
123
-
124
159
  return ["account-server-api", `/merchant/${mId}`] as const;
125
160
  }
126
161
 
127
162
 
128
- export const getGetServiceQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
163
+ export const getGetServiceQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
129
164
  ) => {
130
165
 
131
166
  const {query: queryOptions, request: requestOptions} = options ?? {};
@@ -150,7 +185,7 @@ export type GetServiceQueryError = ErrorType<AsError | void>
150
185
  * @summary Gets a specific Merchant
151
186
  */
152
187
  export const useGetService = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(
153
- mId: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
188
+ mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
154
189
 
155
190
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
156
191
 
@@ -165,3 +200,43 @@ export const useGetService = <TData = Awaited<ReturnType<typeof getService>>, TE
165
200
 
166
201
 
167
202
 
203
+ export const getGetServiceSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
204
+ ) => {
205
+
206
+ const {query: queryOptions, request: requestOptions} = options ?? {};
207
+
208
+ const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
209
+
210
+
211
+
212
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);
213
+
214
+
215
+
216
+
217
+
218
+ return { queryKey, queryFn, enabled: !!(mId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: QueryKey }
219
+ }
220
+
221
+ export type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>
222
+ export type GetServiceSuspenseQueryError = ErrorType<AsError | void>
223
+
224
+ /**
225
+ * @summary Gets a specific Merchant
226
+ */
227
+ export const useGetServiceSuspense = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(
228
+ mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
229
+
230
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
231
+
232
+ const queryOptions = getGetServiceSuspenseQueryOptions(mId,options)
233
+
234
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
235
+
236
+ query.queryKey = queryOptions.queryKey ;
237
+
238
+ return query;
239
+ }
240
+
241
+
242
+