@squonk/account-server-client 1.0.2 → 1.0.3-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.
Files changed (48) hide show
  1. package/asset/asset.cjs +34 -18
  2. package/asset/asset.cjs.map +1 -1
  3. package/asset/asset.d.ts +16 -16
  4. package/asset/asset.js +35 -19
  5. package/asset/asset.js.map +1 -1
  6. package/{custom-instance-e2d92e5c.d.ts → custom-instance-93fb01eb.d.ts} +17 -17
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js.map +1 -1
  10. package/merchant/merchant.cjs +15 -13
  11. package/merchant/merchant.cjs.map +1 -1
  12. package/merchant/merchant.d.ts +1 -1
  13. package/merchant/merchant.js +16 -14
  14. package/merchant/merchant.js.map +1 -1
  15. package/organisation/organisation.cjs +18 -6
  16. package/organisation/organisation.cjs.map +1 -1
  17. package/organisation/organisation.d.ts +7 -7
  18. package/organisation/organisation.js +19 -7
  19. package/organisation/organisation.js.map +1 -1
  20. package/package.json +1 -1
  21. package/product/product.cjs +47 -38
  22. package/product/product.cjs.map +1 -1
  23. package/product/product.d.ts +10 -10
  24. package/product/product.js +48 -39
  25. package/product/product.js.map +1 -1
  26. package/src/account-server-api.schemas.ts +68 -84
  27. package/src/asset/asset.ts +248 -345
  28. package/src/merchant/merchant.ts +62 -84
  29. package/src/organisation/organisation.ts +131 -184
  30. package/src/product/product.ts +279 -422
  31. package/src/state/state.ts +36 -42
  32. package/src/unit/unit.ts +218 -301
  33. package/src/user/user.ts +224 -327
  34. package/state/state.cjs +9 -9
  35. package/state/state.cjs.map +1 -1
  36. package/state/state.d.ts +1 -1
  37. package/state/state.js +10 -10
  38. package/state/state.js.map +1 -1
  39. package/unit/unit.cjs +40 -25
  40. package/unit/unit.cjs.map +1 -1
  41. package/unit/unit.d.ts +10 -10
  42. package/unit/unit.js +41 -26
  43. package/unit/unit.js.map +1 -1
  44. package/user/user.cjs +38 -20
  45. package/user/user.cjs.map +1 -1
  46. package/user/user.d.ts +10 -10
  47. package/user/user.js +39 -21
  48. package/user/user.js.map +1 -1
@@ -8,24 +8,27 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 1.0
10
10
  */
11
- import { useQuery } from "react-query";
11
+ import {
12
+ useQuery
13
+ } from 'react-query'
12
14
  import type {
13
15
  UseQueryOptions,
14
16
  QueryFunction,
15
17
  UseQueryResult,
16
- QueryKey,
17
- } from "react-query";
18
+ QueryKey
19
+ } from 'react-query'
18
20
  import type {
19
21
  StateGetVersionResponse,
20
- AsError,
21
- } from "../account-server-api.schemas";
22
- import { customInstance } from ".././custom-instance";
23
- import type { ErrorType } from ".././custom-instance";
22
+ AsError
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;
@@ -34,48 +37,39 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
34
37
  * @summary Gets the Account Server version
35
38
  */
36
39
  export const getVersion = (
37
- options?: SecondParameter<typeof customInstance>,
38
- signal?: AbortSignal
40
+
41
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
39
42
  ) => {
40
- return customInstance<StateGetVersionResponse>(
41
- { url: `/version`, method: "get", signal },
42
- options
43
- );
44
- };
43
+ return customInstance<StateGetVersionResponse>(
44
+ {url: `/version`, method: 'get', signal
45
+ },
46
+ options);
47
+ }
48
+
45
49
 
46
50
  export const getGetVersionQueryKey = () => [`/version`];
47
51
 
48
- export type GetVersionQueryResult = NonNullable<
49
- Awaited<ReturnType<typeof getVersion>>
50
- >;
51
- export type GetVersionQueryError = ErrorType<AsError | void>;
52
-
53
- export const useGetVersion = <
54
- TData = Awaited<ReturnType<typeof getVersion>>,
55
- TError = ErrorType<AsError | void>
56
- >(options?: {
57
- query?: UseQueryOptions<
58
- Awaited<ReturnType<typeof getVersion>>,
59
- TError,
60
- TData
61
- >;
62
- request?: SecondParameter<typeof customInstance>;
63
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
64
- const { query: queryOptions, request: requestOptions } = options ?? {};
52
+
53
+ export type GetVersionQueryResult = NonNullable<Awaited<ReturnType<typeof getVersion>>>
54
+ export type GetVersionQueryError = ErrorType<AsError | void>
55
+
56
+ export const useGetVersion = <TData = Awaited<ReturnType<typeof getVersion>>, TError = ErrorType<AsError | void>>(
57
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getVersion>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
58
+
59
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
60
+
61
+ const {query: queryOptions, request: requestOptions} = options ?? {}
65
62
 
66
63
  const queryKey = queryOptions?.queryKey ?? getGetVersionQueryKey();
67
64
 
68
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({
69
- signal,
70
- }) => getVersion(requestOptions, signal);
65
+
66
+
67
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getVersion>>> = ({ signal }) => getVersion(requestOptions, signal);
71
68
 
72
- const query = useQuery<Awaited<ReturnType<typeof getVersion>>, TError, TData>(
73
- queryKey,
74
- queryFn,
75
- queryOptions
76
- ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
69
+ const query = useQuery<Awaited<ReturnType<typeof getVersion>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
77
70
 
78
71
  query.queryKey = queryKey;
79
72
 
80
73
  return query;
81
- };
74
+ }
75
+