@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
- ChargesGetResponse,
20
24
  AsError,
21
- GetChargesParams,
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
+ ChargesGetResponse,
26
+ GetChargesParams
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 global Charges.
@@ -39,72 +40,101 @@ You need admin rights to use this path.
39
40
  * @summary Gets charges for all Organisations
40
41
  */
41
42
  export const getCharges = (
42
- params?: GetChargesParams,
43
- options?: SecondParameter<typeof customInstance>,
44
- signal?: AbortSignal
43
+ params?: GetChargesParams,
44
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
45
+ ) => {
46
+
47
+
48
+ return customInstance<ChargesGetResponse>(
49
+ {url: `/charges`, method: 'GET',
50
+ params, signal
51
+ },
52
+ options);
53
+ }
54
+
55
+
56
+ export const getGetChargesQueryKey = (params?: GetChargesParams,) => {
57
+ return ["account-server-api", `/charges`, ...(params ? [params]: [])] as const;
58
+ }
59
+
60
+
61
+ export const getGetChargesQueryOptions = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(params?: GetChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
45
62
  ) => {
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;
63
+
64
+ const {query: queryOptions, request: requestOptions} = options ?? {};
65
+
66
+ const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
67
+
68
+
69
+
70
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) => getCharges(params, requestOptions, signal);
71
+
72
+
73
+
74
+
75
+
76
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & { queryKey: QueryKey }
77
+ }
78
+
79
+ export type GetChargesQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>
80
+ export type GetChargesQueryError = ErrorType<void | AsError>
81
+
82
+ /**
83
+ * @summary Gets charges for all Organisations
84
+ */
85
+ export const useGetCharges = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(
86
+ params?: GetChargesParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
87
+
88
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
89
+
90
+ const queryOptions = getGetChargesQueryOptions(params,options)
91
+
92
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
93
+
94
+ query.queryKey = queryOptions.queryKey ;
108
95
 
109
96
  return query;
110
- };
97
+ }
98
+
99
+
100
+
101
+ export const getGetChargesSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(params?: GetChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
102
+ ) => {
103
+
104
+ const {query: queryOptions, request: requestOptions} = options ?? {};
105
+
106
+ const queryKey = queryOptions?.queryKey ?? getGetChargesQueryKey(params);
107
+
108
+
109
+
110
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getCharges>>> = ({ signal }) => getCharges(params, requestOptions, signal);
111
+
112
+
113
+
114
+
115
+
116
+ return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData> & { queryKey: QueryKey }
117
+ }
118
+
119
+ export type GetChargesSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getCharges>>>
120
+ export type GetChargesSuspenseQueryError = ErrorType<void | AsError>
121
+
122
+ /**
123
+ * @summary Gets charges for all Organisations
124
+ */
125
+ export const useGetChargesSuspense = <TData = Awaited<ReturnType<typeof getCharges>>, TError = ErrorType<void | AsError>>(
126
+ params?: GetChargesParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getCharges>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
127
+
128
+ ): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } => {
129
+
130
+ const queryOptions = getGetChargesSuspenseQueryOptions(params,options)
131
+
132
+ const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
133
+
134
+ query.queryKey = queryOptions.queryKey ;
135
+
136
+ return query;
137
+ }
138
+
139
+
140
+