@squonk/account-server-client 4.4.0-4-4.2197069952 → 4.4.0-4-4.2199390673

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 (185) hide show
  1. package/dist/api/actions/actions.cjs +4 -4
  2. package/dist/api/actions/actions.cjs.map +1 -1
  3. package/dist/api/actions/actions.d.cts +35 -17
  4. package/dist/api/actions/actions.d.cts.map +1 -1
  5. package/dist/api/actions/actions.d.ts +35 -17
  6. package/dist/api/actions/actions.d.ts.map +1 -1
  7. package/dist/api/actions/actions.fetch.cjs +4 -4
  8. package/dist/api/actions/actions.fetch.cjs.map +1 -1
  9. package/dist/api/actions/actions.fetch.d.cts +35 -17
  10. package/dist/api/actions/actions.fetch.d.cts.map +1 -1
  11. package/dist/api/actions/actions.fetch.d.ts +35 -17
  12. package/dist/api/actions/actions.fetch.d.ts.map +1 -1
  13. package/dist/api/actions/actions.fetch.js +4 -4
  14. package/dist/api/actions/actions.fetch.js.map +1 -1
  15. package/dist/api/actions/actions.js +4 -4
  16. package/dist/api/actions/actions.js.map +1 -1
  17. package/dist/api/asset/asset.cjs +22 -22
  18. package/dist/api/asset/asset.cjs.map +1 -1
  19. package/dist/api/asset/asset.d.cts +76 -40
  20. package/dist/api/asset/asset.d.cts.map +1 -1
  21. package/dist/api/asset/asset.d.ts +76 -40
  22. package/dist/api/asset/asset.d.ts.map +1 -1
  23. package/dist/api/asset/asset.fetch.cjs +22 -22
  24. package/dist/api/asset/asset.fetch.cjs.map +1 -1
  25. package/dist/api/asset/asset.fetch.d.cts +76 -40
  26. package/dist/api/asset/asset.fetch.d.cts.map +1 -1
  27. package/dist/api/asset/asset.fetch.d.ts +76 -40
  28. package/dist/api/asset/asset.fetch.d.ts.map +1 -1
  29. package/dist/api/asset/asset.fetch.js +22 -22
  30. package/dist/api/asset/asset.fetch.js.map +1 -1
  31. package/dist/api/asset/asset.js +22 -22
  32. package/dist/api/asset/asset.js.map +1 -1
  33. package/dist/api/charges/charges.cjs +16 -16
  34. package/dist/api/charges/charges.cjs.map +1 -1
  35. package/dist/api/charges/charges.d.cts +137 -65
  36. package/dist/api/charges/charges.d.cts.map +1 -1
  37. package/dist/api/charges/charges.d.ts +137 -65
  38. package/dist/api/charges/charges.d.ts.map +1 -1
  39. package/dist/api/charges/charges.fetch.cjs +16 -16
  40. package/dist/api/charges/charges.fetch.cjs.map +1 -1
  41. package/dist/api/charges/charges.fetch.d.cts +137 -65
  42. package/dist/api/charges/charges.fetch.d.cts.map +1 -1
  43. package/dist/api/charges/charges.fetch.d.ts +137 -65
  44. package/dist/api/charges/charges.fetch.d.ts.map +1 -1
  45. package/dist/api/charges/charges.fetch.js +16 -16
  46. package/dist/api/charges/charges.fetch.js.map +1 -1
  47. package/dist/api/charges/charges.js +16 -16
  48. package/dist/api/charges/charges.js.map +1 -1
  49. package/dist/api/event-stream/event-stream.cjs +12 -12
  50. package/dist/api/event-stream/event-stream.cjs.map +1 -1
  51. package/dist/api/event-stream/event-stream.d.cts +71 -35
  52. package/dist/api/event-stream/event-stream.d.cts.map +1 -1
  53. package/dist/api/event-stream/event-stream.d.ts +71 -35
  54. package/dist/api/event-stream/event-stream.d.ts.map +1 -1
  55. package/dist/api/event-stream/event-stream.fetch.cjs +12 -12
  56. package/dist/api/event-stream/event-stream.fetch.cjs.map +1 -1
  57. package/dist/api/event-stream/event-stream.fetch.d.cts +71 -35
  58. package/dist/api/event-stream/event-stream.fetch.d.cts.map +1 -1
  59. package/dist/api/event-stream/event-stream.fetch.d.ts +71 -35
  60. package/dist/api/event-stream/event-stream.fetch.d.ts.map +1 -1
  61. package/dist/api/event-stream/event-stream.fetch.js +12 -12
  62. package/dist/api/event-stream/event-stream.fetch.js.map +1 -1
  63. package/dist/api/event-stream/event-stream.js +12 -12
  64. package/dist/api/event-stream/event-stream.js.map +1 -1
  65. package/dist/api/merchant/merchant.cjs +8 -8
  66. package/dist/api/merchant/merchant.cjs.map +1 -1
  67. package/dist/api/merchant/merchant.d.cts +69 -33
  68. package/dist/api/merchant/merchant.d.cts.map +1 -1
  69. package/dist/api/merchant/merchant.d.ts +69 -33
  70. package/dist/api/merchant/merchant.d.ts.map +1 -1
  71. package/dist/api/merchant/merchant.fetch.cjs +8 -8
  72. package/dist/api/merchant/merchant.fetch.cjs.map +1 -1
  73. package/dist/api/merchant/merchant.fetch.d.cts +69 -33
  74. package/dist/api/merchant/merchant.fetch.d.cts.map +1 -1
  75. package/dist/api/merchant/merchant.fetch.d.ts +69 -33
  76. package/dist/api/merchant/merchant.fetch.d.ts.map +1 -1
  77. package/dist/api/merchant/merchant.fetch.js +8 -8
  78. package/dist/api/merchant/merchant.fetch.js.map +1 -1
  79. package/dist/api/merchant/merchant.js +8 -8
  80. package/dist/api/merchant/merchant.js.map +1 -1
  81. package/dist/api/organisation/organisation.cjs +18 -18
  82. package/dist/api/organisation/organisation.cjs.map +1 -1
  83. package/dist/api/organisation/organisation.d.cts +106 -52
  84. package/dist/api/organisation/organisation.d.cts.map +1 -1
  85. package/dist/api/organisation/organisation.d.ts +106 -52
  86. package/dist/api/organisation/organisation.d.ts.map +1 -1
  87. package/dist/api/organisation/organisation.fetch.cjs +18 -18
  88. package/dist/api/organisation/organisation.fetch.cjs.map +1 -1
  89. package/dist/api/organisation/organisation.fetch.d.cts +106 -52
  90. package/dist/api/organisation/organisation.fetch.d.cts.map +1 -1
  91. package/dist/api/organisation/organisation.fetch.d.ts +106 -52
  92. package/dist/api/organisation/organisation.fetch.d.ts.map +1 -1
  93. package/dist/api/organisation/organisation.fetch.js +18 -18
  94. package/dist/api/organisation/organisation.fetch.js.map +1 -1
  95. package/dist/api/organisation/organisation.js +18 -18
  96. package/dist/api/organisation/organisation.js.map +1 -1
  97. package/dist/api/product/product.cjs +30 -30
  98. package/dist/api/product/product.cjs.map +1 -1
  99. package/dist/api/product/product.d.cts +208 -100
  100. package/dist/api/product/product.d.cts.map +1 -1
  101. package/dist/api/product/product.d.ts +208 -100
  102. package/dist/api/product/product.d.ts.map +1 -1
  103. package/dist/api/product/product.fetch.cjs +30 -30
  104. package/dist/api/product/product.fetch.cjs.map +1 -1
  105. package/dist/api/product/product.fetch.d.cts +208 -100
  106. package/dist/api/product/product.fetch.d.cts.map +1 -1
  107. package/dist/api/product/product.fetch.d.ts +208 -100
  108. package/dist/api/product/product.fetch.d.ts.map +1 -1
  109. package/dist/api/product/product.fetch.js +30 -30
  110. package/dist/api/product/product.fetch.js.map +1 -1
  111. package/dist/api/product/product.js +30 -30
  112. package/dist/api/product/product.js.map +1 -1
  113. package/dist/api/state/state.cjs +4 -4
  114. package/dist/api/state/state.cjs.map +1 -1
  115. package/dist/api/state/state.d.cts +35 -17
  116. package/dist/api/state/state.d.cts.map +1 -1
  117. package/dist/api/state/state.d.ts +35 -17
  118. package/dist/api/state/state.d.ts.map +1 -1
  119. package/dist/api/state/state.fetch.cjs +4 -4
  120. package/dist/api/state/state.fetch.cjs.map +1 -1
  121. package/dist/api/state/state.fetch.d.cts +35 -17
  122. package/dist/api/state/state.fetch.d.cts.map +1 -1
  123. package/dist/api/state/state.fetch.d.ts +35 -17
  124. package/dist/api/state/state.fetch.d.ts.map +1 -1
  125. package/dist/api/state/state.fetch.js +4 -4
  126. package/dist/api/state/state.fetch.js.map +1 -1
  127. package/dist/api/state/state.js +4 -4
  128. package/dist/api/state/state.js.map +1 -1
  129. package/dist/api/unit/unit.cjs +30 -30
  130. package/dist/api/unit/unit.cjs.map +1 -1
  131. package/dist/api/unit/unit.d.cts +144 -72
  132. package/dist/api/unit/unit.d.cts.map +1 -1
  133. package/dist/api/unit/unit.d.ts +144 -72
  134. package/dist/api/unit/unit.d.ts.map +1 -1
  135. package/dist/api/unit/unit.fetch.cjs +30 -30
  136. package/dist/api/unit/unit.fetch.cjs.map +1 -1
  137. package/dist/api/unit/unit.fetch.d.cts +144 -72
  138. package/dist/api/unit/unit.fetch.d.cts.map +1 -1
  139. package/dist/api/unit/unit.fetch.d.ts +144 -72
  140. package/dist/api/unit/unit.fetch.d.ts.map +1 -1
  141. package/dist/api/unit/unit.fetch.js +30 -30
  142. package/dist/api/unit/unit.fetch.js.map +1 -1
  143. package/dist/api/unit/unit.js +30 -30
  144. package/dist/api/unit/unit.js.map +1 -1
  145. package/dist/api/user/user.cjs +20 -20
  146. package/dist/api/user/user.cjs.map +1 -1
  147. package/dist/api/user/user.d.cts +107 -53
  148. package/dist/api/user/user.d.cts.map +1 -1
  149. package/dist/api/user/user.d.ts +107 -53
  150. package/dist/api/user/user.d.ts.map +1 -1
  151. package/dist/api/user/user.fetch.cjs +20 -20
  152. package/dist/api/user/user.fetch.cjs.map +1 -1
  153. package/dist/api/user/user.fetch.d.cts +107 -53
  154. package/dist/api/user/user.fetch.d.cts.map +1 -1
  155. package/dist/api/user/user.fetch.d.ts +107 -53
  156. package/dist/api/user/user.fetch.d.ts.map +1 -1
  157. package/dist/api/user/user.fetch.js +20 -20
  158. package/dist/api/user/user.fetch.js.map +1 -1
  159. package/dist/api/user/user.js +20 -20
  160. package/dist/api/user/user.js.map +1 -1
  161. package/package.json +7 -5
  162. package/src/api/actions/actions.fetch.ts +103 -12
  163. package/src/api/actions/actions.ts +103 -12
  164. package/src/api/asset/asset.fetch.ts +303 -94
  165. package/src/api/asset/asset.ts +303 -94
  166. package/src/api/charges/charges.fetch.ts +456 -54
  167. package/src/api/charges/charges.ts +456 -54
  168. package/src/api/event-stream/event-stream.fetch.ts +262 -58
  169. package/src/api/event-stream/event-stream.ts +262 -58
  170. package/src/api/merchant/merchant.fetch.ts +212 -28
  171. package/src/api/merchant/merchant.ts +212 -28
  172. package/src/api/organisation/organisation.fetch.ts +381 -86
  173. package/src/api/organisation/organisation.ts +381 -86
  174. package/src/api/product/product.fetch.ts +724 -130
  175. package/src/api/product/product.ts +724 -130
  176. package/src/api/state/state.fetch.ts +105 -16
  177. package/src/api/state/state.ts +105 -16
  178. package/src/api/unit/unit.fetch.ts +521 -146
  179. package/src/api/unit/unit.ts +521 -146
  180. package/src/api/user/user.fetch.ts +401 -101
  181. package/src/api/user/user.ts +401 -101
  182. package/tests/README.md +98 -0
  183. package/tests/component.test.tsx +191 -0
  184. package/tests/tsconfig.json +7 -0
  185. package/tests/type-tests.tsx +196 -0
@@ -10,11 +10,15 @@ A service that provides access to the Account Server, which gives *registered* u
10
10
  */
11
11
  import { useMutation, useQuery, useSuspenseQuery } from "@tanstack/react-query";
12
12
  import type {
13
+ DataTag,
14
+ DefinedInitialDataOptions,
15
+ DefinedUseQueryResult,
13
16
  InvalidateOptions,
14
17
  MutationFunction,
15
18
  QueryClient,
16
19
  QueryFunction,
17
20
  QueryKey,
21
+ UndefinedInitialDataOptions,
18
22
  UseMutationOptions,
19
23
  UseMutationResult,
20
24
  UseQueryOptions,
@@ -53,7 +57,7 @@ export const getGetUserAccountQueryOptions = <
53
57
  TData = Awaited<ReturnType<typeof getUserAccount>>,
54
58
  TError = ErrorType<void | AsError>,
55
59
  >(options?: {
56
- query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
60
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
57
61
  request?: SecondParameter<typeof customInstance>;
58
62
  }) => {
59
63
  const { query: queryOptions, request: requestOptions } = options ?? {};
@@ -67,12 +71,58 @@ export const getGetUserAccountQueryOptions = <
67
71
  Awaited<ReturnType<typeof getUserAccount>>,
68
72
  TError,
69
73
  TData
70
- > & { queryKey: QueryKey };
74
+ > & { queryKey: DataTag<QueryKey, TData> };
71
75
  };
72
76
 
73
77
  export type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
74
78
  export type GetUserAccountQueryError = ErrorType<void | AsError>;
75
79
 
80
+ export function useGetUserAccount<
81
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
82
+ TError = ErrorType<void | AsError>,
83
+ >(
84
+ options: {
85
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
86
+ Pick<
87
+ DefinedInitialDataOptions<
88
+ Awaited<ReturnType<typeof getUserAccount>>,
89
+ TError,
90
+ Awaited<ReturnType<typeof getUserAccount>>
91
+ >,
92
+ "initialData"
93
+ >;
94
+ request?: SecondParameter<typeof customInstance>;
95
+ },
96
+ queryClient?: QueryClient,
97
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
98
+ export function useGetUserAccount<
99
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
100
+ TError = ErrorType<void | AsError>,
101
+ >(
102
+ options?: {
103
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
104
+ Pick<
105
+ UndefinedInitialDataOptions<
106
+ Awaited<ReturnType<typeof getUserAccount>>,
107
+ TError,
108
+ Awaited<ReturnType<typeof getUserAccount>>
109
+ >,
110
+ "initialData"
111
+ >;
112
+ request?: SecondParameter<typeof customInstance>;
113
+ },
114
+ queryClient?: QueryClient,
115
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
116
+ export function useGetUserAccount<
117
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
118
+ TError = ErrorType<void | AsError>,
119
+ >(
120
+ options?: {
121
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
122
+ request?: SecondParameter<typeof customInstance>;
123
+ },
124
+ queryClient?: QueryClient,
125
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
76
126
  /**
77
127
  * @summary Get information about your account
78
128
  */
@@ -80,13 +130,18 @@ export type GetUserAccountQueryError = ErrorType<void | AsError>;
80
130
  export function useGetUserAccount<
81
131
  TData = Awaited<ReturnType<typeof getUserAccount>>,
82
132
  TError = ErrorType<void | AsError>,
83
- >(options?: {
84
- query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
85
- request?: SecondParameter<typeof customInstance>;
86
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
133
+ >(
134
+ options?: {
135
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
136
+ request?: SecondParameter<typeof customInstance>;
137
+ },
138
+ queryClient?: QueryClient,
139
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
87
140
  const queryOptions = getGetUserAccountQueryOptions(options);
88
141
 
89
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
142
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
143
+ queryKey: DataTag<QueryKey, TData>;
144
+ };
90
145
 
91
146
  query.queryKey = queryOptions.queryKey;
92
147
 
@@ -109,7 +164,9 @@ export const getGetUserAccountSuspenseQueryOptions = <
109
164
  TData = Awaited<ReturnType<typeof getUserAccount>>,
110
165
  TError = ErrorType<void | AsError>,
111
166
  >(options?: {
112
- query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
167
+ query?: Partial<
168
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
169
+ >;
113
170
  request?: SecondParameter<typeof customInstance>;
114
171
  }) => {
115
172
  const { query: queryOptions, request: requestOptions } = options ?? {};
@@ -123,7 +180,7 @@ export const getGetUserAccountSuspenseQueryOptions = <
123
180
  Awaited<ReturnType<typeof getUserAccount>>,
124
181
  TError,
125
182
  TData
126
- > & { queryKey: QueryKey };
183
+ > & { queryKey: DataTag<QueryKey, TData> };
127
184
  };
128
185
 
129
186
  export type GetUserAccountSuspenseQueryResult = NonNullable<
@@ -131,6 +188,42 @@ export type GetUserAccountSuspenseQueryResult = NonNullable<
131
188
  >;
132
189
  export type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;
133
190
 
191
+ export function useGetUserAccountSuspense<
192
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
193
+ TError = ErrorType<void | AsError>,
194
+ >(
195
+ options: {
196
+ query: Partial<
197
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
198
+ >;
199
+ request?: SecondParameter<typeof customInstance>;
200
+ },
201
+ queryClient?: QueryClient,
202
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
203
+ export function useGetUserAccountSuspense<
204
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
205
+ TError = ErrorType<void | AsError>,
206
+ >(
207
+ options?: {
208
+ query?: Partial<
209
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
210
+ >;
211
+ request?: SecondParameter<typeof customInstance>;
212
+ },
213
+ queryClient?: QueryClient,
214
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
215
+ export function useGetUserAccountSuspense<
216
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
217
+ TError = ErrorType<void | AsError>,
218
+ >(
219
+ options?: {
220
+ query?: Partial<
221
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
222
+ >;
223
+ request?: SecondParameter<typeof customInstance>;
224
+ },
225
+ queryClient?: QueryClient,
226
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
134
227
  /**
135
228
  * @summary Get information about your account
136
229
  */
@@ -138,15 +231,21 @@ export type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;
138
231
  export function useGetUserAccountSuspense<
139
232
  TData = Awaited<ReturnType<typeof getUserAccount>>,
140
233
  TError = ErrorType<void | AsError>,
141
- >(options?: {
142
- query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
143
- request?: SecondParameter<typeof customInstance>;
144
- }): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
234
+ >(
235
+ options?: {
236
+ query?: Partial<
237
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
238
+ >;
239
+ request?: SecondParameter<typeof customInstance>;
240
+ },
241
+ queryClient?: QueryClient,
242
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
145
243
  const queryOptions = getGetUserAccountSuspenseQueryOptions(options);
146
244
 
147
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {
148
- queryKey: QueryKey;
149
- };
245
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
246
+ TData,
247
+ TError
248
+ > & { queryKey: DataTag<QueryKey, TData> };
150
249
 
151
250
  query.queryKey = queryOptions.queryKey;
152
251
 
@@ -183,7 +282,9 @@ export const getGetOrganisationUsersQueryOptions = <
183
282
  >(
184
283
  orgId: string,
185
284
  options?: {
186
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;
285
+ query?: Partial<
286
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
287
+ >;
187
288
  request?: SecondParameter<typeof customInstance>;
188
289
  },
189
290
  ) => {
@@ -198,7 +299,7 @@ export const getGetOrganisationUsersQueryOptions = <
198
299
  Awaited<ReturnType<typeof getOrganisationUsers>>,
199
300
  TError,
200
301
  TData
201
- > & { queryKey: QueryKey };
302
+ > & { queryKey: DataTag<QueryKey, TData> };
202
303
  };
203
304
 
204
305
  export type GetOrganisationUsersQueryResult = NonNullable<
@@ -206,6 +307,61 @@ export type GetOrganisationUsersQueryResult = NonNullable<
206
307
  >;
207
308
  export type GetOrganisationUsersQueryError = ErrorType<AsError | void>;
208
309
 
310
+ export function useGetOrganisationUsers<
311
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
312
+ TError = ErrorType<AsError | void>,
313
+ >(
314
+ orgId: string,
315
+ options: {
316
+ query: Partial<
317
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
318
+ > &
319
+ Pick<
320
+ DefinedInitialDataOptions<
321
+ Awaited<ReturnType<typeof getOrganisationUsers>>,
322
+ TError,
323
+ Awaited<ReturnType<typeof getOrganisationUsers>>
324
+ >,
325
+ "initialData"
326
+ >;
327
+ request?: SecondParameter<typeof customInstance>;
328
+ },
329
+ queryClient?: QueryClient,
330
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
331
+ export function useGetOrganisationUsers<
332
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
333
+ TError = ErrorType<AsError | void>,
334
+ >(
335
+ orgId: string,
336
+ options?: {
337
+ query?: Partial<
338
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
339
+ > &
340
+ Pick<
341
+ UndefinedInitialDataOptions<
342
+ Awaited<ReturnType<typeof getOrganisationUsers>>,
343
+ TError,
344
+ Awaited<ReturnType<typeof getOrganisationUsers>>
345
+ >,
346
+ "initialData"
347
+ >;
348
+ request?: SecondParameter<typeof customInstance>;
349
+ },
350
+ queryClient?: QueryClient,
351
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
352
+ export function useGetOrganisationUsers<
353
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
354
+ TError = ErrorType<AsError | void>,
355
+ >(
356
+ orgId: string,
357
+ options?: {
358
+ query?: Partial<
359
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
360
+ >;
361
+ request?: SecondParameter<typeof customInstance>;
362
+ },
363
+ queryClient?: QueryClient,
364
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
209
365
  /**
210
366
  * @summary Gets users in an Organisation
211
367
  */
@@ -216,13 +372,18 @@ export function useGetOrganisationUsers<
216
372
  >(
217
373
  orgId: string,
218
374
  options?: {
219
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;
375
+ query?: Partial<
376
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
377
+ >;
220
378
  request?: SecondParameter<typeof customInstance>;
221
379
  },
222
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
380
+ queryClient?: QueryClient,
381
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
223
382
  const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);
224
383
 
225
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
384
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
385
+ queryKey: DataTag<QueryKey, TData>;
386
+ };
226
387
 
227
388
  query.queryKey = queryOptions.queryKey;
228
389
 
@@ -251,10 +412,8 @@ export const getGetOrganisationUsersSuspenseQueryOptions = <
251
412
  >(
252
413
  orgId: string,
253
414
  options?: {
254
- query?: UseSuspenseQueryOptions<
255
- Awaited<ReturnType<typeof getOrganisationUsers>>,
256
- TError,
257
- TData
415
+ query?: Partial<
416
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
258
417
  >;
259
418
  request?: SecondParameter<typeof customInstance>;
260
419
  },
@@ -270,7 +429,7 @@ export const getGetOrganisationUsersSuspenseQueryOptions = <
270
429
  Awaited<ReturnType<typeof getOrganisationUsers>>,
271
430
  TError,
272
431
  TData
273
- > & { queryKey: QueryKey };
432
+ > & { queryKey: DataTag<QueryKey, TData> };
274
433
  };
275
434
 
276
435
  export type GetOrganisationUsersSuspenseQueryResult = NonNullable<
@@ -278,6 +437,45 @@ export type GetOrganisationUsersSuspenseQueryResult = NonNullable<
278
437
  >;
279
438
  export type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>;
280
439
 
440
+ export function useGetOrganisationUsersSuspense<
441
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
442
+ TError = ErrorType<AsError | void>,
443
+ >(
444
+ orgId: string,
445
+ options: {
446
+ query: Partial<
447
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
448
+ >;
449
+ request?: SecondParameter<typeof customInstance>;
450
+ },
451
+ queryClient?: QueryClient,
452
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
453
+ export function useGetOrganisationUsersSuspense<
454
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
455
+ TError = ErrorType<AsError | void>,
456
+ >(
457
+ orgId: string,
458
+ options?: {
459
+ query?: Partial<
460
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
461
+ >;
462
+ request?: SecondParameter<typeof customInstance>;
463
+ },
464
+ queryClient?: QueryClient,
465
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
466
+ export function useGetOrganisationUsersSuspense<
467
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
468
+ TError = ErrorType<AsError | void>,
469
+ >(
470
+ orgId: string,
471
+ options?: {
472
+ query?: Partial<
473
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
474
+ >;
475
+ request?: SecondParameter<typeof customInstance>;
476
+ },
477
+ queryClient?: QueryClient,
478
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
281
479
  /**
282
480
  * @summary Gets users in an Organisation
283
481
  */
@@ -288,19 +486,19 @@ export function useGetOrganisationUsersSuspense<
288
486
  >(
289
487
  orgId: string,
290
488
  options?: {
291
- query?: UseSuspenseQueryOptions<
292
- Awaited<ReturnType<typeof getOrganisationUsers>>,
293
- TError,
294
- TData
489
+ query?: Partial<
490
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
295
491
  >;
296
492
  request?: SecondParameter<typeof customInstance>;
297
493
  },
298
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
494
+ queryClient?: QueryClient,
495
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
299
496
  const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);
300
497
 
301
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {
302
- queryKey: QueryKey;
303
- };
498
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
499
+ TData,
500
+ TError
501
+ > & { queryKey: DataTag<QueryKey, TData> };
304
502
 
305
503
  query.queryKey = queryOptions.queryKey;
306
504
 
@@ -370,18 +568,18 @@ export type AddOrganisationUserMutationError = ErrorType<AsError | void>;
370
568
  /**
371
569
  * @summary Adds a User to an Organisation
372
570
  */
373
- export const useAddOrganisationUser = <
374
- TError = ErrorType<AsError | void>,
375
- TContext = unknown,
376
- >(options?: {
377
- mutation?: UseMutationOptions<
378
- Awaited<ReturnType<typeof addOrganisationUser>>,
379
- TError,
380
- { orgId: string; userId: string },
381
- TContext
382
- >;
383
- request?: SecondParameter<typeof customInstance>;
384
- }): UseMutationResult<
571
+ export const useAddOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
572
+ options?: {
573
+ mutation?: UseMutationOptions<
574
+ Awaited<ReturnType<typeof addOrganisationUser>>,
575
+ TError,
576
+ { orgId: string; userId: string },
577
+ TContext
578
+ >;
579
+ request?: SecondParameter<typeof customInstance>;
580
+ },
581
+ queryClient?: QueryClient,
582
+ ): UseMutationResult<
385
583
  Awaited<ReturnType<typeof addOrganisationUser>>,
386
584
  TError,
387
585
  { orgId: string; userId: string },
@@ -389,7 +587,7 @@ export const useAddOrganisationUser = <
389
587
  > => {
390
588
  const mutationOptions = getAddOrganisationUserMutationOptions(options);
391
589
 
392
- return useMutation(mutationOptions);
590
+ return useMutation(mutationOptions, queryClient);
393
591
  };
394
592
  /**
395
593
  * Removes a User from an **Organisation**.
@@ -454,18 +652,18 @@ export type DeleteOrganisationUserMutationError = ErrorType<AsError | void>;
454
652
  /**
455
653
  * @summary Deletes a User from an Organisation
456
654
  */
457
- export const useDeleteOrganisationUser = <
458
- TError = ErrorType<AsError | void>,
459
- TContext = unknown,
460
- >(options?: {
461
- mutation?: UseMutationOptions<
462
- Awaited<ReturnType<typeof deleteOrganisationUser>>,
463
- TError,
464
- { orgId: string; userId: string },
465
- TContext
466
- >;
467
- request?: SecondParameter<typeof customInstance>;
468
- }): UseMutationResult<
655
+ export const useDeleteOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
656
+ options?: {
657
+ mutation?: UseMutationOptions<
658
+ Awaited<ReturnType<typeof deleteOrganisationUser>>,
659
+ TError,
660
+ { orgId: string; userId: string },
661
+ TContext
662
+ >;
663
+ request?: SecondParameter<typeof customInstance>;
664
+ },
665
+ queryClient?: QueryClient,
666
+ ): UseMutationResult<
469
667
  Awaited<ReturnType<typeof deleteOrganisationUser>>,
470
668
  TError,
471
669
  { orgId: string; userId: string },
@@ -473,7 +671,7 @@ export const useDeleteOrganisationUser = <
473
671
  > => {
474
672
  const mutationOptions = getDeleteOrganisationUserMutationOptions(options);
475
673
 
476
- return useMutation(mutationOptions);
674
+ return useMutation(mutationOptions, queryClient);
477
675
  };
478
676
  /**
479
677
  * Gets users in an Organisational Unit.
@@ -505,7 +703,9 @@ export const getGetOrganisationUnitUsersQueryOptions = <
505
703
  >(
506
704
  unitId: string,
507
705
  options?: {
508
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;
706
+ query?: Partial<
707
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
708
+ >;
509
709
  request?: SecondParameter<typeof customInstance>;
510
710
  },
511
711
  ) => {
@@ -521,7 +721,7 @@ export const getGetOrganisationUnitUsersQueryOptions = <
521
721
  Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
522
722
  TError,
523
723
  TData
524
- > & { queryKey: QueryKey };
724
+ > & { queryKey: DataTag<QueryKey, TData> };
525
725
  };
526
726
 
527
727
  export type GetOrganisationUnitUsersQueryResult = NonNullable<
@@ -529,6 +729,61 @@ export type GetOrganisationUnitUsersQueryResult = NonNullable<
529
729
  >;
530
730
  export type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;
531
731
 
732
+ export function useGetOrganisationUnitUsers<
733
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
734
+ TError = ErrorType<AsError | void>,
735
+ >(
736
+ unitId: string,
737
+ options: {
738
+ query: Partial<
739
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
740
+ > &
741
+ Pick<
742
+ DefinedInitialDataOptions<
743
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
744
+ TError,
745
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>
746
+ >,
747
+ "initialData"
748
+ >;
749
+ request?: SecondParameter<typeof customInstance>;
750
+ },
751
+ queryClient?: QueryClient,
752
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
753
+ export function useGetOrganisationUnitUsers<
754
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
755
+ TError = ErrorType<AsError | void>,
756
+ >(
757
+ unitId: string,
758
+ options?: {
759
+ query?: Partial<
760
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
761
+ > &
762
+ Pick<
763
+ UndefinedInitialDataOptions<
764
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
765
+ TError,
766
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>
767
+ >,
768
+ "initialData"
769
+ >;
770
+ request?: SecondParameter<typeof customInstance>;
771
+ },
772
+ queryClient?: QueryClient,
773
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
774
+ export function useGetOrganisationUnitUsers<
775
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
776
+ TError = ErrorType<AsError | void>,
777
+ >(
778
+ unitId: string,
779
+ options?: {
780
+ query?: Partial<
781
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
782
+ >;
783
+ request?: SecondParameter<typeof customInstance>;
784
+ },
785
+ queryClient?: QueryClient,
786
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
532
787
  /**
533
788
  * @summary Gets users in an Organisational Unit
534
789
  */
@@ -539,13 +794,18 @@ export function useGetOrganisationUnitUsers<
539
794
  >(
540
795
  unitId: string,
541
796
  options?: {
542
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;
797
+ query?: Partial<
798
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
799
+ >;
543
800
  request?: SecondParameter<typeof customInstance>;
544
801
  },
545
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
802
+ queryClient?: QueryClient,
803
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
546
804
  const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);
547
805
 
548
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
806
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
807
+ queryKey: DataTag<QueryKey, TData>;
808
+ };
549
809
 
550
810
  query.queryKey = queryOptions.queryKey;
551
811
 
@@ -574,10 +834,8 @@ export const getGetOrganisationUnitUsersSuspenseQueryOptions = <
574
834
  >(
575
835
  unitId: string,
576
836
  options?: {
577
- query?: UseSuspenseQueryOptions<
578
- Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
579
- TError,
580
- TData
837
+ query?: Partial<
838
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
581
839
  >;
582
840
  request?: SecondParameter<typeof customInstance>;
583
841
  },
@@ -594,7 +852,7 @@ export const getGetOrganisationUnitUsersSuspenseQueryOptions = <
594
852
  Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
595
853
  TError,
596
854
  TData
597
- > & { queryKey: QueryKey };
855
+ > & { queryKey: DataTag<QueryKey, TData> };
598
856
  };
599
857
 
600
858
  export type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<
@@ -602,6 +860,45 @@ export type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<
602
860
  >;
603
861
  export type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>;
604
862
 
863
+ export function useGetOrganisationUnitUsersSuspense<
864
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
865
+ TError = ErrorType<AsError | void>,
866
+ >(
867
+ unitId: string,
868
+ options: {
869
+ query: Partial<
870
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
871
+ >;
872
+ request?: SecondParameter<typeof customInstance>;
873
+ },
874
+ queryClient?: QueryClient,
875
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
876
+ export function useGetOrganisationUnitUsersSuspense<
877
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
878
+ TError = ErrorType<AsError | void>,
879
+ >(
880
+ unitId: string,
881
+ options?: {
882
+ query?: Partial<
883
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
884
+ >;
885
+ request?: SecondParameter<typeof customInstance>;
886
+ },
887
+ queryClient?: QueryClient,
888
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
889
+ export function useGetOrganisationUnitUsersSuspense<
890
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
891
+ TError = ErrorType<AsError | void>,
892
+ >(
893
+ unitId: string,
894
+ options?: {
895
+ query?: Partial<
896
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
897
+ >;
898
+ request?: SecondParameter<typeof customInstance>;
899
+ },
900
+ queryClient?: QueryClient,
901
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
605
902
  /**
606
903
  * @summary Gets users in an Organisational Unit
607
904
  */
@@ -612,19 +909,19 @@ export function useGetOrganisationUnitUsersSuspense<
612
909
  >(
613
910
  unitId: string,
614
911
  options?: {
615
- query?: UseSuspenseQueryOptions<
616
- Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
617
- TError,
618
- TData
912
+ query?: Partial<
913
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
619
914
  >;
620
915
  request?: SecondParameter<typeof customInstance>;
621
916
  },
622
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
917
+ queryClient?: QueryClient,
918
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
623
919
  const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);
624
920
 
625
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {
626
- queryKey: QueryKey;
627
- };
921
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
922
+ TData,
923
+ TError
924
+ > & { queryKey: DataTag<QueryKey, TData> };
628
925
 
629
926
  query.queryKey = queryOptions.queryKey;
630
927
 
@@ -693,18 +990,18 @@ export type AddOrganisationUnitUserMutationError = ErrorType<AsError | void>;
693
990
  /**
694
991
  * @summary Adds a user to an Organisational Unit
695
992
  */
696
- export const useAddOrganisationUnitUser = <
697
- TError = ErrorType<AsError | void>,
698
- TContext = unknown,
699
- >(options?: {
700
- mutation?: UseMutationOptions<
701
- Awaited<ReturnType<typeof addOrganisationUnitUser>>,
702
- TError,
703
- { unitId: string; userId: string },
704
- TContext
705
- >;
706
- request?: SecondParameter<typeof customInstance>;
707
- }): UseMutationResult<
993
+ export const useAddOrganisationUnitUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
994
+ options?: {
995
+ mutation?: UseMutationOptions<
996
+ Awaited<ReturnType<typeof addOrganisationUnitUser>>,
997
+ TError,
998
+ { unitId: string; userId: string },
999
+ TContext
1000
+ >;
1001
+ request?: SecondParameter<typeof customInstance>;
1002
+ },
1003
+ queryClient?: QueryClient,
1004
+ ): UseMutationResult<
708
1005
  Awaited<ReturnType<typeof addOrganisationUnitUser>>,
709
1006
  TError,
710
1007
  { unitId: string; userId: string },
@@ -712,7 +1009,7 @@ export const useAddOrganisationUnitUser = <
712
1009
  > => {
713
1010
  const mutationOptions = getAddOrganisationUnitUserMutationOptions(options);
714
1011
 
715
- return useMutation(mutationOptions);
1012
+ return useMutation(mutationOptions, queryClient);
716
1013
  };
717
1014
  /**
718
1015
  * Removes a User from an Organisational Unit.
@@ -779,15 +1076,18 @@ export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError | void>;
779
1076
  export const useDeleteOrganisationUnitUser = <
780
1077
  TError = ErrorType<AsError | void>,
781
1078
  TContext = unknown,
782
- >(options?: {
783
- mutation?: UseMutationOptions<
784
- Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
785
- TError,
786
- { unitId: string; userId: string },
787
- TContext
788
- >;
789
- request?: SecondParameter<typeof customInstance>;
790
- }): UseMutationResult<
1079
+ >(
1080
+ options?: {
1081
+ mutation?: UseMutationOptions<
1082
+ Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
1083
+ TError,
1084
+ { unitId: string; userId: string },
1085
+ TContext
1086
+ >;
1087
+ request?: SecondParameter<typeof customInstance>;
1088
+ },
1089
+ queryClient?: QueryClient,
1090
+ ): UseMutationResult<
791
1091
  Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
792
1092
  TError,
793
1093
  { unitId: string; userId: string },
@@ -795,5 +1095,5 @@ export const useDeleteOrganisationUnitUser = <
795
1095
  > => {
796
1096
  const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);
797
1097
 
798
- return useMutation(mutationOptions);
1098
+ return useMutation(mutationOptions, queryClient);
799
1099
  };