@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/merchant/merchant.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,28 +8,29 @@ 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
|
-
MerchantsGetResponse,
|
|
20
24
|
AsError,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
) => any
|
|
31
|
-
? P
|
|
32
|
-
: never;
|
|
25
|
+
MerchantDetail,
|
|
26
|
+
MerchantsGetResponse
|
|
27
|
+
} from '../account-server-api.schemas'
|
|
28
|
+
import { customInstance } from '.././custom-instance';
|
|
29
|
+
import type { ErrorType } from '.././custom-instance';
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
33
|
+
|
|
33
34
|
|
|
34
35
|
/**
|
|
35
36
|
* Gets Merchants known to the Account Server
|
|
@@ -39,67 +40,102 @@ Merchants are software services (SaaS assets) whose facilities are known to and
|
|
|
39
40
|
* @summary Gets all Merchants
|
|
40
41
|
*/
|
|
41
42
|
export const getMerchants = (
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
45
|
+
) => {
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
return customInstance<MerchantsGetResponse>(
|
|
49
|
+
{url: `/merchant`, method: 'GET', signal
|
|
50
|
+
},
|
|
51
|
+
options);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
export const getGetMerchantsQueryKey = () => {
|
|
56
|
+
return ["account-server-api", `/merchant`] as const;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
export const getGetMerchantsQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
44
61
|
) => {
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
62
|
+
|
|
63
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
64
|
+
|
|
65
|
+
const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: QueryKey }
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>
|
|
79
|
+
export type GetMerchantsQueryError = ErrorType<AsError | void>
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @summary Gets all Merchants
|
|
83
|
+
*/
|
|
84
|
+
export const useGetMerchants = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(
|
|
85
|
+
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
86
|
+
|
|
87
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
88
|
+
|
|
89
|
+
const queryOptions = getGetMerchantsQueryOptions(options)
|
|
90
|
+
|
|
91
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
92
|
+
|
|
93
|
+
query.queryKey = queryOptions.queryKey ;
|
|
94
|
+
|
|
95
|
+
return query;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export const getGetMerchantsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
101
|
+
) => {
|
|
102
|
+
|
|
103
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
104
|
+
|
|
105
|
+
const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & { queryKey: QueryKey }
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export type GetMerchantsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>
|
|
119
|
+
export type GetMerchantsSuspenseQueryError = ErrorType<AsError | void>
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @summary Gets all Merchants
|
|
123
|
+
*/
|
|
124
|
+
export const useGetMerchantsSuspense = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(
|
|
125
|
+
options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
126
|
+
|
|
127
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
128
|
+
|
|
129
|
+
const queryOptions = getGetMerchantsSuspenseQueryOptions(options)
|
|
130
|
+
|
|
131
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
132
|
+
|
|
133
|
+
query.queryKey = queryOptions.queryKey ;
|
|
100
134
|
|
|
101
135
|
return query;
|
|
102
|
-
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
|
|
103
139
|
|
|
104
140
|
/**
|
|
105
141
|
* Gets a known Merchant
|
|
@@ -107,72 +143,100 @@ export const useGetMerchants = <
|
|
|
107
143
|
* @summary Gets a specific Merchant
|
|
108
144
|
*/
|
|
109
145
|
export const getService = (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
signal?: AbortSignal
|
|
146
|
+
mId: number,
|
|
147
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
113
148
|
) => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
export const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
Awaited<ReturnType<typeof getService>>,
|
|
163
|
-
TError,
|
|
164
|
-
TData
|
|
165
|
-
>;
|
|
166
|
-
request?: SecondParameter<typeof customInstance>;
|
|
167
|
-
}
|
|
168
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
169
|
-
const queryOptions = getGetServiceQueryOptions(mId, options);
|
|
170
|
-
|
|
171
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
|
|
172
|
-
queryKey: QueryKey;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
query.queryKey = queryOptions.queryKey;
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
return customInstance<MerchantDetail>(
|
|
152
|
+
{url: `/merchant/${mId}`, method: 'GET', signal
|
|
153
|
+
},
|
|
154
|
+
options);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
export const getGetServiceQueryKey = (mId: number,) => {
|
|
159
|
+
return ["account-server-api", `/merchant/${mId}`] as const;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
export const getGetServiceQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
164
|
+
) => {
|
|
165
|
+
|
|
166
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
167
|
+
|
|
168
|
+
const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
return { queryKey, queryFn, enabled: !!(mId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: QueryKey }
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>
|
|
182
|
+
export type GetServiceQueryError = ErrorType<AsError | void>
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @summary Gets a specific Merchant
|
|
186
|
+
*/
|
|
187
|
+
export const useGetService = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(
|
|
188
|
+
mId: number, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
189
|
+
|
|
190
|
+
): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
191
|
+
|
|
192
|
+
const queryOptions = getGetServiceQueryOptions(mId,options)
|
|
193
|
+
|
|
194
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
195
|
+
|
|
196
|
+
query.queryKey = queryOptions.queryKey ;
|
|
176
197
|
|
|
177
198
|
return query;
|
|
178
|
-
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
export const getGetServiceSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
204
|
+
) => {
|
|
205
|
+
|
|
206
|
+
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
207
|
+
|
|
208
|
+
const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
return { queryKey, queryFn, enabled: !!(mId), ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & { queryKey: QueryKey }
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export type GetServiceSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>
|
|
222
|
+
export type GetServiceSuspenseQueryError = ErrorType<AsError | void>
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @summary Gets a specific Merchant
|
|
226
|
+
*/
|
|
227
|
+
export const useGetServiceSuspense = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(
|
|
228
|
+
mId: number, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
229
|
+
|
|
230
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
|
|
231
|
+
|
|
232
|
+
const queryOptions = getGetServiceSuspenseQueryOptions(mId,options)
|
|
233
|
+
|
|
234
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
235
|
+
|
|
236
|
+
query.queryKey = queryOptions.queryKey ;
|
|
237
|
+
|
|
238
|
+
return query;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|