@squonk/account-server-client 1.0.2-rc.3 → 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-b8075093.d.ts → custom-instance-93fb01eb.d.ts} +22 -20
  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 +73 -87
  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,25 +8,28 @@ 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
  MerchantsGetResponse,
20
22
  AsError,
21
- MerchantGetResponse,
22
- } from "../account-server-api.schemas";
23
- import { customInstance } from ".././custom-instance";
24
- import type { ErrorType } from ".././custom-instance";
23
+ MerchantGetResponse
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;
@@ -37,53 +40,41 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
37
40
  * @summary Gets all Merchants
38
41
  */
39
42
  export const getMerchants = (
40
- options?: SecondParameter<typeof customInstance>,
41
- signal?: AbortSignal
43
+
44
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
42
45
  ) => {
43
- return customInstance<MerchantsGetResponse>(
44
- { url: `/merchant`, method: "get", signal },
45
- options
46
- );
47
- };
46
+ return customInstance<MerchantsGetResponse>(
47
+ {url: `/merchant`, method: 'get', signal
48
+ },
49
+ options);
50
+ }
51
+
48
52
 
49
53
  export const getGetMerchantsQueryKey = () => [`/merchant`];
50
54
 
51
- export type GetMerchantsQueryResult = NonNullable<
52
- Awaited<ReturnType<typeof getMerchants>>
53
- >;
54
- export type GetMerchantsQueryError = ErrorType<AsError | void>;
55
-
56
- export const useGetMerchants = <
57
- TData = Awaited<ReturnType<typeof getMerchants>>,
58
- TError = ErrorType<AsError | void>
59
- >(options?: {
60
- query?: UseQueryOptions<
61
- Awaited<ReturnType<typeof getMerchants>>,
62
- TError,
63
- TData
64
- >;
65
- request?: SecondParameter<typeof customInstance>;
66
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
67
- const { query: queryOptions, request: requestOptions } = options ?? {};
55
+
56
+ export type GetMerchantsQueryResult = NonNullable<Awaited<ReturnType<typeof getMerchants>>>
57
+ export type GetMerchantsQueryError = ErrorType<AsError | void>
58
+
59
+ export const useGetMerchants = <TData = Awaited<ReturnType<typeof getMerchants>>, TError = ErrorType<AsError | void>>(
60
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getMerchants>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
61
+
62
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
63
+
64
+ const {query: queryOptions, request: requestOptions} = options ?? {}
68
65
 
69
66
  const queryKey = queryOptions?.queryKey ?? getGetMerchantsQueryKey();
70
67
 
71
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({
72
- signal,
73
- }) => getMerchants(requestOptions, signal);
68
+
69
+
70
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getMerchants>>> = ({ signal }) => getMerchants(requestOptions, signal);
74
71
 
75
- const query = useQuery<
76
- Awaited<ReturnType<typeof getMerchants>>,
77
- TError,
78
- TData
79
- >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
80
- queryKey: QueryKey;
81
- };
72
+ const query = useQuery<Awaited<ReturnType<typeof getMerchants>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
82
73
 
83
74
  query.queryKey = queryKey;
84
75
 
85
76
  return query;
86
- };
77
+ }
87
78
 
88
79
  /**
89
80
  * Gets a known merchant
@@ -91,52 +82,39 @@ export const useGetMerchants = <
91
82
  * @summary Gets a specific Merchant
92
83
  */
93
84
  export const getService = (
94
- mId: number,
95
- options?: SecondParameter<typeof customInstance>,
96
- signal?: AbortSignal
85
+ mId: number,
86
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
97
87
  ) => {
98
- return customInstance<MerchantGetResponse>(
99
- { url: `/merchant/${mId}`, method: "get", signal },
100
- options
101
- );
102
- };
103
-
104
- export const getGetServiceQueryKey = (mId: number) => [`/merchant/${mId}`];
105
-
106
- export type GetServiceQueryResult = NonNullable<
107
- Awaited<ReturnType<typeof getService>>
108
- >;
109
- export type GetServiceQueryError = ErrorType<AsError | void>;
110
-
111
- export const useGetService = <
112
- TData = Awaited<ReturnType<typeof getService>>,
113
- TError = ErrorType<AsError | void>
114
- >(
115
- mId: number,
116
- options?: {
117
- query?: UseQueryOptions<
118
- Awaited<ReturnType<typeof getService>>,
119
- TError,
120
- TData
121
- >;
122
- request?: SecondParameter<typeof customInstance>;
123
- }
124
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
125
- const { query: queryOptions, request: requestOptions } = options ?? {};
88
+ return customInstance<MerchantGetResponse>(
89
+ {url: `/merchant/${mId}`, method: 'get', signal
90
+ },
91
+ options);
92
+ }
93
+
94
+
95
+ export const getGetServiceQueryKey = (mId: number,) => [`/merchant/${mId}`];
96
+
97
+
98
+ export type GetServiceQueryResult = NonNullable<Awaited<ReturnType<typeof getService>>>
99
+ export type GetServiceQueryError = ErrorType<AsError | void>
100
+
101
+ export const useGetService = <TData = Awaited<ReturnType<typeof getService>>, TError = ErrorType<AsError | void>>(
102
+ mId: number, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getService>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
103
+
104
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
105
+
106
+ const {query: queryOptions, request: requestOptions} = options ?? {}
126
107
 
127
108
  const queryKey = queryOptions?.queryKey ?? getGetServiceQueryKey(mId);
128
109
 
129
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({
130
- signal,
131
- }) => getService(mId, requestOptions, signal);
110
+
111
+
112
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getService>>> = ({ signal }) => getService(mId, requestOptions, signal);
132
113
 
133
- const query = useQuery<Awaited<ReturnType<typeof getService>>, TError, TData>(
134
- queryKey,
135
- queryFn,
136
- { enabled: !!mId, ...queryOptions }
137
- ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
114
+ const query = useQuery<Awaited<ReturnType<typeof getService>>, TError, TData>(queryKey, queryFn, {enabled: !!(mId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
138
115
 
139
116
  query.queryKey = queryKey;
140
117
 
141
118
  return query;
142
- };
119
+ }
120
+
@@ -8,29 +8,33 @@ 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, useMutation } from "react-query";
11
+ import {
12
+ useQuery,
13
+ useMutation
14
+ } from 'react-query'
12
15
  import type {
13
16
  UseQueryOptions,
14
17
  UseMutationOptions,
15
18
  QueryFunction,
16
19
  MutationFunction,
17
20
  UseQueryResult,
18
- QueryKey,
19
- } from "react-query";
21
+ QueryKey
22
+ } from 'react-query'
20
23
  import type {
21
24
  OrganisationsGetResponse,
22
25
  AsError,
23
26
  OrganisationPostResponse,
24
27
  OrganisationPostBodyBody,
25
- OrganisationGetDefaultResponse,
26
- } from "../account-server-api.schemas";
27
- import { customInstance } from ".././custom-instance";
28
- import type { ErrorType } from ".././custom-instance";
28
+ OrganisationGetDefaultResponse
29
+ } from '../account-server-api.schemas'
30
+ import { customInstance } from '.././custom-instance'
31
+ import type { ErrorType } from '.././custom-instance'
32
+
29
33
 
30
34
  // eslint-disable-next-line
31
- type SecondParameter<T extends (...args: any) => any> = T extends (
35
+ type SecondParameter<T extends (...args: any) => any> = T extends (
32
36
  config: any,
33
- args: infer P
37
+ args: infer P,
34
38
  ) => any
35
39
  ? P
36
40
  : never;
@@ -41,53 +45,41 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
41
45
  * @summary Gets Organisations
42
46
  */
43
47
  export const getOrganisations = (
44
- options?: SecondParameter<typeof customInstance>,
45
- signal?: AbortSignal
48
+
49
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
46
50
  ) => {
47
- return customInstance<OrganisationsGetResponse>(
48
- { url: `/organisation`, method: "get", signal },
49
- options
50
- );
51
- };
51
+ return customInstance<OrganisationsGetResponse>(
52
+ {url: `/organisation`, method: 'get', signal
53
+ },
54
+ options);
55
+ }
56
+
52
57
 
53
58
  export const getGetOrganisationsQueryKey = () => [`/organisation`];
54
59
 
55
- export type GetOrganisationsQueryResult = NonNullable<
56
- Awaited<ReturnType<typeof getOrganisations>>
57
- >;
58
- export type GetOrganisationsQueryError = ErrorType<void | AsError>;
59
-
60
- export const useGetOrganisations = <
61
- TData = Awaited<ReturnType<typeof getOrganisations>>,
62
- TError = ErrorType<void | AsError>
63
- >(options?: {
64
- query?: UseQueryOptions<
65
- Awaited<ReturnType<typeof getOrganisations>>,
66
- TError,
67
- TData
68
- >;
69
- request?: SecondParameter<typeof customInstance>;
70
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
71
- const { query: queryOptions, request: requestOptions } = options ?? {};
60
+
61
+ export type GetOrganisationsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisations>>>
62
+ export type GetOrganisationsQueryError = ErrorType<void | AsError>
63
+
64
+ export const useGetOrganisations = <TData = Awaited<ReturnType<typeof getOrganisations>>, TError = ErrorType<void | AsError>>(
65
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
66
+
67
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
68
+
69
+ const {query: queryOptions, request: requestOptions} = options ?? {}
72
70
 
73
71
  const queryKey = queryOptions?.queryKey ?? getGetOrganisationsQueryKey();
74
72
 
75
- const queryFn: QueryFunction<
76
- Awaited<ReturnType<typeof getOrganisations>>
77
- > = ({ signal }) => getOrganisations(requestOptions, signal);
73
+
78
74
 
79
- const query = useQuery<
80
- Awaited<ReturnType<typeof getOrganisations>>,
81
- TError,
82
- TData
83
- >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
84
- queryKey: QueryKey;
85
- };
75
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisations>>> = ({ signal }) => getOrganisations(requestOptions, signal);
76
+
77
+ const query = useQuery<Awaited<ReturnType<typeof getOrganisations>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
86
78
 
87
79
  query.queryKey = queryKey;
88
80
 
89
81
  return query;
90
- };
82
+ }
91
83
 
92
84
  /**
93
85
  * Creates a new Organisation
@@ -97,57 +89,40 @@ You need **admin** rights to use this method
97
89
  * @summary Create a new organisation
98
90
  */
99
91
  export const createOrganisation = (
100
- organisationPostBodyBody: OrganisationPostBodyBody,
101
- options?: SecondParameter<typeof customInstance>
102
- ) => {
103
- return customInstance<OrganisationPostResponse>(
104
- {
105
- url: `/organisation`,
106
- method: "post",
107
- headers: { "Content-Type": "application/json" },
108
- data: organisationPostBodyBody,
92
+ organisationPostBodyBody: OrganisationPostBodyBody,
93
+ options?: SecondParameter<typeof customInstance>,) => {
94
+ return customInstance<OrganisationPostResponse>(
95
+ {url: `/organisation`, method: 'post',
96
+ headers: {'Content-Type': 'application/json', },
97
+ data: organisationPostBodyBody
109
98
  },
110
- options
111
- );
112
- };
113
-
114
- export type CreateOrganisationMutationResult = NonNullable<
115
- Awaited<ReturnType<typeof createOrganisation>>
116
- >;
117
- export type CreateOrganisationMutationBody = OrganisationPostBodyBody;
118
- export type CreateOrganisationMutationError = ErrorType<AsError | void>;
119
-
120
- export const useCreateOrganisation = <
121
- TError = ErrorType<AsError | void>,
122
- TContext = unknown
123
- >(options?: {
124
- mutation?: UseMutationOptions<
125
- Awaited<ReturnType<typeof createOrganisation>>,
126
- TError,
127
- { data: OrganisationPostBodyBody },
128
- TContext
129
- >;
130
- request?: SecondParameter<typeof customInstance>;
131
- }) => {
132
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
133
-
134
- const mutationFn: MutationFunction<
135
- Awaited<ReturnType<typeof createOrganisation>>,
136
- { data: OrganisationPostBodyBody }
137
- > = (props) => {
138
- const { data } = props ?? {};
139
-
140
- return createOrganisation(data, requestOptions);
141
- };
142
-
143
- return useMutation<
144
- Awaited<ReturnType<typeof createOrganisation>>,
145
- TError,
146
- { data: OrganisationPostBodyBody },
147
- TContext
148
- >(mutationFn, mutationOptions);
149
- };
150
- /**
99
+ options);
100
+ }
101
+
102
+
103
+
104
+ export type CreateOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisation>>>
105
+ export type CreateOrganisationMutationBody = OrganisationPostBodyBody
106
+ export type CreateOrganisationMutationError = ErrorType<AsError | void>
107
+
108
+ export const useCreateOrganisation = <TError = ErrorType<AsError | void>,
109
+
110
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisation>>, TError,{data: OrganisationPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
111
+ ) => {
112
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
113
+
114
+
115
+
116
+
117
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisation>>, {data: OrganisationPostBodyBody}> = (props) => {
118
+ const {data} = props ?? {};
119
+
120
+ return createOrganisation(data,requestOptions)
121
+ }
122
+
123
+ return useMutation<Awaited<ReturnType<typeof createOrganisation>>, TError, {data: OrganisationPostBodyBody}, TContext>(mutationFn, mutationOptions)
124
+ }
125
+ /**
151
126
  * Units must first be deleted before an Organisation can be deleted
152
127
 
153
128
  You need **admin** rights to use this method
@@ -155,104 +130,76 @@ You need **admin** rights to use this method
155
130
  * @summary Deletes an Organisation
156
131
  */
157
132
  export const deleteOrganisation = (
158
- orgId: string,
159
- options?: SecondParameter<typeof customInstance>
133
+ orgId: string,
134
+ options?: SecondParameter<typeof customInstance>,) => {
135
+ return customInstance<void>(
136
+ {url: `/organisation/${orgId}`, method: 'delete'
137
+ },
138
+ options);
139
+ }
140
+
141
+
142
+
143
+ export type DeleteOrganisationMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisation>>>
144
+
145
+ export type DeleteOrganisationMutationError = ErrorType<AsError>
146
+
147
+ export const useDeleteOrganisation = <TError = ErrorType<AsError>,
148
+
149
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisation>>, TError,{orgId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
160
150
  ) => {
161
- return customInstance<void>(
162
- { url: `/organisation/${orgId}`, method: "delete" },
163
- options
164
- );
165
- };
166
-
167
- export type DeleteOrganisationMutationResult = NonNullable<
168
- Awaited<ReturnType<typeof deleteOrganisation>>
169
- >;
170
-
171
- export type DeleteOrganisationMutationError = ErrorType<AsError>;
172
-
173
- export const useDeleteOrganisation = <
174
- TError = ErrorType<AsError>,
175
- TContext = unknown
176
- >(options?: {
177
- mutation?: UseMutationOptions<
178
- Awaited<ReturnType<typeof deleteOrganisation>>,
179
- TError,
180
- { orgId: string },
181
- TContext
182
- >;
183
- request?: SecondParameter<typeof customInstance>;
184
- }) => {
185
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
186
-
187
- const mutationFn: MutationFunction<
188
- Awaited<ReturnType<typeof deleteOrganisation>>,
189
- { orgId: string }
190
- > = (props) => {
191
- const { orgId } = props ?? {};
192
-
193
- return deleteOrganisation(orgId, requestOptions);
194
- };
195
-
196
- return useMutation<
197
- Awaited<ReturnType<typeof deleteOrganisation>>,
198
- TError,
199
- { orgId: string },
200
- TContext
201
- >(mutationFn, mutationOptions);
202
- };
203
- /**
151
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
152
+
153
+
154
+
155
+
156
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisation>>, {orgId: string}> = (props) => {
157
+ const {orgId} = props ?? {};
158
+
159
+ return deleteOrganisation(orgId,requestOptions)
160
+ }
161
+
162
+ return useMutation<Awaited<ReturnType<typeof deleteOrganisation>>, TError, {orgId: string}, TContext>(mutationFn, mutationOptions)
163
+ }
164
+ /**
204
165
  * Gets the built-in Default Organisation, used exclusively for Personal Units
205
166
 
206
167
  * @summary Gets the (built-in) Default Organisation
207
168
  */
208
169
  export const getDefaultOrganisation = (
209
- options?: SecondParameter<typeof customInstance>,
210
- signal?: AbortSignal
170
+
171
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
211
172
  ) => {
212
- return customInstance<OrganisationGetDefaultResponse>(
213
- { url: `/organisation/default`, method: "get", signal },
214
- options
215
- );
216
- };
217
-
218
- export const getGetDefaultOrganisationQueryKey = () => [
219
- `/organisation/default`,
220
- ];
221
-
222
- export type GetDefaultOrganisationQueryResult = NonNullable<
223
- Awaited<ReturnType<typeof getDefaultOrganisation>>
224
- >;
225
- export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>;
226
-
227
- export const useGetDefaultOrganisation = <
228
- TData = Awaited<ReturnType<typeof getDefaultOrganisation>>,
229
- TError = ErrorType<void | AsError>
230
- >(options?: {
231
- query?: UseQueryOptions<
232
- Awaited<ReturnType<typeof getDefaultOrganisation>>,
233
- TError,
234
- TData
235
- >;
236
- request?: SecondParameter<typeof customInstance>;
237
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
238
- const { query: queryOptions, request: requestOptions } = options ?? {};
239
-
240
- const queryKey =
241
- queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
242
-
243
- const queryFn: QueryFunction<
244
- Awaited<ReturnType<typeof getDefaultOrganisation>>
245
- > = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
246
-
247
- const query = useQuery<
248
- Awaited<ReturnType<typeof getDefaultOrganisation>>,
249
- TError,
250
- TData
251
- >(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & {
252
- queryKey: QueryKey;
253
- };
173
+ return customInstance<OrganisationGetDefaultResponse>(
174
+ {url: `/organisation/default`, method: 'get', signal
175
+ },
176
+ options);
177
+ }
178
+
179
+
180
+ export const getGetDefaultOrganisationQueryKey = () => [`/organisation/default`];
181
+
182
+
183
+ export type GetDefaultOrganisationQueryResult = NonNullable<Awaited<ReturnType<typeof getDefaultOrganisation>>>
184
+ export type GetDefaultOrganisationQueryError = ErrorType<void | AsError>
185
+
186
+ export const useGetDefaultOrganisation = <TData = Awaited<ReturnType<typeof getDefaultOrganisation>>, TError = ErrorType<void | AsError>>(
187
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
188
+
189
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
190
+
191
+ const {query: queryOptions, request: requestOptions} = options ?? {}
192
+
193
+ const queryKey = queryOptions?.queryKey ?? getGetDefaultOrganisationQueryKey();
194
+
195
+
196
+
197
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getDefaultOrganisation>>> = ({ signal }) => getDefaultOrganisation(requestOptions, signal);
198
+
199
+ const query = useQuery<Awaited<ReturnType<typeof getDefaultOrganisation>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
254
200
 
255
201
  query.queryKey = queryKey;
256
202
 
257
203
  return query;
258
- };
204
+ }
205
+