@squonk/account-server-client 4.4.0-4-4.2197467763 → 4.4.0-4-4.2200269934

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,
@@ -65,7 +69,7 @@ export const getGetUserAccountQueryOptions = <
65
69
  TData = Awaited<ReturnType<typeof getUserAccount>>,
66
70
  TError = ErrorType<void | AsError>,
67
71
  >(options?: {
68
- query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
72
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
69
73
  request?: SecondParameter<typeof customFetch>;
70
74
  }) => {
71
75
  const { query: queryOptions, request: requestOptions } = options ?? {};
@@ -79,12 +83,58 @@ export const getGetUserAccountQueryOptions = <
79
83
  Awaited<ReturnType<typeof getUserAccount>>,
80
84
  TError,
81
85
  TData
82
- > & { queryKey: QueryKey };
86
+ > & { queryKey: DataTag<QueryKey, TData> };
83
87
  };
84
88
 
85
89
  export type GetUserAccountQueryResult = NonNullable<Awaited<ReturnType<typeof getUserAccount>>>;
86
90
  export type GetUserAccountQueryError = ErrorType<void | AsError>;
87
91
 
92
+ export function useGetUserAccount<
93
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
94
+ TError = ErrorType<void | AsError>,
95
+ >(
96
+ options: {
97
+ query: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
98
+ Pick<
99
+ DefinedInitialDataOptions<
100
+ Awaited<ReturnType<typeof getUserAccount>>,
101
+ TError,
102
+ Awaited<ReturnType<typeof getUserAccount>>
103
+ >,
104
+ "initialData"
105
+ >;
106
+ request?: SecondParameter<typeof customFetch>;
107
+ },
108
+ queryClient?: QueryClient,
109
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
110
+ export function useGetUserAccount<
111
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
112
+ TError = ErrorType<void | AsError>,
113
+ >(
114
+ options?: {
115
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>> &
116
+ Pick<
117
+ UndefinedInitialDataOptions<
118
+ Awaited<ReturnType<typeof getUserAccount>>,
119
+ TError,
120
+ Awaited<ReturnType<typeof getUserAccount>>
121
+ >,
122
+ "initialData"
123
+ >;
124
+ request?: SecondParameter<typeof customFetch>;
125
+ },
126
+ queryClient?: QueryClient,
127
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
128
+ export function useGetUserAccount<
129
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
130
+ TError = ErrorType<void | AsError>,
131
+ >(
132
+ options?: {
133
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
134
+ request?: SecondParameter<typeof customFetch>;
135
+ },
136
+ queryClient?: QueryClient,
137
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
88
138
  /**
89
139
  * @summary Get information about your account
90
140
  */
@@ -92,13 +142,18 @@ export type GetUserAccountQueryError = ErrorType<void | AsError>;
92
142
  export function useGetUserAccount<
93
143
  TData = Awaited<ReturnType<typeof getUserAccount>>,
94
144
  TError = ErrorType<void | AsError>,
95
- >(options?: {
96
- query?: UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
97
- request?: SecondParameter<typeof customFetch>;
98
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
145
+ >(
146
+ options?: {
147
+ query?: Partial<UseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>>;
148
+ request?: SecondParameter<typeof customFetch>;
149
+ },
150
+ queryClient?: QueryClient,
151
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
99
152
  const queryOptions = getGetUserAccountQueryOptions(options);
100
153
 
101
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
154
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
155
+ queryKey: DataTag<QueryKey, TData>;
156
+ };
102
157
 
103
158
  query.queryKey = queryOptions.queryKey;
104
159
 
@@ -121,7 +176,9 @@ export const getGetUserAccountSuspenseQueryOptions = <
121
176
  TData = Awaited<ReturnType<typeof getUserAccount>>,
122
177
  TError = ErrorType<void | AsError>,
123
178
  >(options?: {
124
- query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
179
+ query?: Partial<
180
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
181
+ >;
125
182
  request?: SecondParameter<typeof customFetch>;
126
183
  }) => {
127
184
  const { query: queryOptions, request: requestOptions } = options ?? {};
@@ -135,7 +192,7 @@ export const getGetUserAccountSuspenseQueryOptions = <
135
192
  Awaited<ReturnType<typeof getUserAccount>>,
136
193
  TError,
137
194
  TData
138
- > & { queryKey: QueryKey };
195
+ > & { queryKey: DataTag<QueryKey, TData> };
139
196
  };
140
197
 
141
198
  export type GetUserAccountSuspenseQueryResult = NonNullable<
@@ -143,6 +200,42 @@ export type GetUserAccountSuspenseQueryResult = NonNullable<
143
200
  >;
144
201
  export type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;
145
202
 
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 customFetch>;
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 customFetch>;
224
+ },
225
+ queryClient?: QueryClient,
226
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
227
+ export function useGetUserAccountSuspense<
228
+ TData = Awaited<ReturnType<typeof getUserAccount>>,
229
+ TError = ErrorType<void | AsError>,
230
+ >(
231
+ options?: {
232
+ query?: Partial<
233
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
234
+ >;
235
+ request?: SecondParameter<typeof customFetch>;
236
+ },
237
+ queryClient?: QueryClient,
238
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
146
239
  /**
147
240
  * @summary Get information about your account
148
241
  */
@@ -150,15 +243,21 @@ export type GetUserAccountSuspenseQueryError = ErrorType<void | AsError>;
150
243
  export function useGetUserAccountSuspense<
151
244
  TData = Awaited<ReturnType<typeof getUserAccount>>,
152
245
  TError = ErrorType<void | AsError>,
153
- >(options?: {
154
- query?: UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>;
155
- request?: SecondParameter<typeof customFetch>;
156
- }): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
246
+ >(
247
+ options?: {
248
+ query?: Partial<
249
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getUserAccount>>, TError, TData>
250
+ >;
251
+ request?: SecondParameter<typeof customFetch>;
252
+ },
253
+ queryClient?: QueryClient,
254
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
157
255
  const queryOptions = getGetUserAccountSuspenseQueryOptions(options);
158
256
 
159
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {
160
- queryKey: QueryKey;
161
- };
257
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
258
+ TData,
259
+ TError
260
+ > & { queryKey: DataTag<QueryKey, TData> };
162
261
 
163
262
  query.queryKey = queryOptions.queryKey;
164
263
 
@@ -219,7 +318,9 @@ export const getGetOrganisationUsersQueryOptions = <
219
318
  >(
220
319
  orgId: string,
221
320
  options?: {
222
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;
321
+ query?: Partial<
322
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
323
+ >;
223
324
  request?: SecondParameter<typeof customFetch>;
224
325
  },
225
326
  ) => {
@@ -234,7 +335,7 @@ export const getGetOrganisationUsersQueryOptions = <
234
335
  Awaited<ReturnType<typeof getOrganisationUsers>>,
235
336
  TError,
236
337
  TData
237
- > & { queryKey: QueryKey };
338
+ > & { queryKey: DataTag<QueryKey, TData> };
238
339
  };
239
340
 
240
341
  export type GetOrganisationUsersQueryResult = NonNullable<
@@ -242,6 +343,61 @@ export type GetOrganisationUsersQueryResult = NonNullable<
242
343
  >;
243
344
  export type GetOrganisationUsersQueryError = ErrorType<AsError | void>;
244
345
 
346
+ export function useGetOrganisationUsers<
347
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
348
+ TError = ErrorType<AsError | void>,
349
+ >(
350
+ orgId: string,
351
+ options: {
352
+ query: Partial<
353
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
354
+ > &
355
+ Pick<
356
+ DefinedInitialDataOptions<
357
+ Awaited<ReturnType<typeof getOrganisationUsers>>,
358
+ TError,
359
+ Awaited<ReturnType<typeof getOrganisationUsers>>
360
+ >,
361
+ "initialData"
362
+ >;
363
+ request?: SecondParameter<typeof customFetch>;
364
+ },
365
+ queryClient?: QueryClient,
366
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
367
+ export function useGetOrganisationUsers<
368
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
369
+ TError = ErrorType<AsError | void>,
370
+ >(
371
+ orgId: string,
372
+ options?: {
373
+ query?: Partial<
374
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
375
+ > &
376
+ Pick<
377
+ UndefinedInitialDataOptions<
378
+ Awaited<ReturnType<typeof getOrganisationUsers>>,
379
+ TError,
380
+ Awaited<ReturnType<typeof getOrganisationUsers>>
381
+ >,
382
+ "initialData"
383
+ >;
384
+ request?: SecondParameter<typeof customFetch>;
385
+ },
386
+ queryClient?: QueryClient,
387
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
388
+ export function useGetOrganisationUsers<
389
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
390
+ TError = ErrorType<AsError | void>,
391
+ >(
392
+ orgId: string,
393
+ options?: {
394
+ query?: Partial<
395
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
396
+ >;
397
+ request?: SecondParameter<typeof customFetch>;
398
+ },
399
+ queryClient?: QueryClient,
400
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
245
401
  /**
246
402
  * @summary Gets users in an Organisation
247
403
  */
@@ -252,13 +408,18 @@ export function useGetOrganisationUsers<
252
408
  >(
253
409
  orgId: string,
254
410
  options?: {
255
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>;
411
+ query?: Partial<
412
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
413
+ >;
256
414
  request?: SecondParameter<typeof customFetch>;
257
415
  },
258
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
416
+ queryClient?: QueryClient,
417
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
259
418
  const queryOptions = getGetOrganisationUsersQueryOptions(orgId, options);
260
419
 
261
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
420
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
421
+ queryKey: DataTag<QueryKey, TData>;
422
+ };
262
423
 
263
424
  query.queryKey = queryOptions.queryKey;
264
425
 
@@ -287,10 +448,8 @@ export const getGetOrganisationUsersSuspenseQueryOptions = <
287
448
  >(
288
449
  orgId: string,
289
450
  options?: {
290
- query?: UseSuspenseQueryOptions<
291
- Awaited<ReturnType<typeof getOrganisationUsers>>,
292
- TError,
293
- TData
451
+ query?: Partial<
452
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
294
453
  >;
295
454
  request?: SecondParameter<typeof customFetch>;
296
455
  },
@@ -306,7 +465,7 @@ export const getGetOrganisationUsersSuspenseQueryOptions = <
306
465
  Awaited<ReturnType<typeof getOrganisationUsers>>,
307
466
  TError,
308
467
  TData
309
- > & { queryKey: QueryKey };
468
+ > & { queryKey: DataTag<QueryKey, TData> };
310
469
  };
311
470
 
312
471
  export type GetOrganisationUsersSuspenseQueryResult = NonNullable<
@@ -314,6 +473,45 @@ export type GetOrganisationUsersSuspenseQueryResult = NonNullable<
314
473
  >;
315
474
  export type GetOrganisationUsersSuspenseQueryError = ErrorType<AsError | void>;
316
475
 
476
+ export function useGetOrganisationUsersSuspense<
477
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
478
+ TError = ErrorType<AsError | void>,
479
+ >(
480
+ orgId: string,
481
+ options: {
482
+ query: Partial<
483
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
484
+ >;
485
+ request?: SecondParameter<typeof customFetch>;
486
+ },
487
+ queryClient?: QueryClient,
488
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
489
+ export function useGetOrganisationUsersSuspense<
490
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
491
+ TError = ErrorType<AsError | void>,
492
+ >(
493
+ orgId: string,
494
+ options?: {
495
+ query?: Partial<
496
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
497
+ >;
498
+ request?: SecondParameter<typeof customFetch>;
499
+ },
500
+ queryClient?: QueryClient,
501
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
502
+ export function useGetOrganisationUsersSuspense<
503
+ TData = Awaited<ReturnType<typeof getOrganisationUsers>>,
504
+ TError = ErrorType<AsError | void>,
505
+ >(
506
+ orgId: string,
507
+ options?: {
508
+ query?: Partial<
509
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
510
+ >;
511
+ request?: SecondParameter<typeof customFetch>;
512
+ },
513
+ queryClient?: QueryClient,
514
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
317
515
  /**
318
516
  * @summary Gets users in an Organisation
319
517
  */
@@ -324,19 +522,19 @@ export function useGetOrganisationUsersSuspense<
324
522
  >(
325
523
  orgId: string,
326
524
  options?: {
327
- query?: UseSuspenseQueryOptions<
328
- Awaited<ReturnType<typeof getOrganisationUsers>>,
329
- TError,
330
- TData
525
+ query?: Partial<
526
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUsers>>, TError, TData>
331
527
  >;
332
528
  request?: SecondParameter<typeof customFetch>;
333
529
  },
334
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
530
+ queryClient?: QueryClient,
531
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
335
532
  const queryOptions = getGetOrganisationUsersSuspenseQueryOptions(orgId, options);
336
533
 
337
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {
338
- queryKey: QueryKey;
339
- };
534
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
535
+ TData,
536
+ TError
537
+ > & { queryKey: DataTag<QueryKey, TData> };
340
538
 
341
539
  query.queryKey = queryOptions.queryKey;
342
540
 
@@ -431,18 +629,18 @@ export type AddOrganisationUserMutationError = ErrorType<AsError | void>;
431
629
  /**
432
630
  * @summary Adds a User to an Organisation
433
631
  */
434
- export const useAddOrganisationUser = <
435
- TError = ErrorType<AsError | void>,
436
- TContext = unknown,
437
- >(options?: {
438
- mutation?: UseMutationOptions<
439
- Awaited<ReturnType<typeof addOrganisationUser>>,
440
- TError,
441
- { orgId: string; userId: string },
442
- TContext
443
- >;
444
- request?: SecondParameter<typeof customFetch>;
445
- }): UseMutationResult<
632
+ export const useAddOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
633
+ options?: {
634
+ mutation?: UseMutationOptions<
635
+ Awaited<ReturnType<typeof addOrganisationUser>>,
636
+ TError,
637
+ { orgId: string; userId: string },
638
+ TContext
639
+ >;
640
+ request?: SecondParameter<typeof customFetch>;
641
+ },
642
+ queryClient?: QueryClient,
643
+ ): UseMutationResult<
446
644
  Awaited<ReturnType<typeof addOrganisationUser>>,
447
645
  TError,
448
646
  { orgId: string; userId: string },
@@ -450,7 +648,7 @@ export const useAddOrganisationUser = <
450
648
  > => {
451
649
  const mutationOptions = getAddOrganisationUserMutationOptions(options);
452
650
 
453
- return useMutation(mutationOptions);
651
+ return useMutation(mutationOptions, queryClient);
454
652
  };
455
653
  /**
456
654
  * Removes a User from an **Organisation**.
@@ -540,18 +738,18 @@ export type DeleteOrganisationUserMutationError = ErrorType<AsError | void>;
540
738
  /**
541
739
  * @summary Deletes a User from an Organisation
542
740
  */
543
- export const useDeleteOrganisationUser = <
544
- TError = ErrorType<AsError | void>,
545
- TContext = unknown,
546
- >(options?: {
547
- mutation?: UseMutationOptions<
548
- Awaited<ReturnType<typeof deleteOrganisationUser>>,
549
- TError,
550
- { orgId: string; userId: string },
551
- TContext
552
- >;
553
- request?: SecondParameter<typeof customFetch>;
554
- }): UseMutationResult<
741
+ export const useDeleteOrganisationUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
742
+ options?: {
743
+ mutation?: UseMutationOptions<
744
+ Awaited<ReturnType<typeof deleteOrganisationUser>>,
745
+ TError,
746
+ { orgId: string; userId: string },
747
+ TContext
748
+ >;
749
+ request?: SecondParameter<typeof customFetch>;
750
+ },
751
+ queryClient?: QueryClient,
752
+ ): UseMutationResult<
555
753
  Awaited<ReturnType<typeof deleteOrganisationUser>>,
556
754
  TError,
557
755
  { orgId: string; userId: string },
@@ -559,7 +757,7 @@ export const useDeleteOrganisationUser = <
559
757
  > => {
560
758
  const mutationOptions = getDeleteOrganisationUserMutationOptions(options);
561
759
 
562
- return useMutation(mutationOptions);
760
+ return useMutation(mutationOptions, queryClient);
563
761
  };
564
762
  /**
565
763
  * Gets users in an Organisational Unit.
@@ -615,7 +813,9 @@ export const getGetOrganisationUnitUsersQueryOptions = <
615
813
  >(
616
814
  unitId: string,
617
815
  options?: {
618
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;
816
+ query?: Partial<
817
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
818
+ >;
619
819
  request?: SecondParameter<typeof customFetch>;
620
820
  },
621
821
  ) => {
@@ -631,7 +831,7 @@ export const getGetOrganisationUnitUsersQueryOptions = <
631
831
  Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
632
832
  TError,
633
833
  TData
634
- > & { queryKey: QueryKey };
834
+ > & { queryKey: DataTag<QueryKey, TData> };
635
835
  };
636
836
 
637
837
  export type GetOrganisationUnitUsersQueryResult = NonNullable<
@@ -639,6 +839,61 @@ export type GetOrganisationUnitUsersQueryResult = NonNullable<
639
839
  >;
640
840
  export type GetOrganisationUnitUsersQueryError = ErrorType<AsError | void>;
641
841
 
842
+ export function useGetOrganisationUnitUsers<
843
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
844
+ TError = ErrorType<AsError | void>,
845
+ >(
846
+ unitId: string,
847
+ options: {
848
+ query: Partial<
849
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
850
+ > &
851
+ Pick<
852
+ DefinedInitialDataOptions<
853
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
854
+ TError,
855
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>
856
+ >,
857
+ "initialData"
858
+ >;
859
+ request?: SecondParameter<typeof customFetch>;
860
+ },
861
+ queryClient?: QueryClient,
862
+ ): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
863
+ export function useGetOrganisationUnitUsers<
864
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
865
+ TError = ErrorType<AsError | void>,
866
+ >(
867
+ unitId: string,
868
+ options?: {
869
+ query?: Partial<
870
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
871
+ > &
872
+ Pick<
873
+ UndefinedInitialDataOptions<
874
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
875
+ TError,
876
+ Awaited<ReturnType<typeof getOrganisationUnitUsers>>
877
+ >,
878
+ "initialData"
879
+ >;
880
+ request?: SecondParameter<typeof customFetch>;
881
+ },
882
+ queryClient?: QueryClient,
883
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
884
+ export function useGetOrganisationUnitUsers<
885
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
886
+ TError = ErrorType<AsError | void>,
887
+ >(
888
+ unitId: string,
889
+ options?: {
890
+ query?: Partial<
891
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
892
+ >;
893
+ request?: SecondParameter<typeof customFetch>;
894
+ },
895
+ queryClient?: QueryClient,
896
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
642
897
  /**
643
898
  * @summary Gets users in an Organisational Unit
644
899
  */
@@ -649,13 +904,18 @@ export function useGetOrganisationUnitUsers<
649
904
  >(
650
905
  unitId: string,
651
906
  options?: {
652
- query?: UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>;
907
+ query?: Partial<
908
+ UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
909
+ >;
653
910
  request?: SecondParameter<typeof customFetch>;
654
911
  },
655
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
912
+ queryClient?: QueryClient,
913
+ ): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
656
914
  const queryOptions = getGetOrganisationUnitUsersQueryOptions(unitId, options);
657
915
 
658
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
916
+ const query = useQuery(queryOptions, queryClient) as UseQueryResult<TData, TError> & {
917
+ queryKey: DataTag<QueryKey, TData>;
918
+ };
659
919
 
660
920
  query.queryKey = queryOptions.queryKey;
661
921
 
@@ -684,10 +944,8 @@ export const getGetOrganisationUnitUsersSuspenseQueryOptions = <
684
944
  >(
685
945
  unitId: string,
686
946
  options?: {
687
- query?: UseSuspenseQueryOptions<
688
- Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
689
- TError,
690
- TData
947
+ query?: Partial<
948
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
691
949
  >;
692
950
  request?: SecondParameter<typeof customFetch>;
693
951
  },
@@ -704,7 +962,7 @@ export const getGetOrganisationUnitUsersSuspenseQueryOptions = <
704
962
  Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
705
963
  TError,
706
964
  TData
707
- > & { queryKey: QueryKey };
965
+ > & { queryKey: DataTag<QueryKey, TData> };
708
966
  };
709
967
 
710
968
  export type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<
@@ -712,6 +970,45 @@ export type GetOrganisationUnitUsersSuspenseQueryResult = NonNullable<
712
970
  >;
713
971
  export type GetOrganisationUnitUsersSuspenseQueryError = ErrorType<AsError | void>;
714
972
 
973
+ export function useGetOrganisationUnitUsersSuspense<
974
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
975
+ TError = ErrorType<AsError | void>,
976
+ >(
977
+ unitId: string,
978
+ options: {
979
+ query: Partial<
980
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
981
+ >;
982
+ request?: SecondParameter<typeof customFetch>;
983
+ },
984
+ queryClient?: QueryClient,
985
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
986
+ export function useGetOrganisationUnitUsersSuspense<
987
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
988
+ TError = ErrorType<AsError | void>,
989
+ >(
990
+ unitId: string,
991
+ options?: {
992
+ query?: Partial<
993
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
994
+ >;
995
+ request?: SecondParameter<typeof customFetch>;
996
+ },
997
+ queryClient?: QueryClient,
998
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
999
+ export function useGetOrganisationUnitUsersSuspense<
1000
+ TData = Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
1001
+ TError = ErrorType<AsError | void>,
1002
+ >(
1003
+ unitId: string,
1004
+ options?: {
1005
+ query?: Partial<
1006
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
1007
+ >;
1008
+ request?: SecondParameter<typeof customFetch>;
1009
+ },
1010
+ queryClient?: QueryClient,
1011
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> };
715
1012
  /**
716
1013
  * @summary Gets users in an Organisational Unit
717
1014
  */
@@ -722,19 +1019,19 @@ export function useGetOrganisationUnitUsersSuspense<
722
1019
  >(
723
1020
  unitId: string,
724
1021
  options?: {
725
- query?: UseSuspenseQueryOptions<
726
- Awaited<ReturnType<typeof getOrganisationUnitUsers>>,
727
- TError,
728
- TData
1022
+ query?: Partial<
1023
+ UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnitUsers>>, TError, TData>
729
1024
  >;
730
1025
  request?: SecondParameter<typeof customFetch>;
731
1026
  },
732
- ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
1027
+ queryClient?: QueryClient,
1028
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData> } {
733
1029
  const queryOptions = getGetOrganisationUnitUsersSuspenseQueryOptions(unitId, options);
734
1030
 
735
- const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & {
736
- queryKey: QueryKey;
737
- };
1031
+ const query = useSuspenseQuery(queryOptions, queryClient) as UseSuspenseQueryResult<
1032
+ TData,
1033
+ TError
1034
+ > & { queryKey: DataTag<QueryKey, TData> };
738
1035
 
739
1036
  query.queryKey = queryOptions.queryKey;
740
1037
 
@@ -831,18 +1128,18 @@ export type AddOrganisationUnitUserMutationError = ErrorType<AsError | void>;
831
1128
  /**
832
1129
  * @summary Adds a user to an Organisational Unit
833
1130
  */
834
- export const useAddOrganisationUnitUser = <
835
- TError = ErrorType<AsError | void>,
836
- TContext = unknown,
837
- >(options?: {
838
- mutation?: UseMutationOptions<
839
- Awaited<ReturnType<typeof addOrganisationUnitUser>>,
840
- TError,
841
- { unitId: string; userId: string },
842
- TContext
843
- >;
844
- request?: SecondParameter<typeof customFetch>;
845
- }): UseMutationResult<
1131
+ export const useAddOrganisationUnitUser = <TError = ErrorType<AsError | void>, TContext = unknown>(
1132
+ options?: {
1133
+ mutation?: UseMutationOptions<
1134
+ Awaited<ReturnType<typeof addOrganisationUnitUser>>,
1135
+ TError,
1136
+ { unitId: string; userId: string },
1137
+ TContext
1138
+ >;
1139
+ request?: SecondParameter<typeof customFetch>;
1140
+ },
1141
+ queryClient?: QueryClient,
1142
+ ): UseMutationResult<
846
1143
  Awaited<ReturnType<typeof addOrganisationUnitUser>>,
847
1144
  TError,
848
1145
  { unitId: string; userId: string },
@@ -850,7 +1147,7 @@ export const useAddOrganisationUnitUser = <
850
1147
  > => {
851
1148
  const mutationOptions = getAddOrganisationUnitUserMutationOptions(options);
852
1149
 
853
- return useMutation(mutationOptions);
1150
+ return useMutation(mutationOptions, queryClient);
854
1151
  };
855
1152
  /**
856
1153
  * Removes a User from an Organisational Unit.
@@ -945,15 +1242,18 @@ export type DeleteOrganisationUnitUserMutationError = ErrorType<AsError | void>;
945
1242
  export const useDeleteOrganisationUnitUser = <
946
1243
  TError = ErrorType<AsError | void>,
947
1244
  TContext = unknown,
948
- >(options?: {
949
- mutation?: UseMutationOptions<
950
- Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
951
- TError,
952
- { unitId: string; userId: string },
953
- TContext
954
- >;
955
- request?: SecondParameter<typeof customFetch>;
956
- }): UseMutationResult<
1245
+ >(
1246
+ options?: {
1247
+ mutation?: UseMutationOptions<
1248
+ Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
1249
+ TError,
1250
+ { unitId: string; userId: string },
1251
+ TContext
1252
+ >;
1253
+ request?: SecondParameter<typeof customFetch>;
1254
+ },
1255
+ queryClient?: QueryClient,
1256
+ ): UseMutationResult<
957
1257
  Awaited<ReturnType<typeof deleteOrganisationUnitUser>>,
958
1258
  TError,
959
1259
  { unitId: string; userId: string },
@@ -961,5 +1261,5 @@ export const useDeleteOrganisationUnitUser = <
961
1261
  > => {
962
1262
  const mutationOptions = getDeleteOrganisationUnitUserMutationOptions(options);
963
1263
 
964
- return useMutation(mutationOptions);
1264
+ return useMutation(mutationOptions, queryClient);
965
1265
  };