@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
package/src/unit/unit.ts CHANGED
@@ -8,15 +8,18 @@ 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
  OrganisationUnitsGetResponse,
22
25
  AsError,
@@ -24,15 +27,16 @@ import type {
24
27
  OrganisationUnitPostBodyBody,
25
28
  UnitGetResponse,
26
29
  UnitsGetResponse,
27
- PersonalUnitPutResponse,
28
- } from "../account-server-api.schemas";
29
- import { customInstance } from ".././custom-instance";
30
- import type { ErrorType } from ".././custom-instance";
30
+ PersonalUnitPutResponse
31
+ } from '../account-server-api.schemas'
32
+ import { customInstance } from '.././custom-instance'
33
+ import type { ErrorType } from '.././custom-instance'
34
+
31
35
 
32
36
  // eslint-disable-next-line
33
- type SecondParameter<T extends (...args: any) => any> = T extends (
37
+ type SecondParameter<T extends (...args: any) => any> = T extends (
34
38
  config: any,
35
- args: infer P
39
+ args: infer P,
36
40
  ) => any
37
41
  ? P
38
42
  : never;
@@ -43,61 +47,41 @@ type SecondParameter<T extends (...args: any) => any> = T extends (
43
47
  * @summary Gets Organisational Units
44
48
  */
45
49
  export const getOrganisationUnits = (
46
- orgId: string,
47
- options?: SecondParameter<typeof customInstance>,
48
- signal?: AbortSignal
50
+ orgId: string,
51
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
49
52
  ) => {
50
- return customInstance<OrganisationUnitsGetResponse>(
51
- { url: `/organisation/${orgId}/unit`, method: "get", signal },
52
- options
53
- );
54
- };
55
-
56
- export const getGetOrganisationUnitsQueryKey = (orgId: string) => [
57
- `/organisation/${orgId}/unit`,
58
- ];
59
-
60
- export type GetOrganisationUnitsQueryResult = NonNullable<
61
- Awaited<ReturnType<typeof getOrganisationUnits>>
62
- >;
63
- export type GetOrganisationUnitsQueryError = ErrorType<void | AsError>;
64
-
65
- export const useGetOrganisationUnits = <
66
- TData = Awaited<ReturnType<typeof getOrganisationUnits>>,
67
- TError = ErrorType<void | AsError>
68
- >(
69
- orgId: string,
70
- options?: {
71
- query?: UseQueryOptions<
72
- Awaited<ReturnType<typeof getOrganisationUnits>>,
73
- TError,
74
- TData
75
- >;
76
- request?: SecondParameter<typeof customInstance>;
77
- }
78
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
79
- const { query: queryOptions, request: requestOptions } = options ?? {};
80
-
81
- const queryKey =
82
- queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);
83
-
84
- const queryFn: QueryFunction<
85
- Awaited<ReturnType<typeof getOrganisationUnits>>
86
- > = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);
87
-
88
- const query = useQuery<
89
- Awaited<ReturnType<typeof getOrganisationUnits>>,
90
- TError,
91
- TData
92
- >(queryKey, queryFn, { enabled: !!orgId, ...queryOptions }) as UseQueryResult<
93
- TData,
94
- TError
95
- > & { queryKey: QueryKey };
53
+ return customInstance<OrganisationUnitsGetResponse>(
54
+ {url: `/organisation/${orgId}/unit`, method: 'get', signal
55
+ },
56
+ options);
57
+ }
58
+
59
+
60
+ export const getGetOrganisationUnitsQueryKey = (orgId: string,) => [`/organisation/${orgId}/unit`];
61
+
62
+
63
+ export type GetOrganisationUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getOrganisationUnits>>>
64
+ export type GetOrganisationUnitsQueryError = ErrorType<void | AsError>
65
+
66
+ export const useGetOrganisationUnits = <TData = Awaited<ReturnType<typeof getOrganisationUnits>>, TError = ErrorType<void | AsError>>(
67
+ orgId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
68
+
69
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
70
+
71
+ const {query: queryOptions, request: requestOptions} = options ?? {}
72
+
73
+ const queryKey = queryOptions?.queryKey ?? getGetOrganisationUnitsQueryKey(orgId);
74
+
75
+
76
+
77
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getOrganisationUnits>>> = ({ signal }) => getOrganisationUnits(orgId, requestOptions, signal);
78
+
79
+ const query = useQuery<Awaited<ReturnType<typeof getOrganisationUnits>>, TError, TData>(queryKey, queryFn, {enabled: !!(orgId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
96
80
 
97
81
  query.queryKey = queryKey;
98
82
 
99
83
  return query;
100
- };
84
+ }
101
85
 
102
86
  /**
103
87
  * Creates a new organisation unit. You need to be in the Organisation or an Admin user to use this endpoint
@@ -105,108 +89,81 @@ export const useGetOrganisationUnits = <
105
89
  * @summary Create a new Organisational Unit
106
90
  */
107
91
  export const createOrganisationUnit = (
108
- orgId: string,
109
- organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,
110
- options?: SecondParameter<typeof customInstance>
111
- ) => {
112
- return customInstance<OrganisationUnitPostResponse>(
113
- {
114
- url: `/organisation/${orgId}/unit`,
115
- method: "post",
116
- headers: { "Content-Type": "application/json" },
117
- data: organisationUnitPostBodyBody,
92
+ orgId: string,
93
+ organisationUnitPostBodyBody: OrganisationUnitPostBodyBody,
94
+ options?: SecondParameter<typeof customInstance>,) => {
95
+ return customInstance<OrganisationUnitPostResponse>(
96
+ {url: `/organisation/${orgId}/unit`, method: 'post',
97
+ headers: {'Content-Type': 'application/json', },
98
+ data: organisationUnitPostBodyBody
118
99
  },
119
- options
120
- );
121
- };
122
-
123
- export type CreateOrganisationUnitMutationResult = NonNullable<
124
- Awaited<ReturnType<typeof createOrganisationUnit>>
125
- >;
126
- export type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody;
127
- export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>;
128
-
129
- export const useCreateOrganisationUnit = <
130
- TError = ErrorType<AsError | void>,
131
- TContext = unknown
132
- >(options?: {
133
- mutation?: UseMutationOptions<
134
- Awaited<ReturnType<typeof createOrganisationUnit>>,
135
- TError,
136
- { orgId: string; data: OrganisationUnitPostBodyBody },
137
- TContext
138
- >;
139
- request?: SecondParameter<typeof customInstance>;
140
- }) => {
141
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
142
-
143
- const mutationFn: MutationFunction<
144
- Awaited<ReturnType<typeof createOrganisationUnit>>,
145
- { orgId: string; data: OrganisationUnitPostBodyBody }
146
- > = (props) => {
147
- const { orgId, data } = props ?? {};
148
-
149
- return createOrganisationUnit(orgId, data, requestOptions);
150
- };
151
-
152
- return useMutation<
153
- Awaited<ReturnType<typeof createOrganisationUnit>>,
154
- TError,
155
- { orgId: string; data: OrganisationUnitPostBodyBody },
156
- TContext
157
- >(mutationFn, mutationOptions);
158
- };
159
- /**
100
+ options);
101
+ }
102
+
103
+
104
+
105
+ export type CreateOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createOrganisationUnit>>>
106
+ export type CreateOrganisationUnitMutationBody = OrganisationUnitPostBodyBody
107
+ export type CreateOrganisationUnitMutationError = ErrorType<AsError | void>
108
+
109
+ export const useCreateOrganisationUnit = <TError = ErrorType<AsError | void>,
110
+
111
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createOrganisationUnit>>, TError,{orgId: string;data: OrganisationUnitPostBodyBody}, TContext>, request?: SecondParameter<typeof customInstance>}
112
+ ) => {
113
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
114
+
115
+
116
+
117
+
118
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof createOrganisationUnit>>, {orgId: string;data: OrganisationUnitPostBodyBody}> = (props) => {
119
+ const {orgId,data} = props ?? {};
120
+
121
+ return createOrganisationUnit(orgId,data,requestOptions)
122
+ }
123
+
124
+ return useMutation<Awaited<ReturnType<typeof createOrganisationUnit>>, TError, {orgId: string;data: OrganisationUnitPostBodyBody}, TContext>(mutationFn, mutationOptions)
125
+ }
126
+ /**
160
127
  * Gets the Unit, assuming you are a member of it or it is public. Admin users can see all Units
161
128
 
162
129
  * @summary Gets an Organisational Unit
163
130
  */
164
131
  export const getUnit = (
165
- unitId: string,
166
- options?: SecondParameter<typeof customInstance>,
167
- signal?: AbortSignal
132
+ unitId: string,
133
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
168
134
  ) => {
169
- return customInstance<UnitGetResponse>(
170
- { url: `/unit/${unitId}`, method: "get", signal },
171
- options
172
- );
173
- };
174
-
175
- export const getGetUnitQueryKey = (unitId: string) => [`/unit/${unitId}`];
176
-
177
- export type GetUnitQueryResult = NonNullable<
178
- Awaited<ReturnType<typeof getUnit>>
179
- >;
180
- export type GetUnitQueryError = ErrorType<void | AsError>;
181
-
182
- export const useGetUnit = <
183
- TData = Awaited<ReturnType<typeof getUnit>>,
184
- TError = ErrorType<void | AsError>
185
- >(
186
- unitId: string,
187
- options?: {
188
- query?: UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>;
189
- request?: SecondParameter<typeof customInstance>;
190
- }
191
- ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
192
- const { query: queryOptions, request: requestOptions } = options ?? {};
135
+ return customInstance<UnitGetResponse>(
136
+ {url: `/unit/${unitId}`, method: 'get', signal
137
+ },
138
+ options);
139
+ }
140
+
141
+
142
+ export const getGetUnitQueryKey = (unitId: string,) => [`/unit/${unitId}`];
143
+
144
+
145
+ export type GetUnitQueryResult = NonNullable<Awaited<ReturnType<typeof getUnit>>>
146
+ export type GetUnitQueryError = ErrorType<void | AsError>
147
+
148
+ export const useGetUnit = <TData = Awaited<ReturnType<typeof getUnit>>, TError = ErrorType<void | AsError>>(
149
+ unitId: string, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUnit>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
150
+
151
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
152
+
153
+ const {query: queryOptions, request: requestOptions} = options ?? {}
193
154
 
194
155
  const queryKey = queryOptions?.queryKey ?? getGetUnitQueryKey(unitId);
195
156
 
196
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({
197
- signal,
198
- }) => getUnit(unitId, requestOptions, signal);
157
+
199
158
 
200
- const query = useQuery<Awaited<ReturnType<typeof getUnit>>, TError, TData>(
201
- queryKey,
202
- queryFn,
203
- { enabled: !!unitId, ...queryOptions }
204
- ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
159
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnit>>> = ({ signal }) => getUnit(unitId, requestOptions, signal);
160
+
161
+ const query = useQuery<Awaited<ReturnType<typeof getUnit>>, TError, TData>(queryKey, queryFn, {enabled: !!(unitId), ...queryOptions}) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
205
162
 
206
163
  query.queryKey = queryKey;
207
164
 
208
165
  return query;
209
- };
166
+ }
210
167
 
211
168
  /**
212
169
  * Deletes an Organisational Unit you have access to. Units can only be deleted by Organisation users or Admin users. You cannot delete a Unit that contains Products
@@ -214,98 +171,78 @@ export const useGetUnit = <
214
171
  * @summary Deletes an Organisational Unit
215
172
  */
216
173
  export const deleteOrganisationUnit = (
217
- unitId: string,
218
- options?: SecondParameter<typeof customInstance>
174
+ unitId: string,
175
+ options?: SecondParameter<typeof customInstance>,) => {
176
+ return customInstance<void>(
177
+ {url: `/unit/${unitId}`, method: 'delete'
178
+ },
179
+ options);
180
+ }
181
+
182
+
183
+
184
+ export type DeleteOrganisationUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteOrganisationUnit>>>
185
+
186
+ export type DeleteOrganisationUnitMutationError = ErrorType<AsError>
187
+
188
+ export const useDeleteOrganisationUnit = <TError = ErrorType<AsError>,
189
+
190
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError,{unitId: string}, TContext>, request?: SecondParameter<typeof customInstance>}
219
191
  ) => {
220
- return customInstance<void>(
221
- { url: `/unit/${unitId}`, method: "delete" },
222
- options
223
- );
224
- };
225
-
226
- export type DeleteOrganisationUnitMutationResult = NonNullable<
227
- Awaited<ReturnType<typeof deleteOrganisationUnit>>
228
- >;
229
-
230
- export type DeleteOrganisationUnitMutationError = ErrorType<AsError>;
231
-
232
- export const useDeleteOrganisationUnit = <
233
- TError = ErrorType<AsError>,
234
- TContext = unknown
235
- >(options?: {
236
- mutation?: UseMutationOptions<
237
- Awaited<ReturnType<typeof deleteOrganisationUnit>>,
238
- TError,
239
- { unitId: string },
240
- TContext
241
- >;
242
- request?: SecondParameter<typeof customInstance>;
243
- }) => {
244
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
245
-
246
- const mutationFn: MutationFunction<
247
- Awaited<ReturnType<typeof deleteOrganisationUnit>>,
248
- { unitId: string }
249
- > = (props) => {
250
- const { unitId } = props ?? {};
251
-
252
- return deleteOrganisationUnit(unitId, requestOptions);
253
- };
254
-
255
- return useMutation<
256
- Awaited<ReturnType<typeof deleteOrganisationUnit>>,
257
- TError,
258
- { unitId: string },
259
- TContext
260
- >(mutationFn, mutationOptions);
261
- };
262
- /**
192
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
193
+
194
+
195
+
196
+
197
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteOrganisationUnit>>, {unitId: string}> = (props) => {
198
+ const {unitId} = props ?? {};
199
+
200
+ return deleteOrganisationUnit(unitId,requestOptions)
201
+ }
202
+
203
+ return useMutation<Awaited<ReturnType<typeof deleteOrganisationUnit>>, TError, {unitId: string}, TContext>(mutationFn, mutationOptions)
204
+ }
205
+ /**
263
206
  * Gets all the Units that are public or you are a member of. Admin users can see all Units
264
207
 
265
208
  * @summary Gets Units
266
209
  */
267
210
  export const getUnits = (
268
- options?: SecondParameter<typeof customInstance>,
269
- signal?: AbortSignal
211
+
212
+ options?: SecondParameter<typeof customInstance>,signal?: AbortSignal
270
213
  ) => {
271
- return customInstance<UnitsGetResponse>(
272
- { url: `/unit`, method: "get", signal },
273
- options
274
- );
275
- };
214
+ return customInstance<UnitsGetResponse>(
215
+ {url: `/unit`, method: 'get', signal
216
+ },
217
+ options);
218
+ }
219
+
276
220
 
277
221
  export const getGetUnitsQueryKey = () => [`/unit`];
278
222
 
279
- export type GetUnitsQueryResult = NonNullable<
280
- Awaited<ReturnType<typeof getUnits>>
281
- >;
282
- export type GetUnitsQueryError = ErrorType<void | AsError>;
223
+
224
+ export type GetUnitsQueryResult = NonNullable<Awaited<ReturnType<typeof getUnits>>>
225
+ export type GetUnitsQueryError = ErrorType<void | AsError>
226
+
227
+ export const useGetUnits = <TData = Awaited<ReturnType<typeof getUnits>>, TError = ErrorType<void | AsError>>(
228
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>, request?: SecondParameter<typeof customInstance>}
283
229
 
284
- export const useGetUnits = <
285
- TData = Awaited<ReturnType<typeof getUnits>>,
286
- TError = ErrorType<void | AsError>
287
- >(options?: {
288
- query?: UseQueryOptions<Awaited<ReturnType<typeof getUnits>>, TError, TData>;
289
- request?: SecondParameter<typeof customInstance>;
290
- }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
291
- const { query: queryOptions, request: requestOptions } = options ?? {};
230
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
231
+
232
+ const {query: queryOptions, request: requestOptions} = options ?? {}
292
233
 
293
234
  const queryKey = queryOptions?.queryKey ?? getGetUnitsQueryKey();
294
235
 
295
- const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({
296
- signal,
297
- }) => getUnits(requestOptions, signal);
236
+
237
+
238
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getUnits>>> = ({ signal }) => getUnits(requestOptions, signal);
298
239
 
299
- const query = useQuery<Awaited<ReturnType<typeof getUnits>>, TError, TData>(
300
- queryKey,
301
- queryFn,
302
- queryOptions
303
- ) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
240
+ const query = useQuery<Awaited<ReturnType<typeof getUnits>>, TError, TData>(queryKey, queryFn, queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
304
241
 
305
242
  query.queryKey = queryKey;
306
243
 
307
244
  return query;
308
- };
245
+ }
309
246
 
310
247
  /**
311
248
  * Creates a 'Personal' Unit for a User. The unit will belong to the built-in **Default** Organisation. Users can only have one Personal Unit and Personal Units cannot have other Users
@@ -313,92 +250,72 @@ export const useGetUnits = <
313
250
  * @summary Create a new Personal Unit
314
251
  */
315
252
  export const createDefaultUnit = (
316
- options?: SecondParameter<typeof customInstance>
253
+
254
+ options?: SecondParameter<typeof customInstance>,) => {
255
+ return customInstance<PersonalUnitPutResponse>(
256
+ {url: `/unit`, method: 'put'
257
+ },
258
+ options);
259
+ }
260
+
261
+
262
+
263
+ export type CreateDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof createDefaultUnit>>>
264
+
265
+ export type CreateDefaultUnitMutationError = ErrorType<AsError | void>
266
+
267
+ export const useCreateDefaultUnit = <TError = ErrorType<AsError | void>,
268
+ TVariables = void,
269
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof createDefaultUnit>>, TError,TVariables, TContext>, request?: SecondParameter<typeof customInstance>}
317
270
  ) => {
318
- return customInstance<PersonalUnitPutResponse>(
319
- { url: `/unit`, method: "put" },
320
- options
321
- );
322
- };
323
-
324
- export type CreateDefaultUnitMutationResult = NonNullable<
325
- Awaited<ReturnType<typeof createDefaultUnit>>
326
- >;
327
-
328
- export type CreateDefaultUnitMutationError = ErrorType<AsError | void>;
329
-
330
- export const useCreateDefaultUnit = <
331
- TError = ErrorType<AsError | void>,
332
- TVariables = void,
333
- TContext = unknown
334
- >(options?: {
335
- mutation?: UseMutationOptions<
336
- Awaited<ReturnType<typeof createDefaultUnit>>,
337
- TError,
338
- TVariables,
339
- TContext
340
- >;
341
- request?: SecondParameter<typeof customInstance>;
342
- }) => {
343
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
344
-
345
- const mutationFn: MutationFunction<
346
- Awaited<ReturnType<typeof createDefaultUnit>>,
347
- TVariables
348
- > = () => {
349
- return createDefaultUnit(requestOptions);
350
- };
351
-
352
- return useMutation<
353
- Awaited<ReturnType<typeof createDefaultUnit>>,
354
- TError,
355
- TVariables,
356
- TContext
357
- >(mutationFn, mutationOptions);
358
- };
359
- /**
271
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
272
+
273
+
274
+
275
+
276
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof createDefaultUnit>>, TVariables> = () => {
277
+ ;
278
+
279
+ return createDefaultUnit(requestOptions)
280
+ }
281
+
282
+ return useMutation<Awaited<ReturnType<typeof createDefaultUnit>>, TError, TVariables, TContext>(mutationFn, mutationOptions)
283
+ }
284
+ /**
360
285
  * Deletes a 'Personal' Unit. It must be your Unit, which belongs to the Default Organisation
361
286
 
362
287
  * @summary Deletes a Personal Unit
363
288
  */
364
289
  export const deleteDefaultUnit = (
365
- options?: SecondParameter<typeof customInstance>
290
+
291
+ options?: SecondParameter<typeof customInstance>,) => {
292
+ return customInstance<void>(
293
+ {url: `/unit`, method: 'delete'
294
+ },
295
+ options);
296
+ }
297
+
298
+
299
+
300
+ export type DeleteDefaultUnitMutationResult = NonNullable<Awaited<ReturnType<typeof deleteDefaultUnit>>>
301
+
302
+ export type DeleteDefaultUnitMutationError = ErrorType<AsError>
303
+
304
+ export const useDeleteDefaultUnit = <TError = ErrorType<AsError>,
305
+ TVariables = void,
306
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError,TVariables, TContext>, request?: SecondParameter<typeof customInstance>}
366
307
  ) => {
367
- return customInstance<void>({ url: `/unit`, method: "delete" }, options);
368
- };
369
-
370
- export type DeleteDefaultUnitMutationResult = NonNullable<
371
- Awaited<ReturnType<typeof deleteDefaultUnit>>
372
- >;
373
-
374
- export type DeleteDefaultUnitMutationError = ErrorType<AsError>;
375
-
376
- export const useDeleteDefaultUnit = <
377
- TError = ErrorType<AsError>,
378
- TVariables = void,
379
- TContext = unknown
380
- >(options?: {
381
- mutation?: UseMutationOptions<
382
- Awaited<ReturnType<typeof deleteDefaultUnit>>,
383
- TError,
384
- TVariables,
385
- TContext
386
- >;
387
- request?: SecondParameter<typeof customInstance>;
388
- }) => {
389
- const { mutation: mutationOptions, request: requestOptions } = options ?? {};
390
-
391
- const mutationFn: MutationFunction<
392
- Awaited<ReturnType<typeof deleteDefaultUnit>>,
393
- TVariables
394
- > = () => {
395
- return deleteDefaultUnit(requestOptions);
396
- };
397
-
398
- return useMutation<
399
- Awaited<ReturnType<typeof deleteDefaultUnit>>,
400
- TError,
401
- TVariables,
402
- TContext
403
- >(mutationFn, mutationOptions);
404
- };
308
+ const {mutation: mutationOptions, request: requestOptions} = options ?? {}
309
+
310
+
311
+
312
+
313
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof deleteDefaultUnit>>, TVariables> = () => {
314
+ ;
315
+
316
+ return deleteDefaultUnit(requestOptions)
317
+ }
318
+
319
+ return useMutation<Awaited<ReturnType<typeof deleteDefaultUnit>>, TError, TVariables, TContext>(mutationFn, mutationOptions)
320
+ }
321
+