@squonk/account-server-client 0.1.23-rc.2 → 0.1.26-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-86dd5ce6.d.ts → account-server-api.schemas-078442c3.d.ts} +4 -22
  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 +20 -65
  12. package/organisation/organisation.cjs.map +1 -1
  13. package/organisation/organisation.d.ts +18 -58
  14. package/organisation/organisation.js +20 -65
  15. package/organisation/organisation.js.map +1 -1
  16. package/package.json +14 -14
  17. package/product/product.cjs +32 -107
  18. package/product/product.cjs.map +1 -1
  19. package/product/product.d.ts +24 -84
  20. package/product/product.js +32 -107
  21. package/product/product.js.map +1 -1
  22. package/service/service.cjs +11 -38
  23. package/service/service.cjs.map +1 -1
  24. package/service/service.d.ts +9 -31
  25. package/service/service.js +11 -38
  26. package/service/service.js.map +1 -1
  27. package/src/account-server-api.schemas.ts +3 -3
  28. package/src/organisation/organisation.ts +43 -191
  29. package/src/product/product.ts +87 -294
  30. package/src/service/service.ts +17 -101
  31. package/src/state/state.ts +17 -66
  32. package/src/unit/unit.ts +71 -315
  33. package/src/user/user.ts +68 -330
  34. package/state/state.cjs +8 -22
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +7 -16
  37. package/state/state.js +8 -22
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +30 -109
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +25 -92
  42. package/unit/unit.js +30 -109
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +30 -107
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +20 -118
  47. package/user/user.js +30 -107
  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,285 +8,74 @@ 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 {
12
- useQuery,
13
- useMutation,
14
- UseQueryOptions,
15
- UseMutationOptions,
16
- QueryFunction,
17
- MutationFunction,
18
- UseQueryResult,
19
- QueryKey,
20
- } from "react-query";
11
+ import axios, { AxiosRequestConfig, AxiosResponse } from "axios";
21
12
  import type {
22
13
  UserAccountGetResponse,
23
- AsError,
24
14
  UsersGetResponse,
25
15
  } from "../account-server-api.schemas";
26
- import { customInstance, ErrorType } from ".././custom-instance";
27
16
 
28
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
- type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
30
- ...args: any
31
- ) => Promise<infer R>
32
- ? R
33
- : any;
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
- /**
17
+ export const getUser = () => {
18
+ /**
44
19
  * Returns a summary of your account
45
20
 
46
21
  * @summary Get information about your account
47
22
  */
48
- export const getUserAccount = (
49
- options?: SecondParameter<typeof customInstance>
50
- ) => {
51
- return customInstance<UserAccountGetResponse>(
52
- { url: `/user/account`, method: "get" },
53
- options
54
- );
55
- };
56
-
57
- export const getGetUserAccountQueryKey = () => [`/user/account`];
58
-
59
- export const useGetUserAccount = <
60
- TData = AsyncReturnType<typeof getUserAccount>,
61
- TError = ErrorType<void | AsError>
62
- >(options?: {
63
- query?: UseQueryOptions<
64
- AsyncReturnType<typeof getUserAccount>,
65
- TError,
66
- TData
67
- >;
68
- request?: SecondParameter<typeof customInstance>;
69
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
70
- const { query: queryOptions, request: requestOptions } = options || {};
71
-
72
- const queryKey = queryOptions?.queryKey ?? getGetUserAccountQueryKey();
73
-
74
- const queryFn: QueryFunction<AsyncReturnType<typeof getUserAccount>> = () =>
75
- getUserAccount(requestOptions);
76
-
77
- const query = useQuery<AsyncReturnType<typeof getUserAccount>, TError, TData>(
78
- queryKey,
79
- queryFn,
80
- queryOptions
81
- );
82
-
83
- return {
84
- queryKey,
85
- ...query,
23
+ const appApiUserGetAccount = <TData = AxiosResponse<UserAccountGetResponse>>(
24
+ options?: AxiosRequestConfig
25
+ ): Promise<TData> => {
26
+ return axios.get(`/user/account`, options);
86
27
  };
87
- };
88
-
89
- /**
28
+ /**
90
29
  * Gets users in an Organisation. You have to be in the Organisation or an Admin user to use this endpoint
91
30
 
92
31
  * @summary Gets users in an organisation
93
32
  */
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
- );
102
- };
103
-
104
- export const getGetOrganisationUsersQueryKey = (orgid: string) => [
105
- `/organisation/${orgid}/user`,
106
- ];
107
-
108
- export const useGetOrganisationUsers = <
109
- TData = AsyncReturnType<typeof getOrganisationUsers>,
110
- TError = ErrorType<AsError | void>
111
- >(
112
- orgid: string,
113
- options?: {
114
- query?: UseQueryOptions<
115
- AsyncReturnType<typeof getOrganisationUsers>,
116
- TError,
117
- TData
118
- >;
119
- request?: SecondParameter<typeof customInstance>;
120
- }
121
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
122
- const { query: queryOptions, request: requestOptions } = options || {};
123
-
124
- const queryKey =
125
- queryOptions?.queryKey ?? getGetOrganisationUsersQueryKey(orgid);
126
-
127
- const queryFn: QueryFunction<
128
- AsyncReturnType<typeof getOrganisationUsers>
129
- > = () => getOrganisationUsers(orgid, requestOptions);
130
-
131
- const query = useQuery<
132
- AsyncReturnType<typeof getOrganisationUsers>,
133
- TError,
134
- TData
135
- >(queryKey, queryFn, { enabled: !!orgid, ...queryOptions });
136
-
137
- return {
138
- queryKey,
139
- ...query,
33
+ const appApiUserOrgGetUsers = <TData = AxiosResponse<UsersGetResponse>>(
34
+ orgId: string,
35
+ options?: AxiosRequestConfig
36
+ ): Promise<TData> => {
37
+ return axios.get(`/organisation/${orgId}/user`, options);
140
38
  };
141
- };
142
-
143
- /**
39
+ /**
144
40
  * Adds a user to an organisation. You have to be in the Organisation or an Admin user to use this endpoint
145
41
 
146
42
  * @summary Adds a user to an organisation
147
43
  */
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
- );
157
- };
158
-
159
- export const useAddOrganisationUser = <
160
- TError = ErrorType<AsError>,
161
- TContext = unknown
162
- >(options?: {
163
- mutation?: UseMutationOptions<
164
- AsyncReturnType<typeof addOrganisationUser>,
165
- TError,
166
- { orgid: string; userid: string },
167
- TContext
168
- >;
169
- request?: SecondParameter<typeof customInstance>;
170
- }) => {
171
- const { mutation: mutationOptions, request: requestOptions } = options || {};
172
-
173
- const mutationFn: MutationFunction<
174
- AsyncReturnType<typeof addOrganisationUser>,
175
- { orgid: string; userid: string }
176
- > = (props) => {
177
- const { orgid, userid } = props || {};
178
-
179
- return addOrganisationUser(orgid, userid, requestOptions);
44
+ const appApiUserOrgUserPut = <TData = AxiosResponse<void>>(
45
+ orgId: string,
46
+ userId: string,
47
+ options?: AxiosRequestConfig
48
+ ): Promise<TData> => {
49
+ return axios.put(
50
+ `/organisation/${orgId}/user/${userId}`,
51
+ undefined,
52
+ options
53
+ );
180
54
  };
181
-
182
- return useMutation<
183
- AsyncReturnType<typeof addOrganisationUser>,
184
- TError,
185
- { orgid: string; userid: string },
186
- TContext
187
- >(mutationFn, mutationOptions);
188
- };
189
- /**
55
+ /**
190
56
  * Removes a user from an organisation. You have to be in the Organisation or an Admin user to use this endpoint
191
57
 
192
58
  * @summary Deletes a user from an organisation
193
59
  */
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
- );
203
- };
204
-
205
- export const useDeleteOrganisationUser = <
206
- TError = ErrorType<AsError>,
207
- TContext = unknown
208
- >(options?: {
209
- mutation?: UseMutationOptions<
210
- AsyncReturnType<typeof deleteOrganisationUser>,
211
- TError,
212
- { orgid: string; userid: string },
213
- TContext
214
- >;
215
- request?: SecondParameter<typeof customInstance>;
216
- }) => {
217
- const { mutation: mutationOptions, request: requestOptions } = options || {};
218
-
219
- const mutationFn: MutationFunction<
220
- AsyncReturnType<typeof deleteOrganisationUser>,
221
- { orgid: string; userid: string }
222
- > = (props) => {
223
- const { orgid, userid } = props || {};
224
-
225
- return deleteOrganisationUser(orgid, userid, requestOptions);
60
+ const appApiUserOrgUserDelete = <TData = AxiosResponse<void>>(
61
+ orgId: string,
62
+ userId: string,
63
+ options?: AxiosRequestConfig
64
+ ): Promise<TData> => {
65
+ return axios.delete(`/organisation/${orgId}/user/${userId}`, options);
226
66
  };
227
-
228
- return useMutation<
229
- AsyncReturnType<typeof deleteOrganisationUser>,
230
- TError,
231
- { orgid: string; userid: string },
232
- TContext
233
- >(mutationFn, mutationOptions);
234
- };
235
- /**
67
+ /**
236
68
  * Gets users in an Organisational Unit. You have to be in the Organisation or Unit or an Admin user to use this endpoint
237
69
 
238
70
  * @summary Gets users in an Organisational Unit
239
71
  */
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
- );
248
- };
249
-
250
- export const getGetOrganisationUnitUsersQueryKey = (unitid: string) => [
251
- `/unit/${unitid}/user`,
252
- ];
253
-
254
- export const useGetOrganisationUnitUsers = <
255
- TData = AsyncReturnType<typeof getOrganisationUnitUsers>,
256
- TError = ErrorType<AsError | void>
257
- >(
258
- unitid: string,
259
- options?: {
260
- query?: UseQueryOptions<
261
- AsyncReturnType<typeof getOrganisationUnitUsers>,
262
- TError,
263
- TData
264
- >;
265
- request?: SecondParameter<typeof customInstance>;
266
- }
267
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
268
- const { query: queryOptions, request: requestOptions } = options || {};
269
-
270
- const queryKey =
271
- queryOptions?.queryKey ?? getGetOrganisationUnitUsersQueryKey(unitid);
272
-
273
- const queryFn: QueryFunction<
274
- AsyncReturnType<typeof getOrganisationUnitUsers>
275
- > = () => getOrganisationUnitUsers(unitid, requestOptions);
276
-
277
- const query = useQuery<
278
- AsyncReturnType<typeof getOrganisationUnitUsers>,
279
- TError,
280
- TData
281
- >(queryKey, queryFn, { enabled: !!unitid, ...queryOptions });
282
-
283
- return {
284
- queryKey,
285
- ...query,
72
+ const appApiUserGetUnitUsers = <TData = AxiosResponse<UsersGetResponse>>(
73
+ unitId: string,
74
+ options?: AxiosRequestConfig
75
+ ): Promise<TData> => {
76
+ return axios.get(`/unit/${unitId}/user`, options);
286
77
  };
287
- };
288
-
289
- /**
78
+ /**
290
79
  * Adds a user to an Organisational Unit.
291
80
 
292
81
  Users cannot be added to **Independent Units** (Units that are part of the ***Default** Organisation).
@@ -295,48 +84,14 @@ You have to be in the Organisation or Unit or an Admin user to use this endpoint
295
84
 
296
85
  * @summary Adds a user to an Organisational Unit
297
86
  */
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
- );
307
- };
308
-
309
- export const useAddOrganisationUnitUser = <
310
- TError = ErrorType<AsError>,
311
- TContext = unknown
312
- >(options?: {
313
- mutation?: UseMutationOptions<
314
- AsyncReturnType<typeof addOrganisationUnitUser>,
315
- TError,
316
- { unitid: string; userid: string },
317
- TContext
318
- >;
319
- request?: SecondParameter<typeof customInstance>;
320
- }) => {
321
- const { mutation: mutationOptions, request: requestOptions } = options || {};
322
-
323
- const mutationFn: MutationFunction<
324
- AsyncReturnType<typeof addOrganisationUnitUser>,
325
- { unitid: string; userid: string }
326
- > = (props) => {
327
- const { unitid, userid } = props || {};
328
-
329
- return addOrganisationUnitUser(unitid, userid, requestOptions);
87
+ const appApiUserUnitUserPut = <TData = AxiosResponse<void>>(
88
+ unitId: string,
89
+ userId: string,
90
+ options?: AxiosRequestConfig
91
+ ): Promise<TData> => {
92
+ return axios.put(`/unit/${unitId}/user/${userId}`, undefined, options);
330
93
  };
331
-
332
- return useMutation<
333
- AsyncReturnType<typeof addOrganisationUnitUser>,
334
- TError,
335
- { unitid: string; userid: string },
336
- TContext
337
- >(mutationFn, mutationOptions);
338
- };
339
- /**
94
+ /**
340
95
  * Removes a user from an Organisational Unit.
341
96
 
342
97
  Users cannot be removed from **Independent Units** (Units that are part of the ***Default** Organisation).
@@ -345,44 +100,27 @@ You have to be in the Organisation or Unit or an Admin user to use this endpoint
345
100
 
346
101
  * @summary Deletes a user from an Organisational Unit
347
102
  */
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
- );
357
- };
358
-
359
- export const useDeleteOrganisationUnitUser = <
360
- TError = ErrorType<AsError>,
361
- TContext = unknown
362
- >(options?: {
363
- mutation?: UseMutationOptions<
364
- AsyncReturnType<typeof deleteOrganisationUnitUser>,
365
- TError,
366
- { unitid: string; userid: string },
367
- TContext
368
- >;
369
- request?: SecondParameter<typeof customInstance>;
370
- }) => {
371
- const { mutation: mutationOptions, request: requestOptions } = options || {};
372
-
373
- const mutationFn: MutationFunction<
374
- AsyncReturnType<typeof deleteOrganisationUnitUser>,
375
- { unitid: string; userid: string }
376
- > = (props) => {
377
- const { unitid, userid } = props || {};
378
-
379
- return deleteOrganisationUnitUser(unitid, userid, requestOptions);
103
+ const appApiUserUnitUserDelete = <TData = AxiosResponse<void>>(
104
+ unitId: string,
105
+ userId: string,
106
+ options?: AxiosRequestConfig
107
+ ): Promise<TData> => {
108
+ return axios.delete(`/unit/${unitId}/user/${userId}`, options);
109
+ };
110
+ return {
111
+ appApiUserGetAccount,
112
+ appApiUserOrgGetUsers,
113
+ appApiUserOrgUserPut,
114
+ appApiUserOrgUserDelete,
115
+ appApiUserGetUnitUsers,
116
+ appApiUserUnitUserPut,
117
+ appApiUserUnitUserDelete,
380
118
  };
381
-
382
- return useMutation<
383
- AsyncReturnType<typeof deleteOrganisationUnitUser>,
384
- TError,
385
- { unitid: string; userid: string },
386
- TContext
387
- >(mutationFn, mutationOptions);
388
119
  };
120
+ export type AppApiUserGetAccountResult = AxiosResponse<UserAccountGetResponse>;
121
+ export type AppApiUserOrgGetUsersResult = AxiosResponse<UsersGetResponse>;
122
+ export type AppApiUserOrgUserPutResult = AxiosResponse<void>;
123
+ export type AppApiUserOrgUserDeleteResult = AxiosResponse<void>;
124
+ export type AppApiUserGetUnitUsersResult = AxiosResponse<UsersGetResponse>;
125
+ export type AppApiUserUnitUserPutResult = AxiosResponse<void>;
126
+ export type AppApiUserUnitUserDeleteResult = AxiosResponse<void>;
package/state/state.cjs CHANGED
@@ -1,28 +1,14 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
-
3
-
4
- var _chunk3DXYUDZHcjs = require('../chunk-3DXYUDZH.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }require('../chunk-N3RLW53G.cjs');
5
2
 
6
3
  // src/state/state.ts
7
-
8
-
9
- var _reactquery = require('react-query');
10
- var getVersion = (options) => {
11
- return _chunk3DXYUDZHcjs.customInstance.call(void 0, { url: `/version`, method: "get" }, options);
4
+ var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
5
+ var getState = () => {
6
+ const appApiStateGetVersion = (options) => {
7
+ return _axios2.default.get(`/version`, options);
8
+ };
9
+ return { appApiStateGetVersion };
12
10
  };
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);
18
- const query = _reactquery.useQuery.call(void 0, queryKey, queryFn, queryOptions);
19
- return _chunk3DXYUDZHcjs.__spreadValues.call(void 0, {
20
- queryKey
21
- }, query);
22
- };
23
-
24
-
25
11
 
26
12
 
27
- exports.getGetVersionQueryKey = getGetVersionQueryKey; exports.getVersion = getVersion; exports.useGetVersion = useGetVersion;
13
+ exports.getState = getState;
28
14
  //# 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;AAGO,IAAM,WAAW,MAAM;AAI5B,QAAM,wBAAwB,CAG5B,YACmB;AACnB,WAAO,MAAM,IAAI,YAAY,OAAO;AAAA,EACtC;AACA,SAAO,EAAE,sBAAsB;AACjC","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 } from \"axios\";\nimport type { StateGetVersionResponse } from \"../account-server-api.schemas\";\n\nexport const getState = () => {\n /**\n * @summary Gets the Account Server version\n */\n const appApiStateGetVersion = <\n TData = AxiosResponse<StateGetVersionResponse>\n >(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/version`, options);\n };\n return { appApiStateGetVersion };\n};\nexport type AppApiStateGetVersionResult =\n AxiosResponse<StateGetVersionResponse>;\n"]}
package/state/state.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { UseQueryOptions, QueryKey, UseQueryResult } from 'react-query';
2
- import { V as customInstance, M as StateGetVersionResponse, W as ErrorType, N as AsError } from '../custom-instance-86dd5ce6';
3
- import 'axios';
1
+ import { AxiosResponse, AxiosRequestConfig } from 'axios';
2
+ import { M as StateGetVersionResponse } from '../account-server-api.schemas-078442c3.js';
4
3
 
5
4
  /**
6
- * Generated by orval v6.6.0 🍺
5
+ * Generated by orval v6.7.1 🍺
7
6
  * Do not edit manually.
8
7
  * Account Server API
9
8
  * The Informatics Matters Account Server API.
@@ -13,17 +12,9 @@ A service that provides access to the Account Server, which gives *registered* u
13
12
  * OpenAPI spec version: 0.1
14
13
  */
15
14
 
16
- declare type SecondParameter<T extends (...args: any) => any> = T extends (config: any, args: infer P) => any ? P : never;
17
- /**
18
- * @summary Gets the Account Server version
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>;
25
- } | undefined) => UseQueryResult<TData, TError> & {
26
- queryKey: QueryKey;
15
+ declare const getState: () => {
16
+ appApiStateGetVersion: <TData = AxiosResponse<StateGetVersionResponse, any>>(options?: AxiosRequestConfig<any> | undefined) => Promise<TData>;
27
17
  };
18
+ declare type AppApiStateGetVersionResult = AxiosResponse<StateGetVersionResponse>;
28
19
 
29
- export { getGetVersionQueryKey, getVersion, useGetVersion };
20
+ export { AppApiStateGetVersionResult, getState };
package/state/state.js CHANGED
@@ -1,28 +1,14 @@
1
- import {
2
- __spreadValues,
3
- customInstance
4
- } from "../chunk-JR7F532L.js";
1
+ import "../chunk-GWBPVOL2.js";
5
2
 
6
3
  // src/state/state.ts
7
- import {
8
- useQuery
9
- } from "react-query";
10
- var getVersion = (options) => {
11
- return customInstance({ url: `/version`, method: "get" }, options);
12
- };
13
- var getGetVersionQueryKey = () => [`/version`];
14
- var useGetVersion = (options) => {
15
- const { query: queryOptions, request: requestOptions } = options || {};
16
- const queryKey = (queryOptions == null ? void 0 : queryOptions.queryKey) ?? getGetVersionQueryKey();
17
- const queryFn = () => getVersion(requestOptions);
18
- const query = useQuery(queryKey, queryFn, queryOptions);
19
- return __spreadValues({
20
- queryKey
21
- }, query);
4
+ import axios from "axios";
5
+ var getState = () => {
6
+ const appApiStateGetVersion = (options) => {
7
+ return axios.get(`/version`, options);
8
+ };
9
+ return { appApiStateGetVersion };
22
10
  };
23
11
  export {
24
- getGetVersionQueryKey,
25
- getVersion,
26
- useGetVersion
12
+ getState
27
13
  };
28
14
  //# sourceMappingURL=state.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/state/state.ts"],"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"],"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;","names":[]}
1
+ {"version":3,"sources":["../../src/state/state.ts"],"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 } from \"axios\";\nimport type { StateGetVersionResponse } from \"../account-server-api.schemas\";\n\nexport const getState = () => {\n /**\n * @summary Gets the Account Server version\n */\n const appApiStateGetVersion = <\n TData = AxiosResponse<StateGetVersionResponse>\n >(\n options?: AxiosRequestConfig\n ): Promise<TData> => {\n return axios.get(`/version`, options);\n };\n return { appApiStateGetVersion };\n};\nexport type AppApiStateGetVersionResult =\n AxiosResponse<StateGetVersionResponse>;\n"],"mappings":";;;AAUA;AAGO,IAAM,WAAW,MAAM;AAI5B,QAAM,wBAAwB,CAG5B,YACmB;AACnB,WAAO,MAAM,IAAI,YAAY,OAAO;AAAA,EACtC;AACA,SAAO,EAAE,sBAAsB;AACjC;","names":[]}