@squonk/account-server-client 2.0.6 → 2.0.8

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 (70) hide show
  1. package/admin/admin.cjs +14 -7
  2. package/admin/admin.cjs.map +1 -1
  3. package/admin/admin.d.cts +33 -0
  4. package/admin/admin.d.ts +4 -1
  5. package/admin/admin.js +14 -7
  6. package/admin/admin.js.map +1 -1
  7. package/asset/asset.cjs +44 -19
  8. package/asset/asset.cjs.map +1 -1
  9. package/asset/asset.d.cts +241 -0
  10. package/asset/asset.d.ts +43 -19
  11. package/asset/asset.js +37 -12
  12. package/asset/asset.js.map +1 -1
  13. package/{chunk-UZTHSGDT.cjs → chunk-J22A7LHX.cjs} +1 -1
  14. package/chunk-J22A7LHX.cjs.map +1 -0
  15. package/{chunk-3RNIDX7T.js → chunk-UKA7G3OB.js} +1 -1
  16. package/{chunk-3RNIDX7T.js.map → chunk-UKA7G3OB.js.map} +1 -1
  17. package/{custom-instance-f32f6506.d.ts → custom-instance-13ade7a9.d.ts} +159 -159
  18. package/index.cjs +10 -10
  19. package/index.cjs.map +1 -1
  20. package/index.d.cts +2 -0
  21. package/index.d.ts +1 -1
  22. package/index.js +9 -9
  23. package/index.js.map +1 -1
  24. package/merchant/merchant.cjs +23 -13
  25. package/merchant/merchant.cjs.map +1 -1
  26. package/merchant/merchant.d.cts +57 -0
  27. package/merchant/merchant.d.ts +7 -1
  28. package/merchant/merchant.js +22 -12
  29. package/merchant/merchant.js.map +1 -1
  30. package/organisation/organisation.cjs +50 -25
  31. package/organisation/organisation.cjs.map +1 -1
  32. package/organisation/organisation.d.cts +203 -0
  33. package/organisation/organisation.d.ts +31 -10
  34. package/organisation/organisation.js +44 -19
  35. package/organisation/organisation.js.map +1 -1
  36. package/package.json +12 -12
  37. package/product/product.cjs +80 -44
  38. package/product/product.cjs.map +1 -1
  39. package/product/product.d.cts +280 -0
  40. package/product/product.d.ts +40 -10
  41. package/product/product.js +71 -35
  42. package/product/product.js.map +1 -1
  43. package/src/account-server-api.schemas.ts +268 -276
  44. package/src/admin/admin.ts +72 -78
  45. package/src/asset/asset.ts +447 -556
  46. package/src/merchant/merchant.ts +125 -136
  47. package/src/organisation/organisation.ts +394 -484
  48. package/src/product/product.ts +557 -682
  49. package/src/state/state.ts +70 -69
  50. package/src/unit/unit.ts +494 -593
  51. package/src/user/user.ts +377 -463
  52. package/state/state.cjs +13 -7
  53. package/state/state.cjs.map +1 -1
  54. package/state/state.d.cts +29 -0
  55. package/state/state.d.ts +4 -1
  56. package/state/state.js +13 -7
  57. package/state/state.js.map +1 -1
  58. package/unit/unit.cjs +59 -28
  59. package/unit/unit.cjs.map +1 -1
  60. package/unit/unit.d.cts +254 -0
  61. package/unit/unit.d.ts +43 -16
  62. package/unit/unit.js +52 -21
  63. package/unit/unit.js.map +1 -1
  64. package/user/user.cjs +52 -21
  65. package/user/user.cjs.map +1 -1
  66. package/user/user.d.cts +220 -0
  67. package/user/user.d.ts +31 -10
  68. package/user/user.js +46 -15
  69. package/user/user.js.map +1 -1
  70. 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.20.0 🍺
3
3
  * Do not edit manually.
4
4
  * Account Server API
5
5
  * The Informatics Matters Account Server API.
@@ -8,29 +8,33 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 2.0
10
10
  */
11
- import { useQuery } from "@tanstack/react-query";
11
+ import {
12
+ useQuery
13
+ } from '@tanstack/react-query'
12
14
  import type {
13
- UseQueryOptions,
14
15
  QueryFunction,
15
- UseQueryResult,
16
16
  QueryKey,
17
- } from "@tanstack/react-query";
17
+ UseQueryOptions,
18
+ UseQueryResult
19
+ } from '@tanstack/react-query'
18
20
  import type {
19
- ChargesGetResponse,
20
21
  AsError,
21
- GetChargesParams,
22
- } from "../account-server-api.schemas";
23
- import { customInstance } from ".././custom-instance";
24
- import type { ErrorType } from ".././custom-instance";
22
+ ChargesGetResponse,
23
+ GetChargesParams
24
+ } from '../account-server-api.schemas'
25
+ import { customInstance } from '.././custom-instance';
26
+ import type { ErrorType } from '.././custom-instance';
27
+
25
28
 
26
29
  // eslint-disable-next-line
27
- type SecondParameter<T extends (...args: any) => any> = T extends (
30
+ type SecondParameter<T extends (...args: any) => any> = T extends (
28
31
  config: any,
29
- args: infer P
32
+ args: infer P,
30
33
  ) => any
31
34
  ? P
32
35
  : never;
33
36
 
37
+
34
38
  /**
35
39
  * Gets global Charges.
36
40
 
@@ -39,72 +43,62 @@ You need admin rights to use this path.
39
43
  * @summary Gets charges for all Organisations
40
44
  */
41
45
  export const getCharges = (
42
- params?: GetChargesParams,
43
- options?: SecondParameter<typeof customInstance>,
44
- signal?: AbortSignal
46
+ params?: GetChargesParams,
47
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
48
+ ) => {
49
+
50
+
51
+ return customInstance<ChargesGetResponse>(
52
+ {url: `/charges`, method: 'get',
53
+ params, signal
54
+ },
55
+ options);
56
+ }
57
+
58
+
59
+ export const getGetChargesQueryKey = (params?: GetChargesParams,) => {
60
+
61
+ return ["account-server-api", `/charges`, ...(params ? [params]: [])] as const;
62
+ }
63
+
64
+
65
+ export const getGetChargesQueryOptions = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(params?: GetChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
45
66
  ) => {
46
- return customInstance<ChargesGetResponse>(
47
- { url: `/charges`, method: "get", params, signal },
48
- options
49
- );
50
- };
51
-
52
- export const getGetChargesQueryKey = (params?: GetChargesParams) =>
53
- ["account-server-api", `/charges`, ...(params ? [params] : [])] as const;
54
-
55
- export const getGetChargesQueryOptions = <
56
- TData = Awaited<ReturnType<typeof getCharges>>,
57
- TError = ErrorType<void | AsError>
58
- >(
59
- params?: GetChargesParams,
60
- options?: {
61
- query?: UseQueryOptions<
62
- Awaited<ReturnType<typeof getCharges>>,
63
- TError,
64
- TData
65
- >;
66
- request?: SecondParameter<typeof customInstance>;
67
- }
68
- ): UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & {
69
- queryKey: QueryKey;
70
- } => {
71
- const { query: queryOptions, request: requestOptions } = options ?? {};
72
-
73
- const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
74
-
75
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({
76
- signal,
77
- }) => getCharges(params, requestOptions, signal);
78
-
79
- return { queryKey, queryFn, ...queryOptions };
80
- };
81
-
82
- export type GetChargesQueryResult = NonNullable<
83
- Awaited<ReturnType<typeof getCharges>>
84
- >;
85
- export type GetChargesQueryError = ErrorType<void | AsError>;
86
-
87
- export const useGetCharges = <
88
- TData = Awaited<ReturnType<typeof getCharges>>,
89
- TError = ErrorType<void | AsError>
90
- >(
91
- params?: GetChargesParams,
92
- options?: {
93
- query?: UseQueryOptions<
94
- Awaited<ReturnType<typeof getCharges>>,
95
- TError,
96
- TData
97
- >;
98
- request?: SecondParameter<typeof customInstance>;
99
- }
100
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
101
- const queryOptions = getGetChargesQueryOptions(params, options);
102
-
103
- const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
104
- queryKey: QueryKey;
105
- };
106
-
107
- query.queryKey = queryOptions.queryKey;
67
+
68
+ const {query: queryOptions, request: requestOptions} = options ?? {};
69
+
70
+ const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
71
+
72
+
73
+
74
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) => getCharges(params, requestOptions, signal);
75
+
76
+
77
+
78
+
79
+
80
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & { queryKey: QueryKey }
81
+ }
82
+
83
+ export type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>
84
+ export type GetChargesQueryError = ErrorType<void | AsError>
85
+
86
+ /**
87
+ * @summary Gets charges for all Organisations
88
+ */
89
+ export const useGetCharges = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(
90
+ params?: GetChargesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
91
+
92
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
93
+
94
+ const queryOptions = getGetChargesQueryOptions(params,options)
95
+
96
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
97
+
98
+ query.queryKey = queryOptions.queryKey ;
108
99
 
109
100
  return query;
110
- };
101
+ }
102
+
103
+
104
+