@squonk/account-server-client 2.1.0-rc.2 → 2.1.0-rc.4
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/admin/admin.cjs +14 -7
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +33 -0
- package/admin/admin.d.ts +4 -1
- package/admin/admin.js +14 -7
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +44 -19
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +243 -0
- package/asset/asset.d.ts +49 -23
- package/asset/asset.js +37 -12
- package/asset/asset.js.map +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
- package/chunk-J22A7LHX.cjs.map +1 -0
- package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
- package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
- package/{custom-instance-35e5d4fd.d.ts → custom-instance-37bb38c1.d.ts} +159 -159
- package/event-stream/event-stream.cjs +34 -18
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +108 -0
- package/event-stream/event-stream.d.ts +16 -4
- package/event-stream/event-stream.js +31 -15
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +23 -13
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +57 -0
- package/merchant/merchant.d.ts +7 -1
- package/merchant/merchant.js +22 -12
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +50 -25
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +203 -0
- package/organisation/organisation.d.ts +31 -10
- package/organisation/organisation.js +44 -19
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +80 -44
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +280 -0
- package/product/product.d.ts +40 -10
- package/product/product.js +71 -35
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +268 -276
- package/src/admin/admin.ts +72 -78
- package/src/asset/asset.ts +453 -560
- package/src/event-stream/event-stream.ts +222 -268
- package/src/merchant/merchant.ts +125 -136
- package/src/organisation/organisation.ts +394 -484
- package/src/product/product.ts +557 -682
- package/src/state/state.ts +70 -69
- package/src/unit/unit.ts +494 -593
- package/src/user/user.ts +377 -463
- package/state/state.cjs +13 -7
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +29 -0
- package/state/state.d.ts +4 -1
- package/state/state.js +13 -7
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +59 -28
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +254 -0
- package/unit/unit.d.ts +43 -16
- package/unit/unit.js +52 -21
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +52 -21
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +220 -0
- package/user/user.d.ts +31 -10
- package/user/user.js +46 -15
- package/user/user.js.map +1 -1
- package/chunk-UZTHSGDT.cjs.map +0 -1
package/src/state/state.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generated by orval v6.
|
|
2
|
+
* Generated by orval v6.20.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -8,90 +8,91 @@ A service that provides access to the Account Server, which gives *registered* u
|
|
|
8
8
|
|
|
9
9
|
* OpenAPI spec version: 2.1
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
useQuery
|
|
13
|
+
} from '@tanstack/react-query'
|
|
12
14
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
15
|
QueryFunction,
|
|
15
|
-
UseQueryResult,
|
|
16
16
|
QueryKey,
|
|
17
|
-
|
|
17
|
+
UseQueryOptions,
|
|
18
|
+
UseQueryResult
|
|
19
|
+
} from '@tanstack/react-query'
|
|
18
20
|
import type {
|
|
19
|
-
StateGetVersionResponse,
|
|
20
21
|
AsError,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import
|
|
22
|
+
StateGetVersionResponse
|
|
23
|
+
} from '../account-server-api.schemas'
|
|
24
|
+
import { customInstance } from '.././custom-instance';
|
|
25
|
+
import type { ErrorType } from '.././custom-instance';
|
|
26
|
+
|
|
24
27
|
|
|
25
28
|
// eslint-disable-next-line
|
|
26
|
-
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
29
|
+
type SecondParameter<T extends (...args: any) => any> = T extends (
|
|
27
30
|
config: any,
|
|
28
|
-
args: infer P
|
|
31
|
+
args: infer P,
|
|
29
32
|
) => any
|
|
30
33
|
? P
|
|
31
34
|
: never;
|
|
32
35
|
|
|
36
|
+
|
|
33
37
|
/**
|
|
34
38
|
* @summary Gets the Account Server version
|
|
35
39
|
*/
|
|
36
40
|
export const getVersion = (
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
|
|
42
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
43
|
+
) => {
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
return customInstance<StateGetVersionResponse>(
|
|
47
|
+
{url: `/version`, method: 'get', signal
|
|
48
|
+
},
|
|
49
|
+
options);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
export const getGetVersionQueryKey = () => {
|
|
54
|
+
|
|
55
|
+
return ["account-server-api", `/version`] as const;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
export const getGetVersionQueryOptions = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
39
60
|
) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
export type GetVersionQueryResult = NonNullable<
|
|
73
|
-
Awaited<ReturnType<typeof getVersion>>
|
|
74
|
-
>;
|
|
75
|
-
export type GetVersionQueryError = ErrorType<AsError | void>;
|
|
76
|
-
|
|
77
|
-
export const useGetVersion = <
|
|
78
|
-
TData = Awaited<ReturnType<typeof getVersion>>,
|
|
79
|
-
TError = ErrorType<AsError | void>
|
|
80
|
-
>(options?: {
|
|
81
|
-
query?: UseQueryOptions<
|
|
82
|
-
Awaited<ReturnType<typeof getVersion>>,
|
|
83
|
-
TError,
|
|
84
|
-
TData
|
|
85
|
-
>;
|
|
86
|
-
request?: SecondParameter<typeof customInstance>;
|
|
87
|
-
}): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
88
|
-
const queryOptions = getGetVersionQueryOptions(options);
|
|
89
|
-
|
|
90
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
91
|
-
queryKey: QueryKey;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
query.queryKey = queryOptions.queryKey;
|
|
61
|
+
|
|
62
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
63
|
+
|
|
64
|
+
const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({ signal }) => getVersion(requestOptions, signal);
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData> & { queryKey: QueryKey }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type GetVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>
|
|
78
|
+
export type GetVersionQueryError = ErrorType<AsError | void>
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @summary Gets the Account Server version
|
|
82
|
+
*/
|
|
83
|
+
export const useGetVersion = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>(
|
|
84
|
+
options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
|
|
85
|
+
|
|
86
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
87
|
+
|
|
88
|
+
const queryOptions = getGetVersionQueryOptions(options)
|
|
89
|
+
|
|
90
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
91
|
+
|
|
92
|
+
query.queryKey = queryOptions.queryKey ;
|
|
95
93
|
|
|
96
94
|
return query;
|
|
97
|
-
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|