@squonk/account-server-client 2.4.1 → 3.0.0-rc.2

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 (51) hide show
  1. package/asset/package.json +6 -6
  2. package/charges/charges.cjs +188 -0
  3. package/charges/charges.cjs.map +1 -0
  4. package/charges/charges.d.cts +184 -0
  5. package/charges/charges.d.ts +184 -0
  6. package/charges/charges.js +188 -0
  7. package/charges/charges.js.map +1 -0
  8. package/charges/package.json +7 -0
  9. package/event-stream/package.json +6 -6
  10. package/index.cjs.map +1 -1
  11. package/index.d.cts +2 -2
  12. package/index.d.ts +2 -2
  13. package/index.js.map +1 -1
  14. package/merchant/package.json +6 -6
  15. package/organisation/organisation.cjs +1 -45
  16. package/organisation/organisation.cjs.map +1 -1
  17. package/organisation/organisation.d.cts +5 -48
  18. package/organisation/organisation.d.ts +5 -48
  19. package/organisation/organisation.js +0 -44
  20. package/organisation/organisation.js.map +1 -1
  21. package/organisation/package.json +6 -6
  22. package/package.json +1 -1
  23. package/product/package.json +6 -6
  24. package/product/product.cjs +1 -45
  25. package/product/product.cjs.map +1 -1
  26. package/product/product.d.cts +2 -48
  27. package/product/product.d.ts +2 -48
  28. package/product/product.js +0 -44
  29. package/product/product.js.map +1 -1
  30. package/src/account-server-api.schemas.ts +2 -2
  31. package/src/charges/charges.ts +487 -0
  32. package/src/organisation/organisation.ts +0 -114
  33. package/src/product/product.ts +1 -117
  34. package/src/unit/unit.ts +1 -116
  35. package/state/package.json +6 -6
  36. package/unit/package.json +6 -6
  37. package/unit/unit.cjs +1 -45
  38. package/unit/unit.cjs.map +1 -1
  39. package/unit/unit.d.cts +2 -47
  40. package/unit/unit.d.ts +2 -47
  41. package/unit/unit.js +0 -44
  42. package/unit/unit.js.map +1 -1
  43. package/user/package.json +6 -6
  44. package/admin/admin.cjs +0 -56
  45. package/admin/admin.cjs.map +0 -1
  46. package/admin/admin.d.cts +0 -50
  47. package/admin/admin.d.ts +0 -50
  48. package/admin/admin.js +0 -56
  49. package/admin/admin.js.map +0 -1
  50. package/admin/package.json +0 -7
  51. package/src/admin/admin.ts +0 -140
@@ -1,140 +0,0 @@
1
- /**
2
- * Generated by orval v6.25.0 🍺
3
- * Do not edit manually.
4
- * Account Server API
5
- * The Informatics Matters Account Server API.
6
-
7
- A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
8
-
9
- * OpenAPI spec version: 2.4
10
- */
11
- import {
12
- useQuery,
13
- useSuspenseQuery
14
- } from '@tanstack/react-query'
15
- import type {
16
- QueryFunction,
17
- QueryKey,
18
- UseQueryOptions,
19
- UseQueryResult,
20
- UseSuspenseQueryOptions,
21
- UseSuspenseQueryResult
22
- } from '@tanstack/react-query'
23
- import type {
24
- AsError,
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
-
34
-
35
- /**
36
- * Gets global Charges.
37
-
38
- You need admin rights to use this path.
39
-
40
- * @summary Gets charges for all Organisations
41
- */
42
- export const getCharges = (
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>}
62
- ) => {
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 ;
95
-
96
- return query;
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
-