@squonk/account-server-client 0.1.27-rc.1 → 0.1.29-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 (50) hide show
  1. package/{chunk-GWBPVOL2.js → chunk-6EEIAH4R.js} +23 -2
  2. package/chunk-6EEIAH4R.js.map +1 -0
  3. package/chunk-NGBTCJWS.cjs +46 -0
  4. package/chunk-NGBTCJWS.cjs.map +1 -0
  5. package/{account-server-api.schemas-e6c5f956.d.ts → custom-instance-13412a15.d.ts} +19 -1
  6. package/index.cjs +5 -21
  7. package/index.cjs.map +1 -1
  8. package/index.d.ts +2 -20
  9. package/index.js +5 -21
  10. package/index.js.map +1 -1
  11. package/organisation/organisation.cjs +35 -30
  12. package/organisation/organisation.cjs.map +1 -1
  13. package/organisation/organisation.d.ts +33 -32
  14. package/organisation/organisation.js +42 -37
  15. package/organisation/organisation.js.map +1 -1
  16. package/package.json +1 -1
  17. package/product/product.cjs +65 -53
  18. package/product/product.cjs.map +1 -1
  19. package/product/product.d.ts +55 -54
  20. package/product/product.js +76 -64
  21. package/product/product.js.map +1 -1
  22. package/service/service.cjs +21 -23
  23. package/service/service.cjs.map +1 -1
  24. package/service/service.d.ts +18 -17
  25. package/service/service.js +23 -25
  26. package/service/service.js.map +1 -1
  27. package/src/organisation/organisation.ts +93 -69
  28. package/src/product/product.ts +165 -146
  29. package/src/service/service.ts +59 -57
  30. package/src/state/state.ts +34 -28
  31. package/src/unit/unit.ts +145 -130
  32. package/src/user/user.ts +148 -120
  33. package/state/state.cjs +12 -12
  34. package/state/state.cjs.map +1 -1
  35. package/state/state.d.ts +11 -10
  36. package/state/state.js +13 -13
  37. package/state/state.js.map +1 -1
  38. package/unit/unit.cjs +55 -50
  39. package/unit/unit.cjs.map +1 -1
  40. package/unit/unit.d.ts +54 -53
  41. package/unit/unit.js +66 -61
  42. package/unit/unit.js.map +1 -1
  43. package/user/user.cjs +50 -50
  44. package/user/user.cjs.map +1 -1
  45. package/user/user.d.ts +53 -52
  46. package/user/user.js +61 -61
  47. package/user/user.js.map +1 -1
  48. package/chunk-GWBPVOL2.js.map +0 -1
  49. package/chunk-N3RLW53G.cjs +0 -25
  50. package/chunk-N3RLW53G.cjs.map +0 -1
@@ -8,7 +8,6 @@ A service that provides access to the Account Server, which gives *registered* u
8
8
 
9
9
  * OpenAPI spec version: 0.1
10
10
  */
11
- import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
12
11
  import {
13
12
  useQuery,
14
13
  useMutation,
@@ -28,6 +27,7 @@ import type {
28
27
  ProductUnitGetResponse,
29
28
  ProductPatchBodyBody,
30
29
  } from "../account-server-api.schemas";
30
+ import { customInstance, ErrorType } from ".././custom-instance";
31
31
 
32
32
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
33
  type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
@@ -36,45 +36,55 @@ type AsyncReturnType<T extends (...args: any) => Promise<any>> = T extends (
36
36
  ? R
37
37
  : any;
38
38
 
39
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+ type SecondParameter<T extends (...args: any) => any> = T extends (
41
+ config: any,
42
+ args: infer P
43
+ ) => any
44
+ ? P
45
+ : never;
46
+
39
47
  /**
40
48
  * Gets product types you can purchase
41
49
 
42
50
  * @summary Gets all Product Types
43
51
  */
44
- export const appApiProductGetTypes = (
45
- options?: AxiosRequestConfig
46
- ): Promise<AxiosResponse<ProductsGetTypesResponse>> => {
47
- return axios.get(`/product-type`, options);
52
+ export const getProductTypes = (
53
+ options?: SecondParameter<typeof customInstance>
54
+ ) => {
55
+ return customInstance<ProductsGetTypesResponse>(
56
+ { url: `/product-type`, method: "get" },
57
+ options
58
+ );
48
59
  };
49
60
 
50
- export const getAppApiProductGetTypesQueryKey = () => [`/product-type`];
61
+ export const getGetProductTypesQueryKey = () => [`/product-type`];
51
62
 
52
- export type AppApiProductGetTypesQueryResult = NonNullable<
53
- AsyncReturnType<typeof appApiProductGetTypes>
63
+ export type GetProductTypesQueryResult = NonNullable<
64
+ AsyncReturnType<typeof getProductTypes>
54
65
  >;
55
- export type AppApiProductGetTypesQueryError = AxiosError<AsError | void>;
66
+ export type GetProductTypesQueryError = ErrorType<AsError | void>;
56
67
 
57
- export const useAppApiProductGetTypes = <
58
- TData = AsyncReturnType<typeof appApiProductGetTypes>,
59
- TError = AxiosError<AsError | void>
68
+ export const useGetProductTypes = <
69
+ TData = AsyncReturnType<typeof getProductTypes>,
70
+ TError = ErrorType<AsError | void>
60
71
  >(options?: {
61
72
  query?: UseQueryOptions<
62
- AsyncReturnType<typeof appApiProductGetTypes>,
73
+ AsyncReturnType<typeof getProductTypes>,
63
74
  TError,
64
75
  TData
65
76
  >;
66
- axios?: AxiosRequestConfig;
77
+ request?: SecondParameter<typeof customInstance>;
67
78
  }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
68
- const { query: queryOptions, axios: axiosOptions } = options || {};
79
+ const { query: queryOptions, request: requestOptions } = options || {};
69
80
 
70
- const queryKey = queryOptions?.queryKey ?? getAppApiProductGetTypesQueryKey();
81
+ const queryKey = queryOptions?.queryKey ?? getGetProductTypesQueryKey();
71
82
 
72
- const queryFn: QueryFunction<
73
- AsyncReturnType<typeof appApiProductGetTypes>
74
- > = () => appApiProductGetTypes(axiosOptions);
83
+ const queryFn: QueryFunction<AsyncReturnType<typeof getProductTypes>> = () =>
84
+ getProductTypes(requestOptions);
75
85
 
76
86
  const query = useQuery<
77
- AsyncReturnType<typeof appApiProductGetTypes>,
87
+ AsyncReturnType<typeof getProductTypes>,
78
88
  TError,
79
89
  TData
80
90
  >(queryKey, queryFn, queryOptions);
@@ -90,42 +100,41 @@ export const useAppApiProductGetTypes = <
90
100
 
91
101
  * @summary Gets all Products
92
102
  */
93
- export const appApiProductGet = (
94
- options?: AxiosRequestConfig
95
- ): Promise<AxiosResponse<ProductsGetResponse>> => {
96
- return axios.get(`/product`, options);
103
+ export const getProducts = (
104
+ options?: SecondParameter<typeof customInstance>
105
+ ) => {
106
+ return customInstance<ProductsGetResponse>(
107
+ { url: `/product`, method: "get" },
108
+ options
109
+ );
97
110
  };
98
111
 
99
- export const getAppApiProductGetQueryKey = () => [`/product`];
112
+ export const getGetProductsQueryKey = () => [`/product`];
100
113
 
101
- export type AppApiProductGetQueryResult = NonNullable<
102
- AsyncReturnType<typeof appApiProductGet>
114
+ export type GetProductsQueryResult = NonNullable<
115
+ AsyncReturnType<typeof getProducts>
103
116
  >;
104
- export type AppApiProductGetQueryError = AxiosError<AsError | void>;
117
+ export type GetProductsQueryError = ErrorType<AsError | void>;
105
118
 
106
- export const useAppApiProductGet = <
107
- TData = AsyncReturnType<typeof appApiProductGet>,
108
- TError = AxiosError<AsError | void>
119
+ export const useGetProducts = <
120
+ TData = AsyncReturnType<typeof getProducts>,
121
+ TError = ErrorType<AsError | void>
109
122
  >(options?: {
110
- query?: UseQueryOptions<
111
- AsyncReturnType<typeof appApiProductGet>,
112
- TError,
113
- TData
114
- >;
115
- axios?: AxiosRequestConfig;
123
+ query?: UseQueryOptions<AsyncReturnType<typeof getProducts>, TError, TData>;
124
+ request?: SecondParameter<typeof customInstance>;
116
125
  }): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
117
- const { query: queryOptions, axios: axiosOptions } = options || {};
126
+ const { query: queryOptions, request: requestOptions } = options || {};
118
127
 
119
- const queryKey = queryOptions?.queryKey ?? getAppApiProductGetQueryKey();
128
+ const queryKey = queryOptions?.queryKey ?? getGetProductsQueryKey();
120
129
 
121
- const queryFn: QueryFunction<AsyncReturnType<typeof appApiProductGet>> = () =>
122
- appApiProductGet(axiosOptions);
130
+ const queryFn: QueryFunction<AsyncReturnType<typeof getProducts>> = () =>
131
+ getProducts(requestOptions);
123
132
 
124
- const query = useQuery<
125
- AsyncReturnType<typeof appApiProductGet>,
126
- TError,
127
- TData
128
- >(queryKey, queryFn, queryOptions);
133
+ const query = useQuery<AsyncReturnType<typeof getProducts>, TError, TData>(
134
+ queryKey,
135
+ queryFn,
136
+ queryOptions
137
+ );
129
138
 
130
139
  return {
131
140
  queryKey,
@@ -136,49 +145,53 @@ export const useAppApiProductGet = <
136
145
  /**
137
146
  * @summary Creates a Product for an Organisational Unit
138
147
  */
139
- export const appApiProductPost = (
148
+ export const createUnitProduct = (
140
149
  unitId: string,
141
150
  unitProductPostBodyBody: UnitProductPostBodyBody,
142
- options?: AxiosRequestConfig
143
- ): Promise<AxiosResponse<UnitProductPostResponse>> => {
144
- return axios.post(
145
- `/product/unit/${unitId}`,
146
- unitProductPostBodyBody,
151
+ options?: SecondParameter<typeof customInstance>
152
+ ) => {
153
+ return customInstance<UnitProductPostResponse>(
154
+ {
155
+ url: `/product/unit/${unitId}`,
156
+ method: "post",
157
+ headers: { "Content-Type": "application/json" },
158
+ data: unitProductPostBodyBody,
159
+ },
147
160
  options
148
161
  );
149
162
  };
150
163
 
151
- export type AppApiProductPostMutationResult = NonNullable<
152
- AsyncReturnType<typeof appApiProductPost>
164
+ export type CreateUnitProductMutationResult = NonNullable<
165
+ AsyncReturnType<typeof createUnitProduct>
153
166
  >;
154
- export type AppApiProductPostMutationBody = UnitProductPostBodyBody;
155
- export type AppApiProductPostMutationError = AxiosError<AsError | void>;
167
+ export type CreateUnitProductMutationBody = UnitProductPostBodyBody;
168
+ export type CreateUnitProductMutationError = ErrorType<AsError | void>;
156
169
 
157
- export const useAppApiProductPost = <
158
- TError = AxiosError<AsError | void>,
170
+ export const useCreateUnitProduct = <
171
+ TError = ErrorType<AsError | void>,
159
172
  TContext = unknown
160
173
  >(options?: {
161
174
  mutation?: UseMutationOptions<
162
- AsyncReturnType<typeof appApiProductPost>,
175
+ AsyncReturnType<typeof createUnitProduct>,
163
176
  TError,
164
177
  { unitId: string; data: UnitProductPostBodyBody },
165
178
  TContext
166
179
  >;
167
- axios?: AxiosRequestConfig;
180
+ request?: SecondParameter<typeof customInstance>;
168
181
  }) => {
169
- const { mutation: mutationOptions, axios: axiosOptions } = options || {};
182
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
170
183
 
171
184
  const mutationFn: MutationFunction<
172
- AsyncReturnType<typeof appApiProductPost>,
185
+ AsyncReturnType<typeof createUnitProduct>,
173
186
  { unitId: string; data: UnitProductPostBodyBody }
174
187
  > = (props) => {
175
188
  const { unitId, data } = props || {};
176
189
 
177
- return appApiProductPost(unitId, data, axiosOptions);
190
+ return createUnitProduct(unitId, data, requestOptions);
178
191
  };
179
192
 
180
193
  return useMutation<
181
- AsyncReturnType<typeof appApiProductPost>,
194
+ AsyncReturnType<typeof createUnitProduct>,
182
195
  TError,
183
196
  { unitId: string; data: UnitProductPostBodyBody },
184
197
  TContext
@@ -189,47 +202,50 @@ export const useAppApiProductPost = <
189
202
 
190
203
  * @summary Gets Products for an Organisational Unit
191
204
  */
192
- export const appApiProductGetForUnit = (
205
+ export const getProductsForUnit = (
193
206
  unitId: string,
194
- options?: AxiosRequestConfig
195
- ): Promise<AxiosResponse<ProductsGetResponse>> => {
196
- return axios.get(`/product/unit/${unitId}`, options);
207
+ options?: SecondParameter<typeof customInstance>
208
+ ) => {
209
+ return customInstance<ProductsGetResponse>(
210
+ { url: `/product/unit/${unitId}`, method: "get" },
211
+ options
212
+ );
197
213
  };
198
214
 
199
- export const getAppApiProductGetForUnitQueryKey = (unitId: string) => [
215
+ export const getGetProductsForUnitQueryKey = (unitId: string) => [
200
216
  `/product/unit/${unitId}`,
201
217
  ];
202
218
 
203
- export type AppApiProductGetForUnitQueryResult = NonNullable<
204
- AsyncReturnType<typeof appApiProductGetForUnit>
219
+ export type GetProductsForUnitQueryResult = NonNullable<
220
+ AsyncReturnType<typeof getProductsForUnit>
205
221
  >;
206
- export type AppApiProductGetForUnitQueryError = AxiosError<void | AsError>;
222
+ export type GetProductsForUnitQueryError = ErrorType<void | AsError>;
207
223
 
208
- export const useAppApiProductGetForUnit = <
209
- TData = AsyncReturnType<typeof appApiProductGetForUnit>,
210
- TError = AxiosError<void | AsError>
224
+ export const useGetProductsForUnit = <
225
+ TData = AsyncReturnType<typeof getProductsForUnit>,
226
+ TError = ErrorType<void | AsError>
211
227
  >(
212
228
  unitId: string,
213
229
  options?: {
214
230
  query?: UseQueryOptions<
215
- AsyncReturnType<typeof appApiProductGetForUnit>,
231
+ AsyncReturnType<typeof getProductsForUnit>,
216
232
  TError,
217
233
  TData
218
234
  >;
219
- axios?: AxiosRequestConfig;
235
+ request?: SecondParameter<typeof customInstance>;
220
236
  }
221
237
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
222
- const { query: queryOptions, axios: axiosOptions } = options || {};
238
+ const { query: queryOptions, request: requestOptions } = options || {};
223
239
 
224
240
  const queryKey =
225
- queryOptions?.queryKey ?? getAppApiProductGetForUnitQueryKey(unitId);
241
+ queryOptions?.queryKey ?? getGetProductsForUnitQueryKey(unitId);
226
242
 
227
243
  const queryFn: QueryFunction<
228
- AsyncReturnType<typeof appApiProductGetForUnit>
229
- > = () => appApiProductGetForUnit(unitId, axiosOptions);
244
+ AsyncReturnType<typeof getProductsForUnit>
245
+ > = () => getProductsForUnit(unitId, requestOptions);
230
246
 
231
247
  const query = useQuery<
232
- AsyncReturnType<typeof appApiProductGetForUnit>,
248
+ AsyncReturnType<typeof getProductsForUnit>,
233
249
  TError,
234
250
  TData
235
251
  >(queryKey, queryFn, { enabled: !!unitId, ...queryOptions });
@@ -245,54 +261,50 @@ export const useAppApiProductGetForUnit = <
245
261
 
246
262
  * @summary Gets a Unit's Product
247
263
  */
248
- export const appApiProductGetUnitProduct = (
264
+ export const getProduct = (
249
265
  unitId: string,
250
266
  productId: string,
251
- options?: AxiosRequestConfig
252
- ): Promise<AxiosResponse<ProductUnitGetResponse>> => {
253
- return axios.get(`/product/unit/${unitId}/product/${productId}`, options);
267
+ options?: SecondParameter<typeof customInstance>
268
+ ) => {
269
+ return customInstance<ProductUnitGetResponse>(
270
+ { url: `/product/unit/${unitId}/product/${productId}`, method: "get" },
271
+ options
272
+ );
254
273
  };
255
274
 
256
- export const getAppApiProductGetUnitProductQueryKey = (
257
- unitId: string,
258
- productId: string
259
- ) => [`/product/unit/${unitId}/product/${productId}`];
275
+ export const getGetProductQueryKey = (unitId: string, productId: string) => [
276
+ `/product/unit/${unitId}/product/${productId}`,
277
+ ];
260
278
 
261
- export type AppApiProductGetUnitProductQueryResult = NonNullable<
262
- AsyncReturnType<typeof appApiProductGetUnitProduct>
279
+ export type GetProductQueryResult = NonNullable<
280
+ AsyncReturnType<typeof getProduct>
263
281
  >;
264
- export type AppApiProductGetUnitProductQueryError = AxiosError<AsError | void>;
282
+ export type GetProductQueryError = ErrorType<AsError | void>;
265
283
 
266
- export const useAppApiProductGetUnitProduct = <
267
- TData = AsyncReturnType<typeof appApiProductGetUnitProduct>,
268
- TError = AxiosError<AsError | void>
284
+ export const useGetProduct = <
285
+ TData = AsyncReturnType<typeof getProduct>,
286
+ TError = ErrorType<AsError | void>
269
287
  >(
270
288
  unitId: string,
271
289
  productId: string,
272
290
  options?: {
273
- query?: UseQueryOptions<
274
- AsyncReturnType<typeof appApiProductGetUnitProduct>,
275
- TError,
276
- TData
277
- >;
278
- axios?: AxiosRequestConfig;
291
+ query?: UseQueryOptions<AsyncReturnType<typeof getProduct>, TError, TData>;
292
+ request?: SecondParameter<typeof customInstance>;
279
293
  }
280
294
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } => {
281
- const { query: queryOptions, axios: axiosOptions } = options || {};
295
+ const { query: queryOptions, request: requestOptions } = options || {};
282
296
 
283
297
  const queryKey =
284
- queryOptions?.queryKey ??
285
- getAppApiProductGetUnitProductQueryKey(unitId, productId);
298
+ queryOptions?.queryKey ?? getGetProductQueryKey(unitId, productId);
286
299
 
287
- const queryFn: QueryFunction<
288
- AsyncReturnType<typeof appApiProductGetUnitProduct>
289
- > = () => appApiProductGetUnitProduct(unitId, productId, axiosOptions);
300
+ const queryFn: QueryFunction<AsyncReturnType<typeof getProduct>> = () =>
301
+ getProduct(unitId, productId, requestOptions);
290
302
 
291
- const query = useQuery<
292
- AsyncReturnType<typeof appApiProductGetUnitProduct>,
293
- TError,
294
- TData
295
- >(queryKey, queryFn, { enabled: !!(unitId && productId), ...queryOptions });
303
+ const query = useQuery<AsyncReturnType<typeof getProduct>, TError, TData>(
304
+ queryKey,
305
+ queryFn,
306
+ { enabled: !!(unitId && productId), ...queryOptions }
307
+ );
296
308
 
297
309
  return {
298
310
  queryKey,
@@ -303,45 +315,48 @@ export const useAppApiProductGetUnitProduct = <
303
315
  /**
304
316
  * @summary Deletes an existing Product
305
317
  */
306
- export const appApiProductDelete = (
318
+ export const deleteProduct = (
307
319
  unitId: string,
308
320
  productId: string,
309
- options?: AxiosRequestConfig
310
- ): Promise<AxiosResponse<void>> => {
311
- return axios.delete(`/product/unit/${unitId}/product/${productId}`, options);
321
+ options?: SecondParameter<typeof customInstance>
322
+ ) => {
323
+ return customInstance<void>(
324
+ { url: `/product/unit/${unitId}/product/${productId}`, method: "delete" },
325
+ options
326
+ );
312
327
  };
313
328
 
314
- export type AppApiProductDeleteMutationResult = NonNullable<
315
- AsyncReturnType<typeof appApiProductDelete>
329
+ export type DeleteProductMutationResult = NonNullable<
330
+ AsyncReturnType<typeof deleteProduct>
316
331
  >;
317
332
 
318
- export type AppApiProductDeleteMutationError = AxiosError<AsError>;
333
+ export type DeleteProductMutationError = ErrorType<AsError>;
319
334
 
320
- export const useAppApiProductDelete = <
321
- TError = AxiosError<AsError>,
335
+ export const useDeleteProduct = <
336
+ TError = ErrorType<AsError>,
322
337
  TContext = unknown
323
338
  >(options?: {
324
339
  mutation?: UseMutationOptions<
325
- AsyncReturnType<typeof appApiProductDelete>,
340
+ AsyncReturnType<typeof deleteProduct>,
326
341
  TError,
327
342
  { unitId: string; productId: string },
328
343
  TContext
329
344
  >;
330
- axios?: AxiosRequestConfig;
345
+ request?: SecondParameter<typeof customInstance>;
331
346
  }) => {
332
- const { mutation: mutationOptions, axios: axiosOptions } = options || {};
347
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
333
348
 
334
349
  const mutationFn: MutationFunction<
335
- AsyncReturnType<typeof appApiProductDelete>,
350
+ AsyncReturnType<typeof deleteProduct>,
336
351
  { unitId: string; productId: string }
337
352
  > = (props) => {
338
353
  const { unitId, productId } = props || {};
339
354
 
340
- return appApiProductDelete(unitId, productId, axiosOptions);
355
+ return deleteProduct(unitId, productId, requestOptions);
341
356
  };
342
357
 
343
358
  return useMutation<
344
- AsyncReturnType<typeof appApiProductDelete>,
359
+ AsyncReturnType<typeof deleteProduct>,
345
360
  TError,
346
361
  { unitId: string; productId: string },
347
362
  TContext
@@ -352,50 +367,54 @@ export const useAppApiProductDelete = <
352
367
 
353
368
  * @summary Adjust an existing Product
354
369
  */
355
- export const appApiProductPatch = (
370
+ export const patchProduct = (
356
371
  unitId: string,
357
372
  productId: string,
358
373
  productPatchBodyBody: ProductPatchBodyBody,
359
- options?: AxiosRequestConfig
360
- ): Promise<AxiosResponse<void>> => {
361
- return axios.patch(
362
- `/product/unit/${unitId}/product/${productId}`,
363
- productPatchBodyBody,
374
+ options?: SecondParameter<typeof customInstance>
375
+ ) => {
376
+ return customInstance<void>(
377
+ {
378
+ url: `/product/unit/${unitId}/product/${productId}`,
379
+ method: "patch",
380
+ headers: { "Content-Type": "application/json" },
381
+ data: productPatchBodyBody,
382
+ },
364
383
  options
365
384
  );
366
385
  };
367
386
 
368
- export type AppApiProductPatchMutationResult = NonNullable<
369
- AsyncReturnType<typeof appApiProductPatch>
387
+ export type PatchProductMutationResult = NonNullable<
388
+ AsyncReturnType<typeof patchProduct>
370
389
  >;
371
- export type AppApiProductPatchMutationBody = ProductPatchBodyBody;
372
- export type AppApiProductPatchMutationError = AxiosError<AsError>;
390
+ export type PatchProductMutationBody = ProductPatchBodyBody;
391
+ export type PatchProductMutationError = ErrorType<AsError>;
373
392
 
374
- export const useAppApiProductPatch = <
375
- TError = AxiosError<AsError>,
393
+ export const usePatchProduct = <
394
+ TError = ErrorType<AsError>,
376
395
  TContext = unknown
377
396
  >(options?: {
378
397
  mutation?: UseMutationOptions<
379
- AsyncReturnType<typeof appApiProductPatch>,
398
+ AsyncReturnType<typeof patchProduct>,
380
399
  TError,
381
400
  { unitId: string; productId: string; data: ProductPatchBodyBody },
382
401
  TContext
383
402
  >;
384
- axios?: AxiosRequestConfig;
403
+ request?: SecondParameter<typeof customInstance>;
385
404
  }) => {
386
- const { mutation: mutationOptions, axios: axiosOptions } = options || {};
405
+ const { mutation: mutationOptions, request: requestOptions } = options || {};
387
406
 
388
407
  const mutationFn: MutationFunction<
389
- AsyncReturnType<typeof appApiProductPatch>,
408
+ AsyncReturnType<typeof patchProduct>,
390
409
  { unitId: string; productId: string; data: ProductPatchBodyBody }
391
410
  > = (props) => {
392
411
  const { unitId, productId, data } = props || {};
393
412
 
394
- return appApiProductPatch(unitId, productId, data, axiosOptions);
413
+ return patchProduct(unitId, productId, data, requestOptions);
395
414
  };
396
415
 
397
416
  return useMutation<
398
- AsyncReturnType<typeof appApiProductPatch>,
417
+ AsyncReturnType<typeof patchProduct>,
399
418
  TError,
400
419
  { unitId: string; productId: string; data: ProductPatchBodyBody },
401
420
  TContext