@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.
- package/{custom-instance-4a108741.d.ts → account-server-api.schemas-e6c5f956.d.ts} +15 -20
- package/{chunk-JR7F532L.js → chunk-GWBPVOL2.js} +2 -23
- package/chunk-GWBPVOL2.js.map +1 -0
- package/chunk-N3RLW53G.cjs +25 -0
- package/chunk-N3RLW53G.cjs.map +1 -0
- package/index.cjs +21 -5
- package/index.cjs.map +1 -1
- package/index.d.ts +20 -2
- package/index.js +21 -5
- package/index.js.map +1 -1
- package/organisation/organisation.cjs +31 -31
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.ts +37 -28
- package/organisation/organisation.js +38 -38
- package/organisation/organisation.js.map +1 -1
- package/package.json +14 -14
- package/product/product.cjs +64 -61
- package/product/product.cjs.map +1 -1
- package/product/product.d.ts +70 -40
- package/product/product.js +75 -72
- package/product/product.js.map +1 -1
- package/service/service.cjs +23 -21
- package/service/service.cjs.map +1 -1
- package/service/service.d.ts +19 -15
- package/service/service.js +26 -24
- package/service/service.js.map +1 -1
- package/src/account-server-api.schemas.ts +14 -1
- package/src/organisation/organisation.ts +86 -83
- package/src/product/product.ts +210 -145
- package/src/service/service.ts +64 -56
- package/src/state/state.ts +31 -32
- package/src/unit/unit.ts +170 -149
- package/src/user/user.ts +171 -160
- package/state/state.cjs +12 -12
- package/state/state.cjs.map +1 -1
- package/state/state.d.ts +12 -10
- package/state/state.js +13 -13
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +54 -58
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.ts +64 -49
- package/unit/unit.js +67 -71
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +56 -56
- package/user/user.cjs.map +1 -1
- package/user/user.d.ts +69 -55
- package/user/user.js +69 -69
- package/user/user.js.map +1 -1
- package/chunk-3DXYUDZH.cjs +0 -46
- package/chunk-3DXYUDZH.cjs.map +0 -1
- package/chunk-JR7F532L.js.map +0 -1
package/src/service/service.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
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
|
|
46
|
-
options?:
|
|
47
|
-
) => {
|
|
48
|
-
return
|
|
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
|
|
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
|
|
57
|
-
TData = AsyncReturnType<typeof
|
|
58
|
-
TError =
|
|
50
|
+
export const useAppApiServiceGet = <
|
|
51
|
+
TData = AsyncReturnType<typeof appApiServiceGet>,
|
|
52
|
+
TError = AxiosError<AsError | void>
|
|
59
53
|
>(options?: {
|
|
60
|
-
query?: UseQueryOptions<
|
|
61
|
-
|
|
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,
|
|
61
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
64
62
|
|
|
65
|
-
const queryKey = queryOptions?.queryKey ??
|
|
63
|
+
const queryKey = queryOptions?.queryKey ?? getAppApiServiceGetQueryKey();
|
|
66
64
|
|
|
67
|
-
const queryFn: QueryFunction<AsyncReturnType<typeof
|
|
68
|
-
|
|
65
|
+
const queryFn: QueryFunction<AsyncReturnType<typeof appApiServiceGet>> = () =>
|
|
66
|
+
appApiServiceGet(axiosOptions);
|
|
69
67
|
|
|
70
|
-
const query = useQuery<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
|
88
|
-
|
|
89
|
-
options?:
|
|
90
|
-
) => {
|
|
91
|
-
return
|
|
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
|
|
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
|
|
100
|
-
TData = AsyncReturnType<typeof
|
|
101
|
-
TError =
|
|
101
|
+
export const useAppApiServiceGetId = <
|
|
102
|
+
TData = AsyncReturnType<typeof appApiServiceGetId>,
|
|
103
|
+
TError = AxiosError<AsError | void>
|
|
102
104
|
>(
|
|
103
|
-
|
|
105
|
+
svcId: number,
|
|
104
106
|
options?: {
|
|
105
|
-
query?: UseQueryOptions<
|
|
106
|
-
|
|
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,
|
|
115
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
110
116
|
|
|
111
|
-
const queryKey =
|
|
117
|
+
const queryKey =
|
|
118
|
+
queryOptions?.queryKey ?? getAppApiServiceGetIdQueryKey(svcId);
|
|
112
119
|
|
|
113
|
-
const queryFn: QueryFunction<
|
|
114
|
-
|
|
120
|
+
const queryFn: QueryFunction<
|
|
121
|
+
AsyncReturnType<typeof appApiServiceGetId>
|
|
122
|
+
> = () => appApiServiceGetId(svcId, axiosOptions);
|
|
115
123
|
|
|
116
|
-
const query = useQuery<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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,
|
package/src/state/state.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
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
|
|
43
|
-
options?:
|
|
44
|
-
) => {
|
|
45
|
-
return
|
|
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
|
|
40
|
+
export const getAppApiStateGetVersionQueryKey = () => [`/version`];
|
|
52
41
|
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
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<
|
|
58
|
-
|
|
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,
|
|
58
|
+
const { query: queryOptions, axios: axiosOptions } = options || {};
|
|
61
59
|
|
|
62
|
-
const queryKey = queryOptions?.queryKey ??
|
|
60
|
+
const queryKey = queryOptions?.queryKey ?? getAppApiStateGetVersionQueryKey();
|
|
63
61
|
|
|
64
|
-
const queryFn: QueryFunction<
|
|
65
|
-
|
|
62
|
+
const queryFn: QueryFunction<
|
|
63
|
+
AsyncReturnType<typeof appApiStateGetVersion>
|
|
64
|
+
> = () => appApiStateGetVersion(axiosOptions);
|
|
66
65
|
|
|
67
|
-
const query = useQuery<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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,
|