@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
@@ -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
  UseQueryOptions,
@@ -20,7 +21,6 @@ import type {
20
21
  AsError,
21
22
  ServiceGetResponse,
22
23
  } from "../account-server-api.schemas";
23
- import { customInstance, ErrorType } from ".././custom-instance";
24
24
 
25
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
26
  type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
@@ -29,49 +29,47 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
29
29
  ? R
30
30
  : any;
31
31
 
32
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
- type SecondParameter<T extends (...args: any) => any> = T extends (
34
- config: any,
35
- args: infer P
36
- ) => any
37
- ? P
38
- : never;
39
-
40
32
  /**
41
33
  * Gets services known to the Account Server
42
34
 
43
35
  * @summary Gets all Services
44
36
  */
45
- export const getServices = (
46
- options?: SecondParameter<typeof customInstance>
47
- ) => {
48
- return customInstance<ServicesGetResponse>(
49
- { url: `/service`, method: "get" },
50
- options
51
- );
37
+ export const appApiServiceGet = (
38
+ options?: AxiosRequestConfig
39
+ ): Promise<AxiosResponse<ServicesGetResponse>> => {
40
+ return axios.get(`/service`, options);
52
41
  };
53
42
 
54
- export const getGetServicesQueryKey = () => [`/service`];
43
+ export const getAppApiServiceGetQueryKey = () => [`/service`];
44
+
45
+ export type AppApiServiceGetQueryResult = NonNullable<
46
+ AsyncReturnType<typeof appApiServiceGet>
47
+ >;
48
+ export type AppApiServiceGetQueryError = AxiosError<AsError | void>;
55
49
 
56
- export const useGetServices = <
57
- TData = AsyncReturnType<typeof getServices>,
58
- TError = ErrorType<AsError | void>
50
+ export const useAppApiServiceGet = <
51
+ TData = AsyncReturnType<typeof appApiServiceGet>,
52
+ TError = AxiosError<AsError | void>
59
53
  >(options?: {
60
- query?: UseQueryOptions<AsyncReturnType<typeof getServices>, TError, TData>;
61
- request?: SecondParameter<typeof customInstance>;
54
+ query?: UseQueryOptions<
55
+ AsyncReturnType<typeof appApiServiceGet>,
56
+ TError,
57
+ TData
58
+ >;
59
+ axios?: AxiosRequestConfig;
62
60
  }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
63
- const { query: queryOptions, request: requestOptions } = options || {};
61
+ const { query: queryOptions, axios: axiosOptions } = options || {};
64
62
 
65
- const queryKey = queryOptions?.queryKey ?? getGetServicesQueryKey();
63
+ const queryKey = queryOptions?.queryKey ?? getAppApiServiceGetQueryKey();
66
64
 
67
- const queryFn: QueryFunction<AsyncReturnType<typeof getServices>> = () =>
68
- getServices(requestOptions);
65
+ const queryFn: QueryFunction<AsyncReturnType<typeof appApiServiceGet>> = () =>
66
+ appApiServiceGet(axiosOptions);
69
67
 
70
- const query = useQuery<AsyncReturnType<typeof getServices>, TError, TData>(
71
- queryKey,
72
- queryFn,
73
- queryOptions
74
- );
68
+ const query = useQuery<
69
+ AsyncReturnType<typeof appApiServiceGet>,
70
+ TError,
71
+ TData
72
+ >(queryKey, queryFn, queryOptions);
75
73
 
76
74
  return {
77
75
  queryKey,
@@ -84,40 +82,50 @@ export const useGetServices = <
84
82
 
85
83
  * @summary Gets a specific Service
86
84
  */
87
- export const getService = (
88
- svcid: number,
89
- options?: SecondParameter<typeof customInstance>
90
- ) => {
91
- return customInstance<ServiceGetResponse>(
92
- { url: `/service/${svcid}`, method: "get" },
93
- options
94
- );
85
+ export const appApiServiceGetId = (
86
+ svcId: number,
87
+ options?: AxiosRequestConfig
88
+ ): Promise<AxiosResponse<ServiceGetResponse>> => {
89
+ return axios.get(`/service/${svcId}`, options);
95
90
  };
96
91
 
97
- export const getGetServiceQueryKey = (svcid: number) => [`/service/${svcid}`];
92
+ export const getAppApiServiceGetIdQueryKey = (svcId: number) => [
93
+ `/service/${svcId}`,
94
+ ];
95
+
96
+ export type AppApiServiceGetIdQueryResult = NonNullable<
97
+ AsyncReturnType<typeof appApiServiceGetId>
98
+ >;
99
+ export type AppApiServiceGetIdQueryError = AxiosError<AsError | void>;
98
100
 
99
- export const useGetService = <
100
- TData = AsyncReturnType<typeof getService>,
101
- TError = ErrorType<AsError | void>
101
+ export const useAppApiServiceGetId = <
102
+ TData = AsyncReturnType<typeof appApiServiceGetId>,
103
+ TError = AxiosError<AsError | void>
102
104
  >(
103
- svcid: number,
105
+ svcId: number,
104
106
  options?: {
105
- query?: UseQueryOptions<AsyncReturnType<typeof getService>, TError, TData>;
106
- request?: SecondParameter<typeof customInstance>;
107
+ query?: UseQueryOptions<
108
+ AsyncReturnType<typeof appApiServiceGetId>,
109
+ TError,
110
+ TData
111
+ >;
112
+ axios?: AxiosRequestConfig;
107
113
  }
108
114
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
109
- const { query: queryOptions, request: requestOptions } = options || {};
115
+ const { query: queryOptions, axios: axiosOptions } = options || {};
110
116
 
111
- const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(svcid);
117
+ const queryKey =
118
+ queryOptions?.queryKey ?? getAppApiServiceGetIdQueryKey(svcId);
112
119
 
113
- const queryFn: QueryFunction<AsyncReturnType<typeof getService>> = () =>
114
- getService(svcid, requestOptions);
120
+ const queryFn: QueryFunction<
121
+ AsyncReturnType<typeof appApiServiceGetId>
122
+ > = () => appApiServiceGetId(svcId, axiosOptions);
115
123
 
116
- const query = useQuery<AsyncReturnType<typeof getService>, TError, TData>(
117
- queryKey,
118
- queryFn,
119
- { enabled: !!svcid, ...queryOptions }
120
- );
124
+ const query = useQuery<
125
+ AsyncReturnType<typeof appApiServiceGetId>,
126
+ TError,
127
+ TData
128
+ >(queryKey, queryFn, { enabled: !!svcId, ...queryOptions });
121
129
 
122
130
  return {
123
131
  queryKey,
@@ -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
  UseQueryOptions,
@@ -19,7 +20,6 @@ import type {
19
20
  StateGetVersionResponse,
20
21
  AsError,
21
22
  } from "../account-server-api.schemas";
22
- import { customInstance, ErrorType } from ".././custom-instance";
23
23
 
24
24
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
25
  type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
@@ -28,47 +28,46 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
28
28
  ? R
29
29
  : any;
30
30
 
31
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
- type SecondParameter<T extends (...args: any) => any> = T extends (
33
- config: any,
34
- args: infer P
35
- ) => any
36
- ? P
37
- : never;
38
-
39
31
  /**
40
32
  * @summary Gets the Account Server version
41
33
  */
42
- export const getVersion = (
43
- options?: SecondParameter<typeof customInstance>
44
- ) => {
45
- return customInstance<StateGetVersionResponse>(
46
- { url: `/version`, method: "get" },
47
- options
48
- );
34
+ export const appApiStateGetVersion = (
35
+ options?: AxiosRequestConfig
36
+ ): Promise<AxiosResponse<StateGetVersionResponse>> => {
37
+ return axios.get(`/version`, options);
49
38
  };
50
39
 
51
- export const getGetVersionQueryKey = () => [`/version`];
40
+ export const getAppApiStateGetVersionQueryKey = () => [`/version`];
52
41
 
53
- export const useGetVersion = <
54
- TData = AsyncReturnType<typeof getVersion>,
55
- TError = ErrorType<AsError | void>
42
+ export type AppApiStateGetVersionQueryResult = NonNullable<
43
+ AsyncReturnType<typeof appApiStateGetVersion>
44
+ >;
45
+ export type AppApiStateGetVersionQueryError = AxiosError<AsError | void>;
46
+
47
+ export const useAppApiStateGetVersion = <
48
+ TData = AsyncReturnType<typeof appApiStateGetVersion>,
49
+ TError = AxiosError<AsError | void>
56
50
  >(options?: {
57
- query?: UseQueryOptions<AsyncReturnType<typeof getVersion>, TError, TData>;
58
- request?: SecondParameter<typeof customInstance>;
51
+ query?: UseQueryOptions<
52
+ AsyncReturnType<typeof appApiStateGetVersion>,
53
+ TError,
54
+ TData
55
+ >;
56
+ axios?: AxiosRequestConfig;
59
57
  }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
60
- const { query: queryOptions, request: requestOptions } = options || {};
58
+ const { query: queryOptions, axios: axiosOptions } = options || {};
61
59
 
62
- const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();
60
+ const queryKey = queryOptions?.queryKey ?? getAppApiStateGetVersionQueryKey();
63
61
 
64
- const queryFn: QueryFunction<AsyncReturnType<typeof getVersion>> = () =>
65
- getVersion(requestOptions);
62
+ const queryFn: QueryFunction<
63
+ AsyncReturnType<typeof appApiStateGetVersion>
64
+ > = () => appApiStateGetVersion(axiosOptions);
66
65
 
67
- const query = useQuery<AsyncReturnType<typeof getVersion>, TError, TData>(
68
- queryKey,
69
- queryFn,
70
- queryOptions
71
- );
66
+ const query = useQuery<
67
+ AsyncReturnType<typeof appApiStateGetVersion>,
68
+ TError,
69
+ TData
70
+ >(queryKey, queryFn, queryOptions);
72
71
 
73
72
  return {
74
73
  queryKey,