@squonk/account-server-client 2.1.0-rc.1 → 2.1.0-rc.10

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 (78) hide show
  1. package/README.md +1 -1
  2. package/admin/admin.cjs +30 -8
  3. package/admin/admin.cjs.map +1 -1
  4. package/admin/admin.d.cts +50 -0
  5. package/admin/admin.d.ts +26 -6
  6. package/admin/admin.js +30 -8
  7. package/admin/admin.js.map +1 -1
  8. package/asset/asset.cjs +62 -22
  9. package/asset/asset.cjs.map +1 -1
  10. package/asset/asset.d.cts +260 -0
  11. package/asset/asset.d.ts +79 -36
  12. package/asset/asset.js +54 -14
  13. package/asset/asset.js.map +1 -1
  14. package/{chunk-3RNIDX7T.js → chunk-EBOQPVLG.js} +2 -2
  15. package/{chunk-3RNIDX7T.js.map → chunk-EBOQPVLG.js.map} +1 -1
  16. package/{chunk-UZTHSGDT.cjs → chunk-TKLTUR4R.cjs} +2 -2
  17. package/chunk-TKLTUR4R.cjs.map +1 -0
  18. package/event-stream/event-stream.cjs +64 -19
  19. package/event-stream/event-stream.cjs.map +1 -1
  20. package/event-stream/event-stream.d.cts +142 -0
  21. package/event-stream/event-stream.d.ts +66 -20
  22. package/event-stream/event-stream.js +61 -16
  23. package/event-stream/event-stream.js.map +1 -1
  24. package/index.cjs +10 -10
  25. package/index.cjs.map +1 -1
  26. package/{custom-instance-35e5d4fd.d.ts → index.d.cts} +163 -163
  27. package/index.d.ts +700 -2
  28. package/index.js +9 -9
  29. package/index.js.map +1 -1
  30. package/merchant/merchant.cjs +53 -14
  31. package/merchant/merchant.cjs.map +1 -1
  32. package/merchant/merchant.d.cts +91 -0
  33. package/merchant/merchant.d.ts +48 -8
  34. package/merchant/merchant.js +52 -13
  35. package/merchant/merchant.js.map +1 -1
  36. package/organisation/organisation.cjs +110 -28
  37. package/organisation/organisation.cjs.map +1 -1
  38. package/organisation/organisation.d.cts +271 -0
  39. package/organisation/organisation.d.ts +114 -25
  40. package/organisation/organisation.js +103 -21
  41. package/organisation/organisation.js.map +1 -1
  42. package/package.json +12 -12
  43. package/product/product.cjs +182 -47
  44. package/product/product.cjs.map +1 -1
  45. package/product/product.d.cts +399 -0
  46. package/product/product.d.ts +180 -31
  47. package/product/product.js +172 -37
  48. package/product/product.js.map +1 -1
  49. package/src/account-server-api.schemas.ts +272 -280
  50. package/src/admin/admin.ts +114 -84
  51. package/src/asset/asset.ts +480 -565
  52. package/src/custom-instance.ts +3 -4
  53. package/src/event-stream/event-stream.ts +300 -275
  54. package/src/merchant/merchant.ts +206 -142
  55. package/src/organisation/organisation.ts +549 -490
  56. package/src/product/product.ts +829 -688
  57. package/src/state/state.ts +112 -75
  58. package/src/unit/unit.ts +645 -599
  59. package/src/user/user.ts +489 -469
  60. package/state/state.cjs +29 -8
  61. package/state/state.cjs.map +1 -1
  62. package/state/state.d.cts +46 -0
  63. package/state/state.d.ts +26 -6
  64. package/state/state.js +29 -8
  65. package/state/state.js.map +1 -1
  66. package/unit/unit.cjs +120 -32
  67. package/unit/unit.cjs.map +1 -1
  68. package/unit/unit.d.cts +322 -0
  69. package/unit/unit.d.ts +133 -38
  70. package/unit/unit.js +112 -24
  71. package/unit/unit.js.map +1 -1
  72. package/user/user.cjs +96 -22
  73. package/user/user.cjs.map +1 -1
  74. package/user/user.d.cts +271 -0
  75. package/user/user.d.ts +96 -24
  76. package/user/user.js +90 -16
  77. package/user/user.js.map +1 -1
  78. package/chunk-UZTHSGDT.cjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Generated by orval v6.15.0 🍺
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 { useQuery } from "@tanstack/react-query";
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
- } from "@tanstack/react-query";
18
+ UseQueryOptions,
19
+ UseQueryResult,
20
+ UseSuspenseQueryOptions,
21
+ UseSuspenseQueryResult
22
+ } from '@tanstack/react-query'
18
23
  import type {
19
- MerchantsGetResponse,
20
24
  AsError,
21
- MerchantGetResponse,
22
- } from "../account-server-api.schemas";
23
- import { customInstance } from ".././custom-instance";
24
- import type { ErrorType } from ".././custom-instance";
25
-
26
- // eslint-disable-next-line
27
- type SecondParameter<T extends (...args: any) => any> = T extends (
28
- config: any,
29
- args: infer P
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
- options?: SecondParameter<typeof customInstance>,
43
- signal?: AbortSignal
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
- return customInstance<MerchantsGetResponse>(
46
- { url: `/merchant`, method: "get", signal },
47
- options
48
- );
49
- };
50
-
51
- export const getGetMerchantsQueryKey = () => ["account-server-api", `/merchant`] as const;
52
-
53
- export const getGetMerchantsQueryOptions = <
54
- TData = Awaited<ReturnType<typeof getMerchants>>,
55
- TError = ErrorType<AsError | void>
56
- >(options?: {
57
- query?: UseQueryOptions<
58
- Awaited<ReturnType<typeof getMerchants>>,
59
- TError,
60
- TData
61
- >;
62
- request?: SecondParameter<typeof customInstance>;
63
- }): UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData> & {
64
- queryKey: QueryKey;
65
- } => {
66
- const { query: queryOptions, request: requestOptions } = options ?? {};
67
-
68
- const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
69
-
70
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({
71
- signal,
72
- }) => getMerchants(requestOptions, signal);
73
-
74
- return { queryKey, queryFn, ...queryOptions };
75
- };
76
-
77
- export type GetMerchantsQueryResult = NonNullable<
78
- Awaited<ReturnType<typeof getMerchants>>
79
- >;
80
- export type GetMerchantsQueryError = ErrorType<AsError | void>;
81
-
82
- export const useGetMerchants = <
83
- TData = Awaited<ReturnType<typeof getMerchants>>,
84
- TError = ErrorType<AsError | void>
85
- >(options?: {
86
- query?: UseQueryOptions<
87
- Awaited<ReturnType<typeof getMerchants>>,
88
- TError,
89
- TData
90
- >;
91
- request?: SecondParameter<typeof customInstance>;
92
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
93
- const queryOptions = getGetMerchantsQueryOptions(options);
94
-
95
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
96
- queryKey: QueryKey;
97
- };
98
-
99
- query.queryKey = queryOptions.queryKey;
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
- mId: number,
111
- options?: SecondParameter<typeof customInstance>,
112
- signal?: AbortSignal
146
+ mId: number,
147
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
113
148
  ) => {
114
- return customInstance<MerchantGetResponse>(
115
- { url: `/merchant/${mId}`, method: "get", signal },
116
- options
117
- );
118
- };
119
-
120
- export const getGetServiceQueryKey = (mId: number) =>
121
- ["account-server-api", `/merchant/${mId}`] as const;
122
-
123
- export const getGetServiceQueryOptions = <
124
- TData = Awaited<ReturnType<typeof getService>>,
125
- TError = ErrorType<AsError | void>
126
- >(
127
- mId: number,
128
- options?: {
129
- query?: UseQueryOptions<
130
- Awaited<ReturnType<typeof getService>>,
131
- TError,
132
- TData
133
- >;
134
- request?: SecondParameter<typeof customInstance>;
135
- }
136
- ): UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData> & {
137
- queryKey: QueryKey;
138
- } => {
139
- const { query: queryOptions, request: requestOptions } = options ?? {};
140
-
141
- const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
142
-
143
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({
144
- signal,
145
- }) => getService(mId, requestOptions, signal);
146
-
147
- return { queryKey, queryFn, enabled: !!mId, ...queryOptions };
148
- };
149
-
150
- export type GetServiceQueryResult = NonNullable<
151
- Awaited<ReturnType<typeof getService>>
152
- >;
153
- export type GetServiceQueryError = ErrorType<AsError | void>;
154
-
155
- export const useGetService = <
156
- TData = Awaited<ReturnType<typeof getService>>,
157
- TError = ErrorType<AsError | void>
158
- >(
159
- mId: number,
160
- options?: {
161
- query?: UseQueryOptions<
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
+