@squonk/account-server-client 4.0.1-rc.3 → 4.1.1-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.
- package/asset/asset.cjs +18 -10
- package/asset/asset.cjs.map +1 -1
- package/asset/asset.d.cts +60 -60
- package/asset/asset.d.ts +60 -60
- package/asset/asset.js +18 -10
- package/asset/asset.js.map +1 -1
- package/charges/charges.cjs +3 -3
- package/charges/charges.cjs.map +1 -1
- package/charges/charges.d.cts +33 -33
- package/charges/charges.d.ts +33 -33
- package/charges/charges.js +3 -3
- package/charges/charges.js.map +1 -1
- package/event-stream/event-stream.cjs +8 -5
- package/event-stream/event-stream.cjs.map +1 -1
- package/event-stream/event-stream.d.cts +30 -30
- package/event-stream/event-stream.d.ts +30 -30
- package/event-stream/event-stream.js +8 -5
- package/event-stream/event-stream.js.map +1 -1
- package/index.cjs +8 -8
- package/index.cjs.map +1 -1
- package/index.d.cts +212 -196
- package/index.d.ts +212 -196
- package/index.js +8 -8
- package/index.js.map +1 -1
- package/merchant/merchant.cjs +1 -1
- package/merchant/merchant.cjs.map +1 -1
- package/merchant/merchant.d.cts +17 -17
- package/merchant/merchant.d.ts +17 -17
- package/merchant/merchant.js +1 -1
- package/merchant/merchant.js.map +1 -1
- package/organisation/organisation.cjs +24 -19
- package/organisation/organisation.cjs.map +1 -1
- package/organisation/organisation.d.cts +56 -56
- package/organisation/organisation.d.ts +56 -56
- package/organisation/organisation.js +24 -19
- package/organisation/organisation.js.map +1 -1
- package/package.json +11 -11
- package/product/product.cjs +12 -8
- package/product/product.cjs.map +1 -1
- package/product/product.d.cts +68 -68
- package/product/product.d.ts +68 -68
- package/product/product.js +12 -8
- package/product/product.js.map +1 -1
- package/src/account-server-api.schemas.ts +219 -200
- package/src/asset/asset.ts +121 -84
- package/src/charges/charges.ts +51 -50
- package/src/event-stream/event-stream.ts +56 -44
- package/src/merchant/merchant.ts +27 -26
- package/src/organisation/organisation.ts +104 -85
- package/src/product/product.ts +117 -100
- package/src/state/state.ts +15 -14
- package/src/unit/unit.ts +130 -101
- package/src/user/user.ts +91 -70
- package/state/state.cjs.map +1 -1
- package/state/state.d.cts +9 -9
- package/state/state.d.ts +9 -9
- package/state/state.js.map +1 -1
- package/unit/unit.cjs +29 -22
- package/unit/unit.cjs.map +1 -1
- package/unit/unit.d.cts +68 -68
- package/unit/unit.d.ts +68 -68
- package/unit/unit.js +29 -22
- package/unit/unit.js.map +1 -1
- package/user/user.cjs +10 -6
- package/user/user.cjs.map +1 -1
- package/user/user.d.cts +49 -49
- package/user/user.d.ts +49 -49
- package/user/user.js +10 -6
- package/user/user.js.map +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
/**
|
|
3
|
-
* Generated by orval v7.
|
|
3
|
+
* Generated by orval v7.4.1 🍺
|
|
4
4
|
* Do not edit manually.
|
|
5
5
|
* Account Server API
|
|
6
6
|
* The Informatics Matters Account Server API.
|
|
7
7
|
|
|
8
8
|
A service that provides access to the Account Server, which gives *registered* users access to and management of **Organisations**, **Units**, **Products**, **Users**, and **Assets**.
|
|
9
9
|
|
|
10
|
-
* OpenAPI spec version: 4.
|
|
10
|
+
* OpenAPI spec version: 4.1
|
|
11
11
|
*/
|
|
12
12
|
import {
|
|
13
13
|
useMutation,
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
useSuspenseQuery
|
|
16
16
|
} from '@tanstack/react-query'
|
|
17
17
|
import type {
|
|
18
|
+
DataTag,
|
|
18
19
|
DefinedInitialDataOptions,
|
|
19
20
|
DefinedUseQueryResult,
|
|
20
21
|
MutationFunction,
|
|
@@ -30,6 +31,7 @@ import type {
|
|
|
30
31
|
} from '@tanstack/react-query'
|
|
31
32
|
import type {
|
|
32
33
|
AsError,
|
|
34
|
+
GetOrganisationsParams,
|
|
33
35
|
OrganisationAllDetail,
|
|
34
36
|
OrganisationGetDefaultResponse,
|
|
35
37
|
OrganisationPatchBodyBody,
|
|
@@ -45,46 +47,47 @@ type SecondParameter<T extends (...args: any) => any> = Parameters<T>[1];
|
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
* Gets all the Organisations that you are a member of.
|
|
50
|
+
* Gets all the Organisations that you are a member of, or a specific Organisation by name.
|
|
49
51
|
|
|
50
52
|
You can see an Organisation if you are a member of it, the owner (creator) of it, or if you are an admin user.
|
|
51
53
|
|
|
52
54
|
* @summary Gets Organisations
|
|
53
55
|
*/
|
|
54
56
|
export const getOrganisations = (
|
|
55
|
-
|
|
57
|
+
params?: GetOrganisationsParams,
|
|
56
58
|
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
57
59
|
) => {
|
|
58
60
|
|
|
59
61
|
|
|
60
62
|
return customInstance<OrganisationsGetResponse>(
|
|
61
|
-
{url: `/organisation`, method: 'GET',
|
|
63
|
+
{url: `/organisation`, method: 'GET',
|
|
64
|
+
params, signal
|
|
62
65
|
},
|
|
63
66
|
options);
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
|
|
67
|
-
export const getGetOrganisationsQueryKey = () => {
|
|
68
|
-
return ["account-server-api", `/organisation
|
|
70
|
+
export const getGetOrganisationsQueryKey = (params?: GetOrganisationsParams,) => {
|
|
71
|
+
return ["account-server-api", `/organisation`, ...(params ? [params]: [])] as const;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
|
|
72
|
-
export const getGetOrganisationsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
75
|
+
export const getGetOrganisationsQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
73
76
|
) => {
|
|
74
77
|
|
|
75
78
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
76
79
|
|
|
77
|
-
const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();
|
|
80
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);
|
|
78
81
|
|
|
79
82
|
|
|
80
83
|
|
|
81
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);
|
|
84
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(params, requestOptions, signal);
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
|
|
85
88
|
|
|
86
89
|
|
|
87
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: QueryKey }
|
|
90
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
export type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
|
|
@@ -92,7 +95,7 @@ export type GetOrganisationsQueryError = ErrorType<void | AsError>
|
|
|
92
95
|
|
|
93
96
|
|
|
94
97
|
export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
95
|
-
options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> & Pick<
|
|
98
|
+
params: undefined | GetOrganisationsParams, options: { query:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> & Pick<
|
|
96
99
|
DefinedInitialDataOptions<
|
|
97
100
|
Awaited<ReturnType<typeof getOrganisations>>,
|
|
98
101
|
TError,
|
|
@@ -100,9 +103,9 @@ export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganis
|
|
|
100
103
|
> , 'initialData'
|
|
101
104
|
>, request?: SecondParameter<typeof customInstance>}
|
|
102
105
|
|
|
103
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
106
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
104
107
|
export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
105
|
-
|
|
108
|
+
params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>> & Pick<
|
|
106
109
|
UndefinedInitialDataOptions<
|
|
107
110
|
Awaited<ReturnType<typeof getOrganisations>>,
|
|
108
111
|
TError,
|
|
@@ -110,23 +113,23 @@ export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganis
|
|
|
110
113
|
> , 'initialData'
|
|
111
114
|
>, request?: SecondParameter<typeof customInstance>}
|
|
112
115
|
|
|
113
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
116
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
114
117
|
export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
115
|
-
|
|
118
|
+
params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
116
119
|
|
|
117
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
120
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
118
121
|
/**
|
|
119
122
|
* @summary Gets Organisations
|
|
120
123
|
*/
|
|
121
124
|
|
|
122
125
|
export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
123
|
-
|
|
126
|
+
params?: GetOrganisationsParams, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
124
127
|
|
|
125
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
128
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
126
129
|
|
|
127
|
-
const queryOptions = getGetOrganisationsQueryOptions(options)
|
|
130
|
+
const queryOptions = getGetOrganisationsQueryOptions(params,options)
|
|
128
131
|
|
|
129
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
132
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
130
133
|
|
|
131
134
|
query.queryKey = queryOptions.queryKey ;
|
|
132
135
|
|
|
@@ -135,22 +138,22 @@ export function useGetOrganisations<TData = Awaited<ReturnType<typeof getOrganis
|
|
|
135
138
|
|
|
136
139
|
|
|
137
140
|
|
|
138
|
-
export const getGetOrganisationsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>( options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
141
|
+
export const getGetOrganisationsSuspenseQueryOptions = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
139
142
|
) => {
|
|
140
143
|
|
|
141
144
|
const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
142
145
|
|
|
143
|
-
const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();
|
|
146
|
+
const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey(params);
|
|
144
147
|
|
|
145
148
|
|
|
146
149
|
|
|
147
|
-
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);
|
|
150
|
+
const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(params, requestOptions, signal);
|
|
148
151
|
|
|
149
152
|
|
|
150
153
|
|
|
151
154
|
|
|
152
155
|
|
|
153
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: QueryKey }
|
|
156
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
export type GetOrganisationsSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
|
|
@@ -158,29 +161,29 @@ export type GetOrganisationsSuspenseQueryError = ErrorType<void | AsError>
|
|
|
158
161
|
|
|
159
162
|
|
|
160
163
|
export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
161
|
-
options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
164
|
+
params: undefined | GetOrganisationsParams, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
162
165
|
|
|
163
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
166
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
164
167
|
export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
165
|
-
|
|
168
|
+
params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
166
169
|
|
|
167
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
170
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
168
171
|
export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
169
|
-
|
|
172
|
+
params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
170
173
|
|
|
171
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
174
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
172
175
|
/**
|
|
173
176
|
* @summary Gets Organisations
|
|
174
177
|
*/
|
|
175
178
|
|
|
176
179
|
export function useGetOrganisationsSuspense<TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
|
|
177
|
-
|
|
180
|
+
params?: GetOrganisationsParams, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
178
181
|
|
|
179
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
182
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
180
183
|
|
|
181
|
-
const queryOptions = getGetOrganisationsSuspenseQueryOptions(options)
|
|
184
|
+
const queryOptions = getGetOrganisationsSuspenseQueryOptions(params,options)
|
|
182
185
|
|
|
183
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
186
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
184
187
|
|
|
185
188
|
query.queryKey = queryOptions.queryKey ;
|
|
186
189
|
|
|
@@ -200,23 +203,29 @@ You need admin rights to use this method
|
|
|
200
203
|
*/
|
|
201
204
|
export const createOrganisation = (
|
|
202
205
|
organisationPostBodyBody: OrganisationPostBodyBody,
|
|
203
|
-
options?: SecondParameter<typeof customInstance>,
|
|
206
|
+
options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
|
|
207
|
+
) => {
|
|
204
208
|
|
|
205
209
|
|
|
206
210
|
return customInstance<OrganisationPostResponse>(
|
|
207
211
|
{url: `/organisation`, method: 'POST',
|
|
208
212
|
headers: {'Content-Type': 'application/json', },
|
|
209
|
-
data: organisationPostBodyBody
|
|
213
|
+
data: organisationPostBodyBody, signal
|
|
210
214
|
},
|
|
211
215
|
options);
|
|
212
216
|
}
|
|
213
217
|
|
|
214
218
|
|
|
215
219
|
|
|
216
|
-
export const getCreateOrganisationMutationOptions = <TError = ErrorType<AsError | void>,
|
|
217
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<
|
|
218
|
-
)
|
|
219
|
-
const
|
|
220
|
+
export const getCreateOrganisationMutationOptions = <TData = Awaited<ReturnType<typeof createOrganisation>>, TError = ErrorType<AsError | void>,
|
|
221
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
222
|
+
) => {
|
|
223
|
+
const mutationKey = ['createOrganisation'];
|
|
224
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
225
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
226
|
+
options
|
|
227
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
228
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
220
229
|
|
|
221
230
|
|
|
222
231
|
|
|
@@ -230,7 +239,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
|
230
239
|
|
|
231
240
|
|
|
232
241
|
|
|
233
|
-
return { mutationFn, ...mutationOptions }}
|
|
242
|
+
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{data: OrganisationPostBodyBody}, TContext>}
|
|
234
243
|
|
|
235
244
|
export type CreateOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisation>>>
|
|
236
245
|
export type CreateOrganisationMutationBody = OrganisationPostBodyBody
|
|
@@ -239,10 +248,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
|
239
248
|
/**
|
|
240
249
|
* @summary Create a new organisation
|
|
241
250
|
*/
|
|
242
|
-
export const useCreateOrganisation = <TError = ErrorType<AsError | void>,
|
|
243
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<
|
|
251
|
+
export const useCreateOrganisation = <TData = Awaited<ReturnType<typeof createOrganisation>>, TError = ErrorType<AsError | void>,
|
|
252
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
244
253
|
): UseMutationResult<
|
|
245
|
-
|
|
254
|
+
TData,
|
|
246
255
|
TError,
|
|
247
256
|
{data: OrganisationPostBodyBody},
|
|
248
257
|
TContext
|
|
@@ -292,7 +301,7 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
292
301
|
|
|
293
302
|
|
|
294
303
|
|
|
295
|
-
return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: QueryKey }
|
|
304
|
+
return { queryKey, queryFn, enabled: !!(orgId), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
296
305
|
}
|
|
297
306
|
|
|
298
307
|
export type GetOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>
|
|
@@ -308,7 +317,7 @@ export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisa
|
|
|
308
317
|
> , 'initialData'
|
|
309
318
|
>, request?: SecondParameter<typeof customInstance>}
|
|
310
319
|
|
|
311
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
320
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
312
321
|
export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
313
322
|
orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>> & Pick<
|
|
314
323
|
UndefinedInitialDataOptions<
|
|
@@ -318,11 +327,11 @@ export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisa
|
|
|
318
327
|
> , 'initialData'
|
|
319
328
|
>, request?: SecondParameter<typeof customInstance>}
|
|
320
329
|
|
|
321
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
330
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
322
331
|
export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
323
332
|
orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
324
333
|
|
|
325
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
334
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
326
335
|
/**
|
|
327
336
|
* @summary Gets an Organisation
|
|
328
337
|
*/
|
|
@@ -330,11 +339,11 @@ export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisa
|
|
|
330
339
|
export function useGetOrganisation<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
331
340
|
orgId: string, options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
332
341
|
|
|
333
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
342
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
334
343
|
|
|
335
344
|
const queryOptions = getGetOrganisationQueryOptions(orgId,options)
|
|
336
345
|
|
|
337
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
346
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
338
347
|
|
|
339
348
|
query.queryKey = queryOptions.queryKey ;
|
|
340
349
|
|
|
@@ -358,7 +367,7 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
358
367
|
|
|
359
368
|
|
|
360
369
|
|
|
361
|
-
return { queryKey, queryFn,
|
|
370
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
362
371
|
}
|
|
363
372
|
|
|
364
373
|
export type GetOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisation>>>
|
|
@@ -368,15 +377,15 @@ export type GetOrganisationSuspenseQueryError = ErrorType<void | AsError>
|
|
|
368
377
|
export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
369
378
|
orgId: string, options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
370
379
|
|
|
371
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
380
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
372
381
|
export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
373
382
|
orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
374
383
|
|
|
375
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
384
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
376
385
|
export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
377
386
|
orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
378
387
|
|
|
379
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
388
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
380
389
|
/**
|
|
381
390
|
* @summary Gets an Organisation
|
|
382
391
|
*/
|
|
@@ -384,11 +393,11 @@ export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof get
|
|
|
384
393
|
export function useGetOrganisationSuspense<TData = Awaited<ReturnType<typeof getOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
385
394
|
orgId: string, options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
386
395
|
|
|
387
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
396
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
388
397
|
|
|
389
398
|
const queryOptions = getGetOrganisationSuspenseQueryOptions(orgId,options)
|
|
390
399
|
|
|
391
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
400
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
392
401
|
|
|
393
402
|
query.queryKey = queryOptions.queryKey ;
|
|
394
403
|
|
|
@@ -420,10 +429,15 @@ export const patchOrganisation = (
|
|
|
420
429
|
|
|
421
430
|
|
|
422
431
|
|
|
423
|
-
export const getPatchOrganisationMutationOptions = <TError = ErrorType<void | AsError>,
|
|
424
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<
|
|
425
|
-
)
|
|
426
|
-
const
|
|
432
|
+
export const getPatchOrganisationMutationOptions = <TData = Awaited<ReturnType<typeof patchOrganisation>>, TError = ErrorType<void | AsError>,
|
|
433
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
434
|
+
) => {
|
|
435
|
+
const mutationKey = ['patchOrganisation'];
|
|
436
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
437
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
438
|
+
options
|
|
439
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
440
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
427
441
|
|
|
428
442
|
|
|
429
443
|
|
|
@@ -437,7 +451,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
|
437
451
|
|
|
438
452
|
|
|
439
453
|
|
|
440
|
-
return { mutationFn, ...mutationOptions }}
|
|
454
|
+
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>}
|
|
441
455
|
|
|
442
456
|
export type PatchOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof patchOrganisation>>>
|
|
443
457
|
export type PatchOrganisationMutationBody = OrganisationPatchBodyBody
|
|
@@ -446,10 +460,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
|
446
460
|
/**
|
|
447
461
|
* @summary Adjust an existing Organisation
|
|
448
462
|
*/
|
|
449
|
-
export const usePatchOrganisation = <TError = ErrorType<void | AsError>,
|
|
450
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<
|
|
463
|
+
export const usePatchOrganisation = <TData = Awaited<ReturnType<typeof patchOrganisation>>, TError = ErrorType<void | AsError>,
|
|
464
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string;data: OrganisationPatchBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
451
465
|
): UseMutationResult<
|
|
452
|
-
|
|
466
|
+
TData,
|
|
453
467
|
TError,
|
|
454
468
|
{orgId: string;data: OrganisationPatchBodyBody},
|
|
455
469
|
TContext
|
|
@@ -479,10 +493,15 @@ export const deleteOrganisation = (
|
|
|
479
493
|
|
|
480
494
|
|
|
481
495
|
|
|
482
|
-
export const getDeleteOrganisationMutationOptions = <TError = ErrorType<AsError | void>,
|
|
483
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<
|
|
484
|
-
)
|
|
485
|
-
const
|
|
496
|
+
export const getDeleteOrganisationMutationOptions = <TData = Awaited<ReturnType<typeof deleteOrganisation>>, TError = ErrorType<AsError | void>,
|
|
497
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
498
|
+
) => {
|
|
499
|
+
const mutationKey = ['deleteOrganisation'];
|
|
500
|
+
const {mutation: mutationOptions, request: requestOptions} = options ?
|
|
501
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
502
|
+
options
|
|
503
|
+
: {...options, mutation: {...options.mutation, mutationKey}}
|
|
504
|
+
: {mutation: { mutationKey, }, request: undefined};
|
|
486
505
|
|
|
487
506
|
|
|
488
507
|
|
|
@@ -496,7 +515,7 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
|
496
515
|
|
|
497
516
|
|
|
498
517
|
|
|
499
|
-
return { mutationFn, ...mutationOptions }}
|
|
518
|
+
return { mutationFn, ...mutationOptions } as UseMutationOptions<TData, TError,{orgId: string}, TContext>}
|
|
500
519
|
|
|
501
520
|
export type DeleteOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisation>>>
|
|
502
521
|
|
|
@@ -505,10 +524,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?? {};
|
|
|
505
524
|
/**
|
|
506
525
|
* @summary Deletes an Organisation
|
|
507
526
|
*/
|
|
508
|
-
export const useDeleteOrganisation = <TError = ErrorType<AsError | void>,
|
|
509
|
-
TContext = unknown>(options?: { mutation?:UseMutationOptions<
|
|
527
|
+
export const useDeleteOrganisation = <TData = Awaited<ReturnType<typeof deleteOrganisation>>, TError = ErrorType<AsError | void>,
|
|
528
|
+
TContext = unknown>(options?: { mutation?:UseMutationOptions<TData, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
|
|
510
529
|
): UseMutationResult<
|
|
511
|
-
|
|
530
|
+
TData,
|
|
512
531
|
TError,
|
|
513
532
|
{orgId: string},
|
|
514
533
|
TContext
|
|
@@ -558,7 +577,7 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
558
577
|
|
|
559
578
|
|
|
560
579
|
|
|
561
|
-
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: QueryKey }
|
|
580
|
+
return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
562
581
|
}
|
|
563
582
|
|
|
564
583
|
export type GetDefaultOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
|
|
@@ -574,7 +593,7 @@ export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getD
|
|
|
574
593
|
> , 'initialData'
|
|
575
594
|
>, request?: SecondParameter<typeof customInstance>}
|
|
576
595
|
|
|
577
|
-
): DefinedUseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
596
|
+
): DefinedUseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
578
597
|
export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
579
598
|
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>> & Pick<
|
|
580
599
|
UndefinedInitialDataOptions<
|
|
@@ -584,11 +603,11 @@ export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getD
|
|
|
584
603
|
> , 'initialData'
|
|
585
604
|
>, request?: SecondParameter<typeof customInstance>}
|
|
586
605
|
|
|
587
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
606
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
588
607
|
export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
589
608
|
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
590
609
|
|
|
591
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
610
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
592
611
|
/**
|
|
593
612
|
* @summary Gets the Default Organisation
|
|
594
613
|
*/
|
|
@@ -596,11 +615,11 @@ export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getD
|
|
|
596
615
|
export function useGetDefaultOrganisation<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
597
616
|
options?: { query?:Partial<UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
598
617
|
|
|
599
|
-
): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
618
|
+
): UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
600
619
|
|
|
601
620
|
const queryOptions = getGetDefaultOrganisationQueryOptions(options)
|
|
602
621
|
|
|
603
|
-
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
622
|
+
const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
604
623
|
|
|
605
624
|
query.queryKey = queryOptions.queryKey ;
|
|
606
625
|
|
|
@@ -624,7 +643,7 @@ const {query: queryOptions, request: requestOptions} = options ?? {};
|
|
|
624
643
|
|
|
625
644
|
|
|
626
645
|
|
|
627
|
-
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: QueryKey }
|
|
646
|
+
return { queryKey, queryFn, ...queryOptions} as UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
628
647
|
}
|
|
629
648
|
|
|
630
649
|
export type GetDefaultOrganisationSuspenseQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
|
|
@@ -634,15 +653,15 @@ export type GetDefaultOrganisationSuspenseQueryError = ErrorType<void | AsError>
|
|
|
634
653
|
export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
635
654
|
options: { query:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
636
655
|
|
|
637
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
656
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
638
657
|
export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
639
658
|
options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
640
659
|
|
|
641
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
660
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
642
661
|
export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
643
662
|
options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
644
663
|
|
|
645
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey }
|
|
664
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> }
|
|
646
665
|
/**
|
|
647
666
|
* @summary Gets the Default Organisation
|
|
648
667
|
*/
|
|
@@ -650,11 +669,11 @@ export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typ
|
|
|
650
669
|
export function useGetDefaultOrganisationSuspense<TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
|
|
651
670
|
options?: { query?:Partial<UseSuspenseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>>, request?: SecondParameter<typeof customInstance>}
|
|
652
671
|
|
|
653
|
-
): UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey } {
|
|
672
|
+
): UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> } {
|
|
654
673
|
|
|
655
674
|
const queryOptions = getGetDefaultOrganisationSuspenseQueryOptions(options)
|
|
656
675
|
|
|
657
|
-
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: QueryKey };
|
|
676
|
+
const query = useSuspenseQuery(queryOptions) as UseSuspenseQueryResult<TData, TError> & { queryKey: DataTag<QueryKey, TData, TError> };
|
|
658
677
|
|
|
659
678
|
query.queryKey = queryOptions.queryKey ;
|
|
660
679
|
|