@squonk/account-server-client 0.1.24-rc.1 → 0.1.27-rc.1

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 (51) hide show
  1. package/{custom-instance-4a108741.d.ts → account-server-api.schemas-e6c5f956.d.ts} +15 -20
  2. package/{chunk-JR7F532L.js → chunk-GWBPVOL2.js} +2 -23
  3. package/chunk-GWBPVOL2.js.map +1 -0
  4. package/chunk-N3RLW53G.cjs +25 -0
  5. package/chunk-N3RLW53G.cjs.map +1 -0
  6. package/index.cjs +21 -5
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +20 -2
  9. package/index.js +21 -5
  10. package/index.js.map +1 -1
  11. package/organisation/organisation.cjs +31 -31
  12. package/organisation/organisation.cjs.map +1 -1
  13. package/organisation/organisation.d.ts +37 -28
  14. package/organisation/organisation.js +38 -38
  15. package/organisation/organisation.js.map +1 -1
  16. package/package.json +14 -14
  17. package/product/product.cjs +64 -61
  18. package/product/product.cjs.map +1 -1
  19. package/product/product.d.ts +70 -40
  20. package/product/product.js +75 -72
  21. package/product/product.js.map +1 -1
  22. package/service/service.cjs +23 -21
  23. package/service/service.cjs.map +1 -1
  24. package/service/service.d.ts +19 -15
  25. package/service/service.js +26 -24
  26. package/service/service.js.map +1 -1
  27. package/src/account-server-api.schemas.ts +14 -1
  28. package/src/organisation/organisation.ts +86 -83
  29. package/src/product/product.ts +210 -145
  30. package/src/service/service.ts +64 -56
  31. package/src/state/state.ts +31 -32
  32. package/src/unit/unit.ts +170 -149
  33. package/src/user/user.ts +171 -160
  34. package/state/state.cjs +12 -12
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +12 -10
  37. package/state/state.js +13 -13
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +54 -58
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +64 -49
  42. package/unit/unit.js +67 -71
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +56 -56
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +69 -55
  47. package/user/user.js +69 -69
  48. package/user/user.js.map +1 -1
  49. package/chunk-3DXYUDZH.cjs +0 -46
  50. package/chunk-3DXYUDZH.cjs.map +0 -1
  51. package/chunk-JR7F532L.js.map +0 -1
package/src/user/user.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.6.0 🍺
2
+ * Generated by orval v6.7.1 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,6 +8,7 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
+ import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
11
12
  import {
12
13
  useQuery,
13
14
  useMutation,
@@ -23,7 +24,6 @@ import type {
23
24
  AsError,
24
25
  UsersGetResponse,
25
26
  } from "../account-server-api.schemas";
26
- import { customInstance, ErrorType } from ".././custom-instance";
27
27
 
28
28
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
29
  type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
@@ -32,53 +32,48 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
32
32
  ? R
33
33
  : any;
34
34
 
35
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
- type SecondParameter<T extends (...args: any) => any> = T extends (
37
- config: any,
38
- args: infer P
39
- ) => any
40
- ? P
41
- : never;
42
-
43
35
  /**
44
36
  * Returns a summary of your account
45
37
 
46
38
  * @summary Get information about your account
47
39
  */
48
- export const getUserAccount = (
49
- options?: SecondParameter<typeof customInstance>
50
- ) => {
51
- return customInstance<UserAccountGetResponse>(
52
- { url: `/user/account`, method: "get" },
53
- options
54
- );
40
+ export const appApiUserGetAccount = (
41
+ options?: AxiosRequestConfig
42
+ ): Promise<AxiosResponse<UserAccountGetResponse>> => {
43
+ return axios.get(`/user/account`, options);
55
44
  };
56
45
 
57
- export const getGetUserAccountQueryKey = () => [`/user/account`];
46
+ export const getAppApiUserGetAccountQueryKey = () => [`/user/account`];
47
+
48
+ export type AppApiUserGetAccountQueryResult = NonNullable<
49
+ AsyncReturnType<typeof appApiUserGetAccount>
50
+ >;
51
+ export type AppApiUserGetAccountQueryError = AxiosError<void | AsError>;
58
52
 
59
- export const useGetUserAccount = <
60
- TData = AsyncReturnType<typeof getUserAccount>,
61
- TError = ErrorType<void | AsError>
53
+ export const useAppApiUserGetAccount = <
54
+ TData = AsyncReturnType<typeof appApiUserGetAccount>,
55
+ TError = AxiosError<void | AsError>
62
56
  >(options?: {
63
57
  query?: UseQueryOptions<
64
- AsyncReturnType<typeof getUserAccount>,
58
+ AsyncReturnType<typeof appApiUserGetAccount>,
65
59
  TError,
66
60
  TData
67
61
  >;
68
- request?: SecondParameter<typeof customInstance>;
62
+ axios?: AxiosRequestConfig;
69
63
  }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
70
- const { query: queryOptions, request: requestOptions } = options || {};
64
+ const { query: queryOptions, axios: axiosOptions } = options || {};
71
65
 
72
- const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();
66
+ const queryKey = queryOptions?.queryKey ?? getAppApiUserGetAccountQueryKey();
73
67
 
74
- const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>
75
- getUserAccount(requestOptions);
68
+ const queryFn: QueryFunction<
69
+ AsyncReturnType<typeof appApiUserGetAccount>
70
+ > = () => appApiUserGetAccount(axiosOptions);
76
71
 
77
- const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(
78
- queryKey,
79
- queryFn,
80
- queryOptions
81
- );
72
+ const query = useQuery<
73
+ AsyncReturnType<typeof appApiUserGetAccount>,
74
+ TError,
75
+ TData
76
+ >(queryKey, queryFn, queryOptions);
82
77
 
83
78
  return {
84
79
  queryKey,
@@ -91,48 +86,50 @@ export const useGetUserAccount = <
91
86
 
92
87
  * @summary Gets users in an organisation
93
88
  */
94
- export const getOrganisationUsers = (
95
- orgid: string,
96
- options?: SecondParameter<typeof customInstance>
97
- ) => {
98
- return customInstance<UsersGetResponse>(
99
- { url: `/organisation/${orgid}/user`, method: "get" },
100
- options
101
- );
89
+ export const appApiUserOrgGetUsers = (
90
+ orgId: string,
91
+ options?: AxiosRequestConfig
92
+ ): Promise<AxiosResponse<UsersGetResponse>> => {
93
+ return axios.get(`/organisation/${orgId}/user`, options);
102
94
  };
103
95
 
104
- export const getGetOrganisationUsersQueryKey = (orgid: string) => [
105
- `/organisation/${orgid}/user`,
96
+ export const getAppApiUserOrgGetUsersQueryKey = (orgId: string) => [
97
+ `/organisation/${orgId}/user`,
106
98
  ];
107
99
 
108
- export const useGetOrganisationUsers = <
109
- TData = AsyncReturnType<typeof getOrganisationUsers>,
110
- TError = ErrorType<AsError | void>
100
+ export type AppApiUserOrgGetUsersQueryResult = NonNullable<
101
+ AsyncReturnType<typeof appApiUserOrgGetUsers>
102
+ >;
103
+ export type AppApiUserOrgGetUsersQueryError = AxiosError<AsError | void>;
104
+
105
+ export const useAppApiUserOrgGetUsers = <
106
+ TData = AsyncReturnType<typeof appApiUserOrgGetUsers>,
107
+ TError = AxiosError<AsError | void>
111
108
  >(
112
- orgid: string,
109
+ orgId: string,
113
110
  options?: {
114
111
  query?: UseQueryOptions<
115
- AsyncReturnType<typeof getOrganisationUsers>,
112
+ AsyncReturnType<typeof appApiUserOrgGetUsers>,
116
113
  TError,
117
114
  TData
118
115
  >;
119
- request?: SecondParameter<typeof customInstance>;
116
+ axios?: AxiosRequestConfig;
120
117
  }
121
118
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
122
- const { query: queryOptions, request: requestOptions } = options || {};
119
+ const { query: queryOptions, axios: axiosOptions } = options || {};
123
120
 
124
121
  const queryKey =
125
- queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgid);
122
+ queryOptions?.queryKey ?? getAppApiUserOrgGetUsersQueryKey(orgId);
126
123
 
127
124
  const queryFn: QueryFunction<
128
- AsyncReturnType<typeof getOrganisationUsers>
129
- > = () => getOrganisationUsers(orgid, requestOptions);
125
+ AsyncReturnType<typeof appApiUserOrgGetUsers>
126
+ > = () => appApiUserOrgGetUsers(orgId, axiosOptions);
130
127
 
131
128
  const query = useQuery<
132
- AsyncReturnType<typeof getOrganisationUsers>,
129
+ AsyncReturnType<typeof appApiUserOrgGetUsers>,
133
130
  TError,
134
131
  TData
135
- >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });
132
+ >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions });
136
133
 
137
134
  return {
138
135
  queryKey,
@@ -145,44 +142,47 @@ export const useGetOrganisationUsers = <
145
142
 
146
143
  * @summary Adds a user to an organisation
147
144
  */
148
- export const addOrganisationUser = (
149
- orgid: string,
150
- userid: string,
151
- options?: SecondParameter<typeof customInstance>
152
- ) => {
153
- return customInstance<void>(
154
- { url: `/organisation/${orgid}/user/${userid}`, method: "put" },
155
- options
156
- );
145
+ export const appApiUserOrgUserPut = (
146
+ orgId: string,
147
+ userId: string,
148
+ options?: AxiosRequestConfig
149
+ ): Promise<AxiosResponse<void>> => {
150
+ return axios.put(`/organisation/${orgId}/user/${userId}`, undefined, options);
157
151
  };
158
152
 
159
- export const useAddOrganisationUser = <
160
- TError = ErrorType<AsError>,
153
+ export type AppApiUserOrgUserPutMutationResult = NonNullable<
154
+ AsyncReturnType<typeof appApiUserOrgUserPut>
155
+ >;
156
+
157
+ export type AppApiUserOrgUserPutMutationError = AxiosError<AsError>;
158
+
159
+ export const useAppApiUserOrgUserPut = <
160
+ TError = AxiosError<AsError>,
161
161
  TContext = unknown
162
162
  >(options?: {
163
163
  mutation?: UseMutationOptions<
164
- AsyncReturnType<typeof addOrganisationUser>,
164
+ AsyncReturnType<typeof appApiUserOrgUserPut>,
165
165
  TError,
166
- { orgid: string; userid: string },
166
+ { orgId: string; userId: string },
167
167
  TContext
168
168
  >;
169
- request?: SecondParameter<typeof customInstance>;
169
+ axios?: AxiosRequestConfig;
170
170
  }) => {
171
- const { mutation: mutationOptions, request: requestOptions } = options || {};
171
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
172
172
 
173
173
  const mutationFn: MutationFunction<
174
- AsyncReturnType<typeof addOrganisationUser>,
175
- { orgid: string; userid: string }
174
+ AsyncReturnType<typeof appApiUserOrgUserPut>,
175
+ { orgId: string; userId: string }
176
176
  > = (props) => {
177
- const { orgid, userid } = props || {};
177
+ const { orgId, userId } = props || {};
178
178
 
179
- return addOrganisationUser(orgid, userid, requestOptions);
179
+ return appApiUserOrgUserPut(orgId, userId, axiosOptions);
180
180
  };
181
181
 
182
182
  return useMutation<
183
- AsyncReturnType<typeof addOrganisationUser>,
183
+ AsyncReturnType<typeof appApiUserOrgUserPut>,
184
184
  TError,
185
- { orgid: string; userid: string },
185
+ { orgId: string; userId: string },
186
186
  TContext
187
187
  >(mutationFn, mutationOptions);
188
188
  };
@@ -191,44 +191,47 @@ export const useAddOrganisationUser = <
191
191
 
192
192
  * @summary Deletes a user from an organisation
193
193
  */
194
- export const deleteOrganisationUser = (
195
- orgid: string,
196
- userid: string,
197
- options?: SecondParameter<typeof customInstance>
198
- ) => {
199
- return customInstance<void>(
200
- { url: `/organisation/${orgid}/user/${userid}`, method: "delete" },
201
- options
202
- );
194
+ export const appApiUserOrgUserDelete = (
195
+ orgId: string,
196
+ userId: string,
197
+ options?: AxiosRequestConfig
198
+ ): Promise<AxiosResponse<void>> => {
199
+ return axios.delete(`/organisation/${orgId}/user/${userId}`, options);
203
200
  };
204
201
 
205
- export const useDeleteOrganisationUser = <
206
- TError = ErrorType<AsError>,
202
+ export type AppApiUserOrgUserDeleteMutationResult = NonNullable<
203
+ AsyncReturnType<typeof appApiUserOrgUserDelete>
204
+ >;
205
+
206
+ export type AppApiUserOrgUserDeleteMutationError = AxiosError<AsError>;
207
+
208
+ export const useAppApiUserOrgUserDelete = <
209
+ TError = AxiosError<AsError>,
207
210
  TContext = unknown
208
211
  >(options?: {
209
212
  mutation?: UseMutationOptions<
210
- AsyncReturnType<typeof deleteOrganisationUser>,
213
+ AsyncReturnType<typeof appApiUserOrgUserDelete>,
211
214
  TError,
212
- { orgid: string; userid: string },
215
+ { orgId: string; userId: string },
213
216
  TContext
214
217
  >;
215
- request?: SecondParameter<typeof customInstance>;
218
+ axios?: AxiosRequestConfig;
216
219
  }) => {
217
- const { mutation: mutationOptions, request: requestOptions } = options || {};
220
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
218
221
 
219
222
  const mutationFn: MutationFunction<
220
- AsyncReturnType<typeof deleteOrganisationUser>,
221
- { orgid: string; userid: string }
223
+ AsyncReturnType<typeof appApiUserOrgUserDelete>,
224
+ { orgId: string; userId: string }
222
225
  > = (props) => {
223
- const { orgid, userid } = props || {};
226
+ const { orgId, userId } = props || {};
224
227
 
225
- return deleteOrganisationUser(orgid, userid, requestOptions);
228
+ return appApiUserOrgUserDelete(orgId, userId, axiosOptions);
226
229
  };
227
230
 
228
231
  return useMutation<
229
- AsyncReturnType<typeof deleteOrganisationUser>,
232
+ AsyncReturnType<typeof appApiUserOrgUserDelete>,
230
233
  TError,
231
- { orgid: string; userid: string },
234
+ { orgId: string; userId: string },
232
235
  TContext
233
236
  >(mutationFn, mutationOptions);
234
237
  };
@@ -237,48 +240,50 @@ export const useDeleteOrganisationUser = <
237
240
 
238
241
  * @summary Gets users in an Organisational Unit
239
242
  */
240
- export const getOrganisationUnitUsers = (
241
- unitid: string,
242
- options?: SecondParameter<typeof customInstance>
243
- ) => {
244
- return customInstance<UsersGetResponse>(
245
- { url: `/unit/${unitid}/user`, method: "get" },
246
- options
247
- );
243
+ export const appApiUserGetUnitUsers = (
244
+ unitId: string,
245
+ options?: AxiosRequestConfig
246
+ ): Promise<AxiosResponse<UsersGetResponse>> => {
247
+ return axios.get(`/unit/${unitId}/user`, options);
248
248
  };
249
249
 
250
- export const getGetOrganisationUnitUsersQueryKey = (unitid: string) => [
251
- `/unit/${unitid}/user`,
250
+ export const getAppApiUserGetUnitUsersQueryKey = (unitId: string) => [
251
+ `/unit/${unitId}/user`,
252
252
  ];
253
253
 
254
- export const useGetOrganisationUnitUsers = <
255
- TData = AsyncReturnType<typeof getOrganisationUnitUsers>,
256
- TError = ErrorType<AsError | void>
254
+ export type AppApiUserGetUnitUsersQueryResult = NonNullable<
255
+ AsyncReturnType<typeof appApiUserGetUnitUsers>
256
+ >;
257
+ export type AppApiUserGetUnitUsersQueryError = AxiosError<AsError | void>;
258
+
259
+ export const useAppApiUserGetUnitUsers = <
260
+ TData = AsyncReturnType<typeof appApiUserGetUnitUsers>,
261
+ TError = AxiosError<AsError | void>
257
262
  >(
258
- unitid: string,
263
+ unitId: string,
259
264
  options?: {
260
265
  query?: UseQueryOptions<
261
- AsyncReturnType<typeof getOrganisationUnitUsers>,
266
+ AsyncReturnType<typeof appApiUserGetUnitUsers>,
262
267
  TError,
263
268
  TData
264
269
  >;
265
- request?: SecondParameter<typeof customInstance>;
270
+ axios?: AxiosRequestConfig;
266
271
  }
267
272
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
268
- const { query: queryOptions, request: requestOptions } = options || {};
273
+ const { query: queryOptions, axios: axiosOptions } = options || {};
269
274
 
270
275
  const queryKey =
271
- queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitid);
276
+ queryOptions?.queryKey ?? getAppApiUserGetUnitUsersQueryKey(unitId);
272
277
 
273
278
  const queryFn: QueryFunction<
274
- AsyncReturnType<typeof getOrganisationUnitUsers>
275
- > = () => getOrganisationUnitUsers(unitid, requestOptions);
279
+ AsyncReturnType<typeof appApiUserGetUnitUsers>
280
+ > = () => appApiUserGetUnitUsers(unitId, axiosOptions);
276
281
 
277
282
  const query = useQuery<
278
- AsyncReturnType<typeof getOrganisationUnitUsers>,
283
+ AsyncReturnType<typeof appApiUserGetUnitUsers>,
279
284
  TError,
280
285
  TData
281
- >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });
286
+ >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });
282
287
 
283
288
  return {
284
289
  queryKey,
@@ -295,44 +300,47 @@ You have to be in the Organisation or Unit or an Admin user to use this endpoint
295
300
 
296
301
  * @summary Adds a user to an Organisational Unit
297
302
  */
298
- export const addOrganisationUnitUser = (
299
- unitid: string,
300
- userid: string,
301
- options?: SecondParameter<typeof customInstance>
302
- ) => {
303
- return customInstance<void>(
304
- { url: `/unit/${unitid}/user/${userid}`, method: "put" },
305
- options
306
- );
303
+ export const appApiUserUnitUserPut = (
304
+ unitId: string,
305
+ userId: string,
306
+ options?: AxiosRequestConfig
307
+ ): Promise<AxiosResponse<void>> => {
308
+ return axios.put(`/unit/${unitId}/user/${userId}`, undefined, options);
307
309
  };
308
310
 
309
- export const useAddOrganisationUnitUser = <
310
- TError = ErrorType<AsError>,
311
+ export type AppApiUserUnitUserPutMutationResult = NonNullable<
312
+ AsyncReturnType<typeof appApiUserUnitUserPut>
313
+ >;
314
+
315
+ export type AppApiUserUnitUserPutMutationError = AxiosError<AsError>;
316
+
317
+ export const useAppApiUserUnitUserPut = <
318
+ TError = AxiosError<AsError>,
311
319
  TContext = unknown
312
320
  >(options?: {
313
321
  mutation?: UseMutationOptions<
314
- AsyncReturnType<typeof addOrganisationUnitUser>,
322
+ AsyncReturnType<typeof appApiUserUnitUserPut>,
315
323
  TError,
316
- { unitid: string; userid: string },
324
+ { unitId: string; userId: string },
317
325
  TContext
318
326
  >;
319
- request?: SecondParameter<typeof customInstance>;
327
+ axios?: AxiosRequestConfig;
320
328
  }) => {
321
- const { mutation: mutationOptions, request: requestOptions } = options || {};
329
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
322
330
 
323
331
  const mutationFn: MutationFunction<
324
- AsyncReturnType<typeof addOrganisationUnitUser>,
325
- { unitid: string; userid: string }
332
+ AsyncReturnType<typeof appApiUserUnitUserPut>,
333
+ { unitId: string; userId: string }
326
334
  > = (props) => {
327
- const { unitid, userid } = props || {};
335
+ const { unitId, userId } = props || {};
328
336
 
329
- return addOrganisationUnitUser(unitid, userid, requestOptions);
337
+ return appApiUserUnitUserPut(unitId, userId, axiosOptions);
330
338
  };
331
339
 
332
340
  return useMutation<
333
- AsyncReturnType<typeof addOrganisationUnitUser>,
341
+ AsyncReturnType<typeof appApiUserUnitUserPut>,
334
342
  TError,
335
- { unitid: string; userid: string },
343
+ { unitId: string; userId: string },
336
344
  TContext
337
345
  >(mutationFn, mutationOptions);
338
346
  };
@@ -345,44 +353,47 @@ You have to be in the Organisation or Unit or an Admin user to use this endpoint
345
353
 
346
354
  * @summary Deletes a user from an Organisational Unit
347
355
  */
348
- export const deleteOrganisationUnitUser = (
349
- unitid: string,
350
- userid: string,
351
- options?: SecondParameter<typeof customInstance>
352
- ) => {
353
- return customInstance<void>(
354
- { url: `/unit/${unitid}/user/${userid}`, method: "delete" },
355
- options
356
- );
356
+ export const appApiUserUnitUserDelete = (
357
+ unitId: string,
358
+ userId: string,
359
+ options?: AxiosRequestConfig
360
+ ): Promise<AxiosResponse<void>> => {
361
+ return axios.delete(`/unit/${unitId}/user/${userId}`, options);
357
362
  };
358
363
 
359
- export const useDeleteOrganisationUnitUser = <
360
- TError = ErrorType<AsError>,
364
+ export type AppApiUserUnitUserDeleteMutationResult = NonNullable<
365
+ AsyncReturnType<typeof appApiUserUnitUserDelete>
366
+ >;
367
+
368
+ export type AppApiUserUnitUserDeleteMutationError = AxiosError<AsError>;
369
+
370
+ export const useAppApiUserUnitUserDelete = <
371
+ TError = AxiosError<AsError>,
361
372
  TContext = unknown
362
373
  >(options?: {
363
374
  mutation?: UseMutationOptions<
364
- AsyncReturnType<typeof deleteOrganisationUnitUser>,
375
+ AsyncReturnType<typeof appApiUserUnitUserDelete>,
365
376
  TError,
366
- { unitid: string; userid: string },
377
+ { unitId: string; userId: string },
367
378
  TContext
368
379
  >;
369
- request?: SecondParameter<typeof customInstance>;
380
+ axios?: AxiosRequestConfig;
370
381
  }) => {
371
- const { mutation: mutationOptions, request: requestOptions } = options || {};
382
+ const { mutation: mutationOptions, axios: axiosOptions } = options || {};
372
383
 
373
384
  const mutationFn: MutationFunction<
374
- AsyncReturnType<typeof deleteOrganisationUnitUser>,
375
- { unitid: string; userid: string }
385
+ AsyncReturnType<typeof appApiUserUnitUserDelete>,
386
+ { unitId: string; userId: string }
376
387
  > = (props) => {
377
- const { unitid, userid } = props || {};
388
+ const { unitId, userId } = props || {};
378
389
 
379
- return deleteOrganisationUnitUser(unitid, userid, requestOptions);
390
+ return appApiUserUnitUserDelete(unitId, userId, axiosOptions);
380
391
  };
381
392
 
382
393
  return useMutation<
383
- AsyncReturnType<typeof deleteOrganisationUnitUser>,
394
+ AsyncReturnType<typeof appApiUserUnitUserDelete>,
384
395
  TError,
385
- { unitid: string; userid: string },
396
+ { unitId: string; userId: string },
386
397
  TContext
387
398
  >(mutationFn, mutationOptions);
388
399
  };
package/state/state.cjs CHANGED
@@ -1,22 +1,22 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
-
4
- var _chunk3DXYUDZHcjs = require('../chunk-3DXYUDZH.cjs');
3
+ var _chunkN3RLW53Gcjs = require('../chunk-N3RLW53G.cjs');
5
4
 
6
5
  // src/state/state.ts
6
+ var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
7
7
 
8
8
 
9
9
  var _reactquery = require('react-query');
10
- var getVersion = (options) => {
11
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/version`, method: "get" }, options);
10
+ var appApiStateGetVersion = (options) => {
11
+ return _axios2.default.get(`/version`, options);
12
12
  };
13
- var getGetVersionQueryKey = () => [`/version`];
14
- var useGetVersion = (options) => {
15
- const { query: queryOptions, request: requestOptions } = options || {};
16
- const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getGetVersionQueryKey()));
17
- const queryFn = () => getVersion(requestOptions);
13
+ var getAppApiStateGetVersionQueryKey = () => [`/version`];
14
+ var useAppApiStateGetVersion = (options) => {
15
+ const { query: queryOptions, axios: axiosOptions } = options || {};
16
+ const queryKey = _nullishCoalesce((queryOptions == null ? void 0 : queryOptions.queryKey), () => ( getAppApiStateGetVersionQueryKey()));
17
+ const queryFn = () => appApiStateGetVersion(axiosOptions);
18
18
  const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
19
- return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
19
+ return _chunkN3RLW53Gcjs.__spreadValues.call(void 0, {
20
20
  queryKey
21
21
  }, query);
22
22
  };
@@ -24,5 +24,5 @@ var useGetVersion = (options) => {
24
24
 
25
25
 
26
26
 
27
- exports.getGetVersionQueryKey = getGetVersionQueryKey; exports.getVersion = getVersion; exports.useGetVersion = useGetVersion;
27
+ exports.appApiStateGetVersion = appApiStateGetVersion; exports.getAppApiStateGetVersionQueryKey = getAppApiStateGetVersionQueryKey; exports.useAppApiStateGetVersion = useAppApiStateGetVersion;
28
28
  //# sourceMappingURL=state.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/state/state.ts"],"names":[],"mappings":";;;;;;AAUA;AAAA;AAAA;AA+BO,IAAM,aAAa,CACxB,YACG;AACH,SAAO,eACL,EAAE,KAAK,YAAY,QAAQ,SAC3B;AAAA;AAIG,IAAM,wBAAwB,MAAM,CAAC;AAErC,IAAM,gBAAgB,CAG3B,YAG4D;AAC5D,QAAM,EAAE,OAAO,cAAc,SAAS,mBAAmB,WAAW;AAEpE,QAAM,WAAW,8CAAc,aAAY;AAE3C,QAAM,UAA6D,MACjE,WAAW;AAEb,QAAM,QAAQ,SACZ,UACA,SACA;AAGF,SAAO;AAAA,IACL;AAAA,KACG;AAAA","sourcesContent":["/**\n * Generated by orval v6.6.0 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n StateGetVersionResponse,\n AsError,\n} from \"../account-server-api.schemas\";\nimport { customInstance, ErrorType } from \".././custom-instance\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype SecondParameter<T extends (...args: any) => any> = T extends (\n config: any,\n args: infer P\n) => any\n ? P\n : never;\n\n/**\n * @summary Gets the Account Server version\n */\nexport const getVersion = (\n options?: SecondParameter<typeof customInstance>\n) => {\n return customInstance<StateGetVersionResponse>(\n { url: `/version`, method: \"get\" },\n options\n );\n};\n\nexport const getGetVersionQueryKey = () => [`/version`];\n\nexport const useGetVersion = <\n TData = AsyncReturnType<typeof getVersion>,\n TError = ErrorType<AsError | void>\n>(options?: {\n query?: UseQueryOptions<AsyncReturnType<typeof getVersion>, TError, TData>;\n request?: SecondParameter<typeof customInstance>;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, request: requestOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();\n\n const queryFn: QueryFunction<AsyncReturnType<typeof getVersion>> = () =>\n getVersion(requestOptions);\n\n const query = useQuery<AsyncReturnType<typeof getVersion>, TError, TData>(\n queryKey,\n queryFn,\n queryOptions\n );\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
1
+ {"version":3,"sources":["../../src/state/state.ts"],"names":[],"mappings":";;;;;AAUA;AACA;AAAA;AAAA;AAsBO,IAAM,wBAAwB,CACnC,YACoD;AACpD,SAAO,MAAM,IAAI,YAAY,OAAO;AACtC;AAEO,IAAM,mCAAmC,MAAM,CAAC,UAAU;AAO1D,IAAM,2BAA2B,CAGtC,YAO4D;AAC5D,QAAM,EAAE,OAAO,cAAc,OAAO,iBAAiB,WAAW,CAAC;AAEjE,QAAM,WAAW,8CAAc,aAAY,iCAAiC;AAE5E,QAAM,UAEF,MAAM,sBAAsB,YAAY;AAE5C,QAAM,QAAQ,SAIZ,UAAU,SAAS,YAAY;AAEjC,SAAO;AAAA,IACL;AAAA,KACG;AAEP","sourcesContent":["/**\n * Generated by orval v6.7.1 🍺\n * Do not edit manually.\n * Account Server API\n * The Informatics Matters Account Server API.\n\nA service that provides access to the Account Server, which gives *registered* users access to and management of **Products**, **Organisations**, **Units** and **Users**.\n\n * OpenAPI spec version: 0.1\n */\nimport axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from \"axios\";\nimport {\n useQuery,\n UseQueryOptions,\n QueryFunction,\n UseQueryResult,\n QueryKey,\n} from \"react-query\";\nimport type {\n StateGetVersionResponse,\n AsError,\n} from \"../account-server-api.schemas\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (\n ...args: any\n) => Promise<infer R>\n ? R\n : any;\n\n/**\n * @summary Gets the Account Server version\n */\nexport const appApiStateGetVersion = (\n options?: AxiosRequestConfig\n): Promise<AxiosResponse<StateGetVersionResponse>> => {\n return axios.get(`/version`, options);\n};\n\nexport const getAppApiStateGetVersionQueryKey = () => [`/version`];\n\nexport type AppApiStateGetVersionQueryResult = NonNullable<\n AsyncReturnType<typeof appApiStateGetVersion>\n>;\nexport type AppApiStateGetVersionQueryError = AxiosError<AsError | void>;\n\nexport const useAppApiStateGetVersion = <\n TData = AsyncReturnType<typeof appApiStateGetVersion>,\n TError = AxiosError<AsError | void>\n>(options?: {\n query?: UseQueryOptions<\n AsyncReturnType<typeof appApiStateGetVersion>,\n TError,\n TData\n >;\n axios?: AxiosRequestConfig;\n}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {\n const { query: queryOptions, axios: axiosOptions } = options || {};\n\n const queryKey = queryOptions?.queryKey ?? getAppApiStateGetVersionQueryKey();\n\n const queryFn: QueryFunction<\n AsyncReturnType<typeof appApiStateGetVersion>\n > = () => appApiStateGetVersion(axiosOptions);\n\n const query = useQuery<\n AsyncReturnType<typeof appApiStateGetVersion>,\n TError,\n TData\n >(queryKey, queryFn, queryOptions);\n\n return {\n queryKey,\n ...query,\n };\n};\n"]}
package/state/state.d.ts CHANGED
@@ -1,9 +1,9 @@
1
+ import { AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
1
2
  import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
2
- import { V as customInstance, M as StateGetVersionResponse, W as ErrorType, N as AsError } from '../custom-instance-4a108741';
3
- import 'axios';
3
+ import { M as StateGetVersionResponse, N as AsError } from '../account-server-api.schemas-e6c5f956.js';
4
4
 
5
5
  /**
6
- * Generated by orval v6.6.0 🍺
6
+ * Generated by orval v6.7.1 🍺
7
7
  * Do not edit manually.
8
8
  * Account Server API
9
9
  * The Informatics Matters Account Server API.
@@ -13,17 +13,19 @@ A service that provides access to the Account Server, which gives *registered* u
13
13
  * OpenAPI spec version: 0.1
14
14
  */
15
15
 
16
- declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
16
+ declare type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (...args: any) => Promise<infer R> ? R : any;
17
17
  /**
18
18
  * @summary Gets the Account Server version
19
19
  */
20
- declare const getVersion: (options?: SecondParameter<typeof customInstance>) => Promise<StateGetVersionResponse>;
21
- declare const getGetVersionQueryKey: () => string[];
22
- declare const useGetVersion: <TData = StateGetVersionResponse, TError = ErrorType<void | AsError>>(options?: {
23
- query?: UseQueryOptions<StateGetVersionResponse, TError, TData, QueryKey> | undefined;
24
- request?: SecondParameter<typeof customInstance>;
20
+ declare const appApiStateGetVersion: (options?: AxiosRequestConfig<any> | undefined) => Promise<AxiosResponse<StateGetVersionResponse>>;
21
+ declare const getAppApiStateGetVersionQueryKey: () => string[];
22
+ declare type AppApiStateGetVersionQueryResult = NonNullable<AsyncReturnType<typeof appApiStateGetVersion>>;
23
+ declare type AppApiStateGetVersionQueryError = AxiosError<AsError | void>;
24
+ declare const useAppApiStateGetVersion: <TData = AxiosResponse<StateGetVersionResponse, any>, TError = AxiosError<void | AsError, any>>(options?: {
25
+ query?: UseQueryOptions<AxiosResponse<StateGetVersionResponse, any>, TError, TData, QueryKey> | undefined;
26
+ axios?: AxiosRequestConfig<any> | undefined;
25
27
  } | undefined) => UseQueryResult<TData, TError> & {
26
28
  queryKey: QueryKey;
27
29
  };
28
30
 
29
- export { getGetVersionQueryKey, getVersion, useGetVersion };
31
+ export { AppApiStateGetVersionQueryError, AppApiStateGetVersionQueryResult, appApiStateGetVersion, getAppApiStateGetVersionQueryKey, useAppApiStateGetVersion };