@squonk/account-server-client 2.1.0-rc.1 → 2.1.0-rc.11
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/README.md +1 -1
- package/admin/admin.cjs +30 -8
- package/admin/admin.cjs.map +1 -1
- package/admin/admin.d.cts +50 -0
- package/admin/admin.d.ts +26 -6
- package/admin/admin.js +30 -8
- package/admin/admin.js.map +1 -1
- package/asset/asset.cjs +62 -22
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +260 -0
- package/asset/asset.d.ts +79 -36
- package/asset/asset.js +54 -14
- package/asset/asset.js.map +1 -1
- package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
- package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
- package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
- package/chunk-TKLTUR4R.cjs.map +1 -0
- package/event-stream/event-stream.cjs +64 -19
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +142 -0
- package/event-stream/event-stream.d.ts +66 -20
- package/event-stream/event-stream.js +61 -16
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +163 -163
- package/index.d.ts +700 -2
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +53 -14
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +91 -0
- package/merchant/merchant.d.ts +48 -8
- package/merchant/merchant.js +52 -13
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +110 -28
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +271 -0
- package/organisation/organisation.d.ts +114 -25
- package/organisation/organisation.js +103 -21
- package/organisation/organisation.js.map +1 -1
- package/package.json +12 -12
- package/product/product.cjs +182 -47
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +399 -0
- package/product/product.d.ts +180 -31
- package/product/product.js +172 -37
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +272 -280
- package/src/admin/admin.ts +114 -84
- package/src/asset/asset.ts +480 -565
- package/src/custom-instance.ts +3 -4
- package/src/event-stream/event-stream.ts +300 -275
- package/src/merchant/merchant.ts +206 -142
- package/src/organisation/organisation.ts +549 -490
- package/src/product/product.ts +829 -688
- package/src/state/state.ts +112 -75
- package/src/unit/unit.ts +645 -599
- package/src/user/user.ts +489 -469
- package/state/state.cjs +29 -8
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +46 -0
- package/state/state.d.ts +26 -6
- package/state/state.js +29 -8
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +120 -32
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +322 -0
- package/unit/unit.d.ts +133 -38
- package/unit/unit.js +112 -24
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +96 -22
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +271 -0
- package/user/user.d.ts +96 -24
- package/user/user.js +90 -16
- 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.25.0 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Account Server API
|
|
5
5
|
* The Informatics Matters Account Server API.
|
|
@@ -8,90 +8,127 @@ 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
|
+
useSuspenseQuery
|
|
14
|
+
} from '@tanstack/react-query'
|
|
12
15
|
import type {
|
|
13
|
-
UseQueryOptions,
|
|
14
16
|
QueryFunction,
|
|
15
|
-
UseQueryResult,
|
|
16
17
|
QueryKey,
|
|
17
|
-
|
|
18
|
+
UseQueryOptions,
|
|
19
|
+
UseQueryResult,
|
|
20
|
+
UseSuspenseQueryOptions,
|
|
21
|
+
UseSuspenseQueryResult
|
|
22
|
+
} from '@tanstack/react-query'
|
|
18
23
|
import type {
|
|
19
|
-
StateGetVersionResponse,
|
|
20
24
|
AsError,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
) => any
|
|
30
|
-
? P
|
|
31
|
-
: never;
|
|
25
|
+
StateGetVersionResponse
|
|
26
|
+
} from '../account-server-api.schemas'
|
|
27
|
+
import { customInstance } from '.././custom-instance';
|
|
28
|
+
import type { ErrorType } from '.././custom-instance';
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
32
|
+
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* @summary Gets the Account Server version
|
|
35
36
|
*/
|
|
36
37
|
export const getVersion = (
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
|
|
39
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
39
40
|
) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
queryKey
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export type GetVersionQueryResult = NonNullable<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
TError
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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;
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
return customInstance<StateGetVersionResponse>(
|
|
44
|
+
{url: `/version`, method: 'GET', signal
|
|
45
|
+
},
|
|
46
|
+
options);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export const getGetVersionQueryKey = () => {
|
|
51
|
+
return ["account-server-api", `/version`] as const;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
export const getGetVersionQueryOptions = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
56
|
+
) => {
|
|
57
|
+
|
|
58
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
59
|
+
|
|
60
|
+
const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({ signal }) => getVersion(requestOptions, signal);
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData> & { queryKey: QueryKey }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type GetVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>
|
|
74
|
+
export type GetVersionQueryError = ErrorType<AsError | void>
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @summary Gets the Account Server version
|
|
78
|
+
*/
|
|
79
|
+
export const useGetVersion = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>(
|
|
80
|
+
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
81
|
+
|
|
82
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
83
|
+
|
|
84
|
+
const queryOptions = getGetVersionQueryOptions(options)
|
|
85
|
+
|
|
86
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
87
|
+
|
|
88
|
+
query.queryKey = queryOptions.queryKey ;
|
|
95
89
|
|
|
96
90
|
return query;
|
|
97
|
-
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
export const getGetVersionSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
96
|
+
) => {
|
|
97
|
+
|
|
98
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
99
|
+
|
|
100
|
+
const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({ signal }) => getVersion(requestOptions, signal);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData> & { queryKey: QueryKey }
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export type GetVersionSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>
|
|
114
|
+
export type GetVersionSuspenseQueryError = ErrorType<AsError | void>
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* @summary Gets the Account Server version
|
|
118
|
+
*/
|
|
119
|
+
export const useGetVersionSuspense = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>(
|
|
120
|
+
options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
121
|
+
|
|
122
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
123
|
+
|
|
124
|
+
const queryOptions = getGetVersionSuspenseQueryOptions(options)
|
|
125
|
+
|
|
126
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
127
|
+
|
|
128
|
+
query.queryKey = queryOptions.queryKey ;
|
|
129
|
+
|
|
130
|
+
return query;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|