@arascreative/erp-api-client 1.2.0 → 3.0.0

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/dist/index.js CHANGED
@@ -31,22 +31,31 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  ConsumeBatchSourceType: () => ConsumeBatchSourceType,
34
+ ProductClassification: () => ProductClassification,
35
+ ProductStatus: () => ProductStatus,
34
36
  SourceTypeEnum: () => SourceTypeEnum,
35
37
  consumeBatch: () => consumeBatch,
36
38
  consumeBatchBody: () => consumeBatchBody,
37
39
  consumeBatchParams: () => consumeBatchParams,
38
40
  createBatch: () => createBatch,
39
41
  createBatchBody: () => createBatchBody,
40
- createCatalogItem: () => createCatalogItem,
41
- createCatalogItemBody: () => createCatalogItemBody,
42
+ createProduct: () => createProduct,
43
+ createProductBody: () => createProductBody,
42
44
  createStockItems: () => createStockItems,
43
45
  createStockItemsBody: () => createStockItemsBody,
46
+ createVariant: () => createVariant,
47
+ createVariantBody: () => createVariantBody,
48
+ createVariantParams: () => createVariantParams,
44
49
  createWarehouse: () => createWarehouse,
45
50
  createWarehouseBody: () => createWarehouseBody,
46
51
  deleteApiIdentityAdminRolesId: () => deleteApiIdentityAdminRolesId,
47
52
  deleteApiIdentityAdminRolesIdParams: () => deleteApiIdentityAdminRolesIdParams,
48
- deleteCatalogItem: () => deleteCatalogItem,
49
- deleteCatalogItemParams: () => deleteCatalogItemParams,
53
+ deleteProduct: () => deleteProduct,
54
+ deleteProductParams: () => deleteProductParams,
55
+ deleteVariant: () => deleteVariant,
56
+ deleteVariantParams: () => deleteVariantParams,
57
+ deleteVariantPricing: () => deleteVariantPricing,
58
+ deleteVariantPricingParams: () => deleteVariantPricingParams,
50
59
  deleteWarehouse: () => deleteWarehouse,
51
60
  deleteWarehouseParams: () => deleteWarehouseParams,
52
61
  getApiIdentityAdminPermissions: () => getApiIdentityAdminPermissions,
@@ -75,16 +84,16 @@ __export(index_exports, {
75
84
  getApiIdentityManage2faResponse: () => getApiIdentityManage2faResponse,
76
85
  getApiIdentityManageInfo: () => getApiIdentityManageInfo,
77
86
  getApiIdentityManageInfoResponse: () => getApiIdentityManageInfoResponse,
78
- getCatalogItem: () => getCatalogItem,
79
- getCatalogItemParams: () => getCatalogItemParams,
80
- getCatalogItemResponse: () => getCatalogItemResponse,
81
87
  getConsumeBatchMutationOptions: () => getConsumeBatchMutationOptions,
82
88
  getCreateBatchMutationOptions: () => getCreateBatchMutationOptions,
83
- getCreateCatalogItemMutationOptions: () => getCreateCatalogItemMutationOptions,
89
+ getCreateProductMutationOptions: () => getCreateProductMutationOptions,
84
90
  getCreateStockItemsMutationOptions: () => getCreateStockItemsMutationOptions,
91
+ getCreateVariantMutationOptions: () => getCreateVariantMutationOptions,
85
92
  getCreateWarehouseMutationOptions: () => getCreateWarehouseMutationOptions,
86
93
  getDeleteApiIdentityAdminRolesIdMutationOptions: () => getDeleteApiIdentityAdminRolesIdMutationOptions,
87
- getDeleteCatalogItemMutationOptions: () => getDeleteCatalogItemMutationOptions,
94
+ getDeleteProductMutationOptions: () => getDeleteProductMutationOptions,
95
+ getDeleteVariantMutationOptions: () => getDeleteVariantMutationOptions,
96
+ getDeleteVariantPricingMutationOptions: () => getDeleteVariantPricingMutationOptions,
88
97
  getDeleteWarehouseMutationOptions: () => getDeleteWarehouseMutationOptions,
89
98
  getGetApiIdentityAdminPermissionsQueryKey: () => getGetApiIdentityAdminPermissionsQueryKey,
90
99
  getGetApiIdentityAdminPermissionsQueryOptions: () => getGetApiIdentityAdminPermissionsQueryOptions,
@@ -104,21 +113,27 @@ __export(index_exports, {
104
113
  getGetApiIdentityManage2faQueryOptions: () => getGetApiIdentityManage2faQueryOptions,
105
114
  getGetApiIdentityManageInfoQueryKey: () => getGetApiIdentityManageInfoQueryKey,
106
115
  getGetApiIdentityManageInfoQueryOptions: () => getGetApiIdentityManageInfoQueryOptions,
107
- getGetCatalogItemQueryKey: () => getGetCatalogItemQueryKey,
108
- getGetCatalogItemQueryOptions: () => getGetCatalogItemQueryOptions,
109
116
  getGetHealthQueryKey: () => getGetHealthQueryKey,
110
117
  getGetHealthQueryOptions: () => getGetHealthQueryOptions,
118
+ getGetProductQueryKey: () => getGetProductQueryKey,
119
+ getGetProductQueryOptions: () => getGetProductQueryOptions,
120
+ getGetVariantPricingQueryKey: () => getGetVariantPricingQueryKey,
121
+ getGetVariantPricingQueryOptions: () => getGetVariantPricingQueryOptions,
122
+ getGetVariantQueryKey: () => getGetVariantQueryKey,
123
+ getGetVariantQueryOptions: () => getGetVariantQueryOptions,
111
124
  getGetWarehouseByIdQueryKey: () => getGetWarehouseByIdQueryKey,
112
125
  getGetWarehouseByIdQueryOptions: () => getGetWarehouseByIdQueryOptions,
113
126
  getGetWarehouseOptionsQueryKey: () => getGetWarehouseOptionsQueryKey,
114
127
  getGetWarehouseOptionsQueryOptions: () => getGetWarehouseOptionsQueryOptions,
115
128
  getHealth: () => getHealth,
116
- getListCatalogItemsQueryKey: () => getListCatalogItemsQueryKey,
117
- getListCatalogItemsQueryOptions: () => getListCatalogItemsQueryOptions,
129
+ getListProductsQueryKey: () => getListProductsQueryKey,
130
+ getListProductsQueryOptions: () => getListProductsQueryOptions,
118
131
  getListStockItemsQueryKey: () => getListStockItemsQueryKey,
119
132
  getListStockItemsQueryOptions: () => getListStockItemsQueryOptions,
120
133
  getListStockMovementsQueryKey: () => getListStockMovementsQueryKey,
121
134
  getListStockMovementsQueryOptions: () => getListStockMovementsQueryOptions,
135
+ getListVariantsQueryKey: () => getListVariantsQueryKey,
136
+ getListVariantsQueryOptions: () => getListVariantsQueryOptions,
122
137
  getListWarehousesQueryKey: () => getListWarehousesQueryKey,
123
138
  getListWarehousesQueryOptions: () => getListWarehousesQueryOptions,
124
139
  getPostApiIdentityAdminRolesMutationOptions: () => getPostApiIdentityAdminRolesMutationOptions,
@@ -129,6 +144,9 @@ __export(index_exports, {
129
144
  getPostApiIdentityManage2faMutationOptions: () => getPostApiIdentityManage2faMutationOptions,
130
145
  getPostApiIdentityManageInfoMutationOptions: () => getPostApiIdentityManageInfoMutationOptions,
131
146
  getPostApiIdentityResetPasswordMutationOptions: () => getPostApiIdentityResetPasswordMutationOptions,
147
+ getProduct: () => getProduct,
148
+ getProductParams: () => getProductParams,
149
+ getProductResponse: () => getProductResponse,
132
150
  getPutApiIdentityAdminRolesIdMutationOptions: () => getPutApiIdentityAdminRolesIdMutationOptions,
133
151
  getPutApiIdentityAdminRolesIdPermissionsMutationOptions: () => getPutApiIdentityAdminRolesIdPermissionsMutationOptions,
134
152
  getPutApiIdentityAdminUsersIdActiveMutationOptions: () => getPutApiIdentityAdminUsersIdActiveMutationOptions,
@@ -136,19 +154,27 @@ __export(index_exports, {
136
154
  getSearchAddressesQueryKey: () => getSearchAddressesQueryKey,
137
155
  getSearchAddressesQueryOptions: () => getSearchAddressesQueryOptions,
138
156
  getToggleWarehouseStatusMutationOptions: () => getToggleWarehouseStatusMutationOptions,
139
- getUpdateCatalogItemMutationOptions: () => getUpdateCatalogItemMutationOptions,
157
+ getUpdateProductMutationOptions: () => getUpdateProductMutationOptions,
158
+ getUpdateVariantMutationOptions: () => getUpdateVariantMutationOptions,
140
159
  getUpdateWarehouseMutationOptions: () => getUpdateWarehouseMutationOptions,
160
+ getUpsertVariantPricingMutationOptions: () => getUpsertVariantPricingMutationOptions,
161
+ getVariant: () => getVariant,
162
+ getVariantParams: () => getVariantParams,
163
+ getVariantPricing: () => getVariantPricing,
164
+ getVariantPricingParams: () => getVariantPricingParams,
165
+ getVariantPricingResponse: () => getVariantPricingResponse,
166
+ getVariantResponse: () => getVariantResponse,
141
167
  getWarehouseById: () => getWarehouseById,
142
168
  getWarehouseByIdParams: () => getWarehouseByIdParams,
143
169
  getWarehouseByIdResponse: () => getWarehouseByIdResponse,
144
170
  getWarehouseOptions: () => getWarehouseOptions,
145
171
  getWarehouseOptionsResponse: () => getWarehouseOptionsResponse,
146
172
  getWarehouseOptionsResponseItem: () => getWarehouseOptionsResponseItem,
147
- listCatalogItems: () => listCatalogItems,
148
- listCatalogItemsQueryPageDefault: () => listCatalogItemsQueryPageDefault,
149
- listCatalogItemsQueryPageSizeDefault: () => listCatalogItemsQueryPageSizeDefault,
150
- listCatalogItemsQueryParams: () => listCatalogItemsQueryParams,
151
- listCatalogItemsResponse: () => listCatalogItemsResponse,
173
+ listProducts: () => listProducts,
174
+ listProductsQueryPageDefault: () => listProductsQueryPageDefault,
175
+ listProductsQueryPageSizeDefault: () => listProductsQueryPageSizeDefault,
176
+ listProductsQueryParams: () => listProductsQueryParams,
177
+ listProductsResponse: () => listProductsResponse,
152
178
  listStockItems: () => listStockItems,
153
179
  listStockItemsQueryDescendingDefault: () => listStockItemsQueryDescendingDefault,
154
180
  listStockItemsQueryPageDefault: () => listStockItemsQueryPageDefault,
@@ -161,6 +187,12 @@ __export(index_exports, {
161
187
  listStockMovementsQueryPageSizeDefault: () => listStockMovementsQueryPageSizeDefault,
162
188
  listStockMovementsQueryParams: () => listStockMovementsQueryParams,
163
189
  listStockMovementsResponse: () => listStockMovementsResponse,
190
+ listVariants: () => listVariants,
191
+ listVariantsParams: () => listVariantsParams,
192
+ listVariantsQueryPageDefault: () => listVariantsQueryPageDefault,
193
+ listVariantsQueryPageSizeDefault: () => listVariantsQueryPageSizeDefault,
194
+ listVariantsQueryParams: () => listVariantsQueryParams,
195
+ listVariantsResponse: () => listVariantsResponse,
164
196
  listWarehouses: () => listWarehouses,
165
197
  listWarehousesQueryPageDefault: () => listWarehousesQueryPageDefault,
166
198
  listWarehousesQueryPageSizeDefault: () => listWarehousesQueryPageSizeDefault,
@@ -203,20 +235,31 @@ __export(index_exports, {
203
235
  searchAddressesResponseItem: () => searchAddressesResponseItem,
204
236
  toggleWarehouseStatus: () => toggleWarehouseStatus,
205
237
  toggleWarehouseStatusParams: () => toggleWarehouseStatusParams,
206
- updateCatalogItem: () => updateCatalogItem,
207
- updateCatalogItemBody: () => updateCatalogItemBody,
208
- updateCatalogItemParams: () => updateCatalogItemParams,
209
- updateCatalogItemResponse: () => updateCatalogItemResponse,
238
+ updateProduct: () => updateProduct,
239
+ updateProductBody: () => updateProductBody,
240
+ updateProductParams: () => updateProductParams,
241
+ updateProductResponse: () => updateProductResponse,
242
+ updateVariant: () => updateVariant,
243
+ updateVariantBody: () => updateVariantBody,
244
+ updateVariantParams: () => updateVariantParams,
245
+ updateVariantResponse: () => updateVariantResponse,
210
246
  updateWarehouse: () => updateWarehouse,
211
247
  updateWarehouseBody: () => updateWarehouseBody,
212
248
  updateWarehouseParams: () => updateWarehouseParams,
249
+ upsertVariantPricing: () => upsertVariantPricing,
250
+ upsertVariantPricingBody: () => upsertVariantPricingBody,
251
+ upsertVariantPricingParams: () => upsertVariantPricingParams,
252
+ upsertVariantPricingResponse: () => upsertVariantPricingResponse,
213
253
  useConsumeBatch: () => useConsumeBatch,
214
254
  useCreateBatch: () => useCreateBatch,
215
- useCreateCatalogItem: () => useCreateCatalogItem,
255
+ useCreateProduct: () => useCreateProduct,
216
256
  useCreateStockItems: () => useCreateStockItems,
257
+ useCreateVariant: () => useCreateVariant,
217
258
  useCreateWarehouse: () => useCreateWarehouse,
218
259
  useDeleteApiIdentityAdminRolesId: () => useDeleteApiIdentityAdminRolesId,
219
- useDeleteCatalogItem: () => useDeleteCatalogItem,
260
+ useDeleteProduct: () => useDeleteProduct,
261
+ useDeleteVariant: () => useDeleteVariant,
262
+ useDeleteVariantPricing: () => useDeleteVariantPricing,
220
263
  useDeleteWarehouse: () => useDeleteWarehouse,
221
264
  useGetApiIdentityAdminPermissions: () => useGetApiIdentityAdminPermissions,
222
265
  useGetApiIdentityAdminRoles: () => useGetApiIdentityAdminRoles,
@@ -227,13 +270,16 @@ __export(index_exports, {
227
270
  useGetApiIdentityAntiforgery: () => useGetApiIdentityAntiforgery,
228
271
  useGetApiIdentityManage2fa: () => useGetApiIdentityManage2fa,
229
272
  useGetApiIdentityManageInfo: () => useGetApiIdentityManageInfo,
230
- useGetCatalogItem: () => useGetCatalogItem,
231
273
  useGetHealth: () => useGetHealth,
274
+ useGetProduct: () => useGetProduct,
275
+ useGetVariant: () => useGetVariant,
276
+ useGetVariantPricing: () => useGetVariantPricing,
232
277
  useGetWarehouseById: () => useGetWarehouseById,
233
278
  useGetWarehouseOptions: () => useGetWarehouseOptions,
234
- useListCatalogItems: () => useListCatalogItems,
279
+ useListProducts: () => useListProducts,
235
280
  useListStockItems: () => useListStockItems,
236
281
  useListStockMovements: () => useListStockMovements,
282
+ useListVariants: () => useListVariants,
237
283
  useListWarehouses: () => useListWarehouses,
238
284
  usePostApiIdentityAdminRoles: () => usePostApiIdentityAdminRoles,
239
285
  usePostApiIdentityAdminUsersIdLogout: () => usePostApiIdentityAdminUsersIdLogout,
@@ -249,8 +295,10 @@ __export(index_exports, {
249
295
  usePutApiIdentityAdminUsersIdRoles: () => usePutApiIdentityAdminUsersIdRoles,
250
296
  useSearchAddresses: () => useSearchAddresses,
251
297
  useToggleWarehouseStatus: () => useToggleWarehouseStatus,
252
- useUpdateCatalogItem: () => useUpdateCatalogItem,
253
- useUpdateWarehouse: () => useUpdateWarehouse
298
+ useUpdateProduct: () => useUpdateProduct,
299
+ useUpdateVariant: () => useUpdateVariant,
300
+ useUpdateWarehouse: () => useUpdateWarehouse,
301
+ useUpsertVariantPricing: () => useUpsertVariantPricing
254
302
  });
255
303
  module.exports = __toCommonJS(index_exports);
256
304
 
@@ -265,6 +313,15 @@ var ConsumeBatchSourceType = {
265
313
  DAMAGED: "DAMAGED",
266
314
  INTERNAL_USE: "INTERNAL_USE"
267
315
  };
316
+ var ProductClassification = {
317
+ Physical: "Physical",
318
+ Digital: "Digital"
319
+ };
320
+ var ProductStatus = {
321
+ Tes: "Tes",
322
+ Live: "Live",
323
+ Archived: "Archived"
324
+ };
268
325
  var SourceTypeEnum = {
269
326
  PURCHASE: "PURCHASE",
270
327
  CUSTOMER_RETURN: "CUSTOMER_RETURN",
@@ -430,91 +487,236 @@ function useSearchAddresses(params, options, queryClient) {
430
487
  query.queryKey = queryOptions.queryKey;
431
488
  return query;
432
489
  }
433
- var createCatalogItem = (upsertCatalogItemRequest, options) => {
434
- return import_axios.default.post(`/api/catalog`, upsertCatalogItemRequest, options);
490
+ var createProduct = (createProductRequest, options) => {
491
+ return import_axios.default.post(`/api/catalog/products`, createProductRequest, options);
435
492
  };
436
- var getCreateCatalogItemMutationOptions = (options) => {
437
- const mutationKey = ["createCatalogItem"];
493
+ var getCreateProductMutationOptions = (options) => {
494
+ const mutationKey = ["createProduct"];
438
495
  const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
439
496
  const mutationFn = (props) => {
440
497
  const { data } = props ?? {};
441
- return createCatalogItem(data, axiosOptions);
498
+ return createProduct(data, axiosOptions);
442
499
  };
443
500
  return { mutationFn, ...mutationOptions };
444
501
  };
445
- var useCreateCatalogItem = (options, queryClient) => {
446
- const mutationOptions = getCreateCatalogItemMutationOptions(options);
502
+ var useCreateProduct = (options, queryClient) => {
503
+ const mutationOptions = getCreateProductMutationOptions(options);
447
504
  return (0, import_react_query.useMutation)(mutationOptions, queryClient);
448
505
  };
449
- var listCatalogItems = (params, options) => {
450
- return import_axios.default.get(`/api/catalog`, {
506
+ var listProducts = (params, options) => {
507
+ return import_axios.default.get(`/api/catalog/products`, {
451
508
  ...options,
452
509
  params: { ...params, ...options?.params }
453
510
  });
454
511
  };
455
- var getListCatalogItemsQueryKey = (params) => {
456
- return [`/api/catalog`, ...params ? [params] : []];
512
+ var getListProductsQueryKey = (params) => {
513
+ return [`/api/catalog/products`, ...params ? [params] : []];
457
514
  };
458
- var getListCatalogItemsQueryOptions = (params, options) => {
515
+ var getListProductsQueryOptions = (params, options) => {
459
516
  const { query: queryOptions, axios: axiosOptions } = options ?? {};
460
- const queryKey = queryOptions?.queryKey ?? getListCatalogItemsQueryKey(params);
461
- const queryFn = ({ signal }) => listCatalogItems(params, { signal, ...axiosOptions });
517
+ const queryKey = queryOptions?.queryKey ?? getListProductsQueryKey(params);
518
+ const queryFn = ({ signal }) => listProducts(params, { signal, ...axiosOptions });
462
519
  return { queryKey, queryFn, ...queryOptions };
463
520
  };
464
- function useListCatalogItems(params, options, queryClient) {
465
- const queryOptions = getListCatalogItemsQueryOptions(params, options);
521
+ function useListProducts(params, options, queryClient) {
522
+ const queryOptions = getListProductsQueryOptions(params, options);
523
+ const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
524
+ query.queryKey = queryOptions.queryKey;
525
+ return query;
526
+ }
527
+ var getProduct = (id, options) => {
528
+ return import_axios.default.get(`/api/catalog/products/${id}`, options);
529
+ };
530
+ var getGetProductQueryKey = (id) => {
531
+ return [`/api/catalog/products/${id}`];
532
+ };
533
+ var getGetProductQueryOptions = (id, options) => {
534
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
535
+ const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(id);
536
+ const queryFn = ({ signal }) => getProduct(id, { signal, ...axiosOptions });
537
+ return { queryKey, queryFn, enabled: !!id, ...queryOptions };
538
+ };
539
+ function useGetProduct(id, options, queryClient) {
540
+ const queryOptions = getGetProductQueryOptions(id, options);
466
541
  const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
467
542
  query.queryKey = queryOptions.queryKey;
468
543
  return query;
469
544
  }
470
- var updateCatalogItem = (id, upsertCatalogItemRequest, options) => {
471
- return import_axios.default.put(`/api/catalog/${id}`, upsertCatalogItemRequest, options);
545
+ var updateProduct = (id, updateProductRequest, options) => {
546
+ return import_axios.default.put(`/api/catalog/products/${id}`, updateProductRequest, options);
472
547
  };
473
- var getUpdateCatalogItemMutationOptions = (options) => {
474
- const mutationKey = ["updateCatalogItem"];
548
+ var getUpdateProductMutationOptions = (options) => {
549
+ const mutationKey = ["updateProduct"];
475
550
  const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
476
551
  const mutationFn = (props) => {
477
552
  const { id, data } = props ?? {};
478
- return updateCatalogItem(id, data, axiosOptions);
553
+ return updateProduct(id, data, axiosOptions);
554
+ };
555
+ return { mutationFn, ...mutationOptions };
556
+ };
557
+ var useUpdateProduct = (options, queryClient) => {
558
+ const mutationOptions = getUpdateProductMutationOptions(options);
559
+ return (0, import_react_query.useMutation)(mutationOptions, queryClient);
560
+ };
561
+ var deleteProduct = (id, options) => {
562
+ return import_axios.default.delete(`/api/catalog/products/${id}`, options);
563
+ };
564
+ var getDeleteProductMutationOptions = (options) => {
565
+ const mutationKey = ["deleteProduct"];
566
+ const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
567
+ const mutationFn = (props) => {
568
+ const { id } = props ?? {};
569
+ return deleteProduct(id, axiosOptions);
570
+ };
571
+ return { mutationFn, ...mutationOptions };
572
+ };
573
+ var useDeleteProduct = (options, queryClient) => {
574
+ const mutationOptions = getDeleteProductMutationOptions(options);
575
+ return (0, import_react_query.useMutation)(mutationOptions, queryClient);
576
+ };
577
+ var createVariant = (productId, createVariantRequest, options) => {
578
+ return import_axios.default.post(`/api/catalog/products/${productId}/variants`, createVariantRequest, options);
579
+ };
580
+ var getCreateVariantMutationOptions = (options) => {
581
+ const mutationKey = ["createVariant"];
582
+ const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
583
+ const mutationFn = (props) => {
584
+ const { productId, data } = props ?? {};
585
+ return createVariant(productId, data, axiosOptions);
479
586
  };
480
587
  return { mutationFn, ...mutationOptions };
481
588
  };
482
- var useUpdateCatalogItem = (options, queryClient) => {
483
- const mutationOptions = getUpdateCatalogItemMutationOptions(options);
589
+ var useCreateVariant = (options, queryClient) => {
590
+ const mutationOptions = getCreateVariantMutationOptions(options);
484
591
  return (0, import_react_query.useMutation)(mutationOptions, queryClient);
485
592
  };
486
- var getCatalogItem = (id, options) => {
487
- return import_axios.default.get(`/api/catalog/${id}`, options);
593
+ var listVariants = (productId, params, options) => {
594
+ return import_axios.default.get(`/api/catalog/products/${productId}/variants`, {
595
+ ...options,
596
+ params: { ...params, ...options?.params }
597
+ });
488
598
  };
489
- var getGetCatalogItemQueryKey = (id) => {
490
- return [`/api/catalog/${id}`];
599
+ var getListVariantsQueryKey = (productId, params) => {
600
+ return [`/api/catalog/products/${productId}/variants`, ...params ? [params] : []];
491
601
  };
492
- var getGetCatalogItemQueryOptions = (id, options) => {
602
+ var getListVariantsQueryOptions = (productId, params, options) => {
493
603
  const { query: queryOptions, axios: axiosOptions } = options ?? {};
494
- const queryKey = queryOptions?.queryKey ?? getGetCatalogItemQueryKey(id);
495
- const queryFn = ({ signal }) => getCatalogItem(id, { signal, ...axiosOptions });
496
- return { queryKey, queryFn, enabled: !!id, ...queryOptions };
604
+ const queryKey = queryOptions?.queryKey ?? getListVariantsQueryKey(productId, params);
605
+ const queryFn = ({ signal }) => listVariants(productId, params, { signal, ...axiosOptions });
606
+ return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
497
607
  };
498
- function useGetCatalogItem(id, options, queryClient) {
499
- const queryOptions = getGetCatalogItemQueryOptions(id, options);
608
+ function useListVariants(productId, params, options, queryClient) {
609
+ const queryOptions = getListVariantsQueryOptions(productId, params, options);
500
610
  const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
501
611
  query.queryKey = queryOptions.queryKey;
502
612
  return query;
503
613
  }
504
- var deleteCatalogItem = (id, options) => {
505
- return import_axios.default.delete(`/api/catalog/${id}`, options);
614
+ var getVariant = (productId, id, options) => {
615
+ return import_axios.default.get(`/api/catalog/products/${productId}/variants/${id}`, options);
616
+ };
617
+ var getGetVariantQueryKey = (productId, id) => {
618
+ return [`/api/catalog/products/${productId}/variants/${id}`];
506
619
  };
507
- var getDeleteCatalogItemMutationOptions = (options) => {
508
- const mutationKey = ["deleteCatalogItem"];
620
+ var getGetVariantQueryOptions = (productId, id, options) => {
621
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
622
+ const queryKey = queryOptions?.queryKey ?? getGetVariantQueryKey(productId, id);
623
+ const queryFn = ({ signal }) => getVariant(productId, id, { signal, ...axiosOptions });
624
+ return { queryKey, queryFn, enabled: !!(productId && id), ...queryOptions };
625
+ };
626
+ function useGetVariant(productId, id, options, queryClient) {
627
+ const queryOptions = getGetVariantQueryOptions(productId, id, options);
628
+ const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
629
+ query.queryKey = queryOptions.queryKey;
630
+ return query;
631
+ }
632
+ var updateVariant = (productId, id, updateVariantRequest, options) => {
633
+ return import_axios.default.put(
634
+ `/api/catalog/products/${productId}/variants/${id}`,
635
+ updateVariantRequest,
636
+ options
637
+ );
638
+ };
639
+ var getUpdateVariantMutationOptions = (options) => {
640
+ const mutationKey = ["updateVariant"];
509
641
  const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
510
642
  const mutationFn = (props) => {
511
- const { id } = props ?? {};
512
- return deleteCatalogItem(id, axiosOptions);
643
+ const { productId, id, data } = props ?? {};
644
+ return updateVariant(productId, id, data, axiosOptions);
513
645
  };
514
646
  return { mutationFn, ...mutationOptions };
515
647
  };
516
- var useDeleteCatalogItem = (options, queryClient) => {
517
- const mutationOptions = getDeleteCatalogItemMutationOptions(options);
648
+ var useUpdateVariant = (options, queryClient) => {
649
+ const mutationOptions = getUpdateVariantMutationOptions(options);
650
+ return (0, import_react_query.useMutation)(mutationOptions, queryClient);
651
+ };
652
+ var deleteVariant = (productId, id, options) => {
653
+ return import_axios.default.delete(`/api/catalog/products/${productId}/variants/${id}`, options);
654
+ };
655
+ var getDeleteVariantMutationOptions = (options) => {
656
+ const mutationKey = ["deleteVariant"];
657
+ const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
658
+ const mutationFn = (props) => {
659
+ const { productId, id } = props ?? {};
660
+ return deleteVariant(productId, id, axiosOptions);
661
+ };
662
+ return { mutationFn, ...mutationOptions };
663
+ };
664
+ var useDeleteVariant = (options, queryClient) => {
665
+ const mutationOptions = getDeleteVariantMutationOptions(options);
666
+ return (0, import_react_query.useMutation)(mutationOptions, queryClient);
667
+ };
668
+ var getVariantPricing = (variantId, options) => {
669
+ return import_axios.default.get(`/api/catalog/variants/${variantId}/pricing`, options);
670
+ };
671
+ var getGetVariantPricingQueryKey = (variantId) => {
672
+ return [`/api/catalog/variants/${variantId}/pricing`];
673
+ };
674
+ var getGetVariantPricingQueryOptions = (variantId, options) => {
675
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
676
+ const queryKey = queryOptions?.queryKey ?? getGetVariantPricingQueryKey(variantId);
677
+ const queryFn = ({ signal }) => getVariantPricing(variantId, { signal, ...axiosOptions });
678
+ return { queryKey, queryFn, enabled: !!variantId, ...queryOptions };
679
+ };
680
+ function useGetVariantPricing(variantId, options, queryClient) {
681
+ const queryOptions = getGetVariantPricingQueryOptions(variantId, options);
682
+ const query = (0, import_react_query.useQuery)(queryOptions, queryClient);
683
+ query.queryKey = queryOptions.queryKey;
684
+ return query;
685
+ }
686
+ var upsertVariantPricing = (variantId, upsertVariantPricingRequest, options) => {
687
+ return import_axios.default.put(
688
+ `/api/catalog/variants/${variantId}/pricing`,
689
+ upsertVariantPricingRequest,
690
+ options
691
+ );
692
+ };
693
+ var getUpsertVariantPricingMutationOptions = (options) => {
694
+ const mutationKey = ["upsertVariantPricing"];
695
+ const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
696
+ const mutationFn = (props) => {
697
+ const { variantId, data } = props ?? {};
698
+ return upsertVariantPricing(variantId, data, axiosOptions);
699
+ };
700
+ return { mutationFn, ...mutationOptions };
701
+ };
702
+ var useUpsertVariantPricing = (options, queryClient) => {
703
+ const mutationOptions = getUpsertVariantPricingMutationOptions(options);
704
+ return (0, import_react_query.useMutation)(mutationOptions, queryClient);
705
+ };
706
+ var deleteVariantPricing = (variantId, options) => {
707
+ return import_axios.default.delete(`/api/catalog/variants/${variantId}/pricing`, options);
708
+ };
709
+ var getDeleteVariantPricingMutationOptions = (options) => {
710
+ const mutationKey = ["deleteVariantPricing"];
711
+ const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
712
+ const mutationFn = (props) => {
713
+ const { variantId } = props ?? {};
714
+ return deleteVariantPricing(variantId, axiosOptions);
715
+ };
716
+ return { mutationFn, ...mutationOptions };
717
+ };
718
+ var useDeleteVariantPricing = (options, queryClient) => {
719
+ const mutationOptions = getDeleteVariantPricingMutationOptions(options);
518
720
  return (0, import_react_query.useMutation)(mutationOptions, queryClient);
519
721
  };
520
722
  var createStockItems = (createStockItemCommand, options) => {
@@ -570,15 +772,15 @@ var useCreateBatch = (options, queryClient) => {
570
772
  const mutationOptions = getCreateBatchMutationOptions(options);
571
773
  return (0, import_react_query.useMutation)(mutationOptions, queryClient);
572
774
  };
573
- var consumeBatch = (id, consumeBatchRequest, options) => {
574
- return import_axios.default.post(`/api/batches/${id}/consume`, consumeBatchRequest, options);
775
+ var consumeBatch = (itemId, consumeBatchRequest, options) => {
776
+ return import_axios.default.post(`/api/batches/${itemId}/consume`, consumeBatchRequest, options);
575
777
  };
576
778
  var getConsumeBatchMutationOptions = (options) => {
577
779
  const mutationKey = ["consumeBatch"];
578
780
  const { mutation: mutationOptions, axios: axiosOptions } = options ? options.mutation && "mutationKey" in options.mutation && options.mutation.mutationKey ? options : { ...options, mutation: { ...options.mutation, mutationKey } } : { mutation: { mutationKey }, axios: void 0 };
579
781
  const mutationFn = (props) => {
580
- const { id, data } = props ?? {};
581
- return consumeBatch(id, data, axiosOptions);
782
+ const { itemId, data } = props ?? {};
783
+ return consumeBatch(itemId, data, axiosOptions);
582
784
  };
583
785
  return { mutationFn, ...mutationOptions };
584
786
  };
@@ -1103,66 +1305,28 @@ var searchAddressesResponseItem = zod.strictObject({
1103
1305
  zipCode: zod.string().optional()
1104
1306
  });
1105
1307
  var searchAddressesResponse = zod.array(searchAddressesResponseItem);
1106
- var createCatalogItemBody = zod.strictObject({
1308
+ var createProductBody = zod.strictObject({
1107
1309
  categoryId: zod.uuid(),
1108
1310
  name: zod.string(),
1109
1311
  slug: zod.string(),
1110
- status: zod.string(),
1111
- classification: zod.string(),
1112
- variants: zod.array(
1113
- zod.strictObject({
1114
- id: zod.uuid().nullish(),
1115
- code: zod.string(),
1116
- itemId: zod.uuid(),
1117
- multiplier: zod.number(),
1118
- attributes: zod.array(
1119
- zod.strictObject({
1120
- name: zod.string(),
1121
- value: zod.string()
1122
- })
1123
- ),
1124
- weight: zod.strictObject({
1125
- value: zod.number(),
1126
- unit: zod.string()
1127
- }),
1128
- price: zod.strictObject({
1129
- baseAmount: zod.number(),
1130
- baseCurrency: zod.string(),
1131
- sale: zod.union([
1132
- zod.null(),
1133
- zod.strictObject({
1134
- amount: zod.number(),
1135
- currency: zod.string(),
1136
- startAt: zod.iso.datetime({}),
1137
- endAt: zod.iso.datetime({})
1138
- })
1139
- ]).optional(),
1140
- wholesale: zod.array(
1141
- zod.strictObject({
1142
- minQty: zod.number(),
1143
- amount: zod.number(),
1144
- currency: zod.string()
1145
- })
1146
- ).nullish()
1147
- })
1148
- })
1149
- )
1312
+ status: zod.enum(["Tes", "Live", "Archived"]).optional(),
1313
+ classification: zod.enum(["Physical", "Digital"])
1150
1314
  });
1151
- var listCatalogItemsQueryPageDefault = 1;
1152
- var listCatalogItemsQueryPageSizeDefault = 10;
1153
- var listCatalogItemsQueryParams = zod.strictObject({
1154
- page: zod.coerce.number().default(listCatalogItemsQueryPageDefault),
1155
- pageSize: zod.coerce.number().default(listCatalogItemsQueryPageSizeDefault)
1315
+ var listProductsQueryPageDefault = 1;
1316
+ var listProductsQueryPageSizeDefault = 10;
1317
+ var listProductsQueryParams = zod.strictObject({
1318
+ page: zod.coerce.number().default(listProductsQueryPageDefault),
1319
+ pageSize: zod.coerce.number().default(listProductsQueryPageSizeDefault)
1156
1320
  });
1157
- var listCatalogItemsResponse = zod.strictObject({
1321
+ var listProductsResponse = zod.strictObject({
1158
1322
  items: zod.array(
1159
1323
  zod.strictObject({
1160
1324
  id: zod.uuid(),
1161
1325
  categoryId: zod.uuid(),
1162
1326
  name: zod.string(),
1163
1327
  slug: zod.string(),
1164
- status: zod.string(),
1165
- classification: zod.string(),
1328
+ status: zod.enum(["Tes", "Live", "Archived"]),
1329
+ classification: zod.enum(["Physical", "Digital"]),
1166
1330
  variantCount: zod.number()
1167
1331
  })
1168
1332
  ),
@@ -1173,152 +1337,222 @@ var listCatalogItemsResponse = zod.strictObject({
1173
1337
  hasNextPage: zod.boolean().optional(),
1174
1338
  hasPreviousPage: zod.boolean().optional()
1175
1339
  });
1176
- var updateCatalogItemParams = zod.strictObject({
1340
+ var getProductParams = zod.strictObject({
1177
1341
  id: zod.uuid()
1178
1342
  });
1179
- var updateCatalogItemBody = zod.strictObject({
1343
+ var getProductResponse = zod.strictObject({
1344
+ id: zod.uuid(),
1180
1345
  categoryId: zod.uuid(),
1181
1346
  name: zod.string(),
1182
1347
  slug: zod.string(),
1183
- status: zod.string(),
1184
- classification: zod.string(),
1185
- variants: zod.array(
1186
- zod.strictObject({
1187
- id: zod.uuid().nullish(),
1188
- code: zod.string(),
1189
- itemId: zod.uuid(),
1190
- multiplier: zod.number(),
1191
- attributes: zod.array(
1192
- zod.strictObject({
1193
- name: zod.string(),
1194
- value: zod.string()
1195
- })
1196
- ),
1197
- weight: zod.strictObject({
1198
- value: zod.number(),
1199
- unit: zod.string()
1200
- }),
1201
- price: zod.strictObject({
1202
- baseAmount: zod.number(),
1203
- baseCurrency: zod.string(),
1204
- sale: zod.union([
1205
- zod.null(),
1206
- zod.strictObject({
1207
- amount: zod.number(),
1208
- currency: zod.string(),
1209
- startAt: zod.iso.datetime({}),
1210
- endAt: zod.iso.datetime({})
1211
- })
1212
- ]).optional(),
1213
- wholesale: zod.array(
1214
- zod.strictObject({
1215
- minQty: zod.number(),
1216
- amount: zod.number(),
1217
- currency: zod.string()
1218
- })
1219
- ).nullish()
1220
- })
1221
- })
1222
- )
1348
+ status: zod.enum(["Tes", "Live", "Archived"]),
1349
+ classification: zod.enum(["Physical", "Digital"]),
1350
+ variantCount: zod.number()
1351
+ });
1352
+ var updateProductParams = zod.strictObject({
1353
+ id: zod.uuid()
1223
1354
  });
1224
- var updateCatalogItemResponse = zod.strictObject({
1355
+ var updateProductBody = zod.strictObject({
1356
+ categoryId: zod.uuid(),
1357
+ name: zod.string(),
1358
+ slug: zod.string(),
1359
+ status: zod.enum(["Tes", "Live", "Archived"]),
1360
+ classification: zod.enum(["Physical", "Digital"])
1361
+ });
1362
+ var updateProductResponse = zod.strictObject({
1225
1363
  id: zod.uuid(),
1226
1364
  categoryId: zod.uuid(),
1227
1365
  name: zod.string(),
1228
1366
  slug: zod.string(),
1229
- status: zod.string(),
1230
- classification: zod.string(),
1231
- variants: zod.array(
1367
+ status: zod.enum(["Tes", "Live", "Archived"]),
1368
+ classification: zod.enum(["Physical", "Digital"]),
1369
+ variantCount: zod.number()
1370
+ });
1371
+ var deleteProductParams = zod.strictObject({
1372
+ id: zod.uuid()
1373
+ });
1374
+ var createVariantParams = zod.strictObject({
1375
+ productId: zod.uuid()
1376
+ });
1377
+ var createVariantBody = zod.strictObject({
1378
+ code: zod.string(),
1379
+ attributes: zod.array(
1232
1380
  zod.strictObject({
1233
- id: zod.uuid().nullish(),
1381
+ name: zod.string(),
1382
+ value: zod.string()
1383
+ })
1384
+ ).optional(),
1385
+ weight: zod.strictObject({
1386
+ value: zod.number(),
1387
+ unit: zod.string()
1388
+ })
1389
+ });
1390
+ var listVariantsParams = zod.strictObject({
1391
+ productId: zod.uuid()
1392
+ });
1393
+ var listVariantsQueryPageDefault = 1;
1394
+ var listVariantsQueryPageSizeDefault = 10;
1395
+ var listVariantsQueryParams = zod.strictObject({
1396
+ page: zod.coerce.number().default(listVariantsQueryPageDefault),
1397
+ pageSize: zod.coerce.number().default(listVariantsQueryPageSizeDefault)
1398
+ });
1399
+ var listVariantsResponse = zod.strictObject({
1400
+ items: zod.array(
1401
+ zod.strictObject({
1402
+ id: zod.uuid(),
1403
+ productId: zod.uuid(),
1234
1404
  code: zod.string(),
1235
- itemId: zod.uuid(),
1236
- multiplier: zod.number(),
1237
1405
  attributes: zod.array(
1238
1406
  zod.strictObject({
1239
1407
  name: zod.string(),
1240
1408
  value: zod.string()
1241
1409
  })
1242
- ),
1410
+ ).optional(),
1243
1411
  weight: zod.strictObject({
1244
1412
  value: zod.number(),
1245
1413
  unit: zod.string()
1246
- }),
1247
- price: zod.strictObject({
1248
- baseAmount: zod.number(),
1249
- baseCurrency: zod.string(),
1250
- sale: zod.union([
1251
- zod.null(),
1252
- zod.strictObject({
1253
- amount: zod.number(),
1254
- currency: zod.string(),
1255
- startAt: zod.iso.datetime({}),
1256
- endAt: zod.iso.datetime({})
1257
- })
1258
- ]).optional(),
1259
- wholesale: zod.array(
1260
- zod.strictObject({
1261
- minQty: zod.number(),
1262
- amount: zod.number(),
1263
- currency: zod.string()
1264
- })
1265
- ).nullish()
1266
1414
  })
1267
1415
  })
1268
- )
1416
+ ),
1417
+ page: zod.number(),
1418
+ pageSize: zod.number(),
1419
+ totalCount: zod.number(),
1420
+ totalPages: zod.number().optional(),
1421
+ hasNextPage: zod.boolean().optional(),
1422
+ hasPreviousPage: zod.boolean().optional()
1269
1423
  });
1270
- var getCatalogItemParams = zod.strictObject({
1424
+ var getVariantParams = zod.strictObject({
1425
+ productId: zod.uuid(),
1271
1426
  id: zod.uuid()
1272
1427
  });
1273
- var getCatalogItemResponse = zod.strictObject({
1428
+ var getVariantResponse = zod.strictObject({
1274
1429
  id: zod.uuid(),
1275
- categoryId: zod.uuid(),
1276
- name: zod.string(),
1277
- slug: zod.string(),
1278
- status: zod.string(),
1279
- classification: zod.string(),
1280
- variants: zod.array(
1430
+ productId: zod.uuid(),
1431
+ code: zod.string(),
1432
+ attributes: zod.array(
1281
1433
  zod.strictObject({
1282
- id: zod.uuid().nullish(),
1283
- code: zod.string(),
1284
- itemId: zod.uuid(),
1285
- multiplier: zod.number(),
1286
- attributes: zod.array(
1287
- zod.strictObject({
1288
- name: zod.string(),
1289
- value: zod.string()
1290
- })
1291
- ),
1292
- weight: zod.strictObject({
1293
- value: zod.number(),
1294
- unit: zod.string()
1295
- }),
1296
- price: zod.strictObject({
1297
- baseAmount: zod.number(),
1298
- baseCurrency: zod.string(),
1299
- sale: zod.union([
1300
- zod.null(),
1301
- zod.strictObject({
1302
- amount: zod.number(),
1303
- currency: zod.string(),
1304
- startAt: zod.iso.datetime({}),
1305
- endAt: zod.iso.datetime({})
1306
- })
1307
- ]).optional(),
1308
- wholesale: zod.array(
1309
- zod.strictObject({
1310
- minQty: zod.number(),
1311
- amount: zod.number(),
1312
- currency: zod.string()
1313
- })
1314
- ).nullish()
1315
- })
1434
+ name: zod.string(),
1435
+ value: zod.string()
1316
1436
  })
1317
- )
1437
+ ).optional(),
1438
+ weight: zod.strictObject({
1439
+ value: zod.number(),
1440
+ unit: zod.string()
1441
+ })
1318
1442
  });
1319
- var deleteCatalogItemParams = zod.strictObject({
1443
+ var updateVariantParams = zod.strictObject({
1444
+ productId: zod.uuid(),
1320
1445
  id: zod.uuid()
1321
1446
  });
1447
+ var updateVariantBody = zod.strictObject({
1448
+ code: zod.string(),
1449
+ attributes: zod.array(
1450
+ zod.strictObject({
1451
+ name: zod.string(),
1452
+ value: zod.string()
1453
+ })
1454
+ ).optional(),
1455
+ weight: zod.strictObject({
1456
+ value: zod.number(),
1457
+ unit: zod.string()
1458
+ })
1459
+ });
1460
+ var updateVariantResponse = zod.strictObject({
1461
+ id: zod.uuid(),
1462
+ productId: zod.uuid(),
1463
+ code: zod.string(),
1464
+ attributes: zod.array(
1465
+ zod.strictObject({
1466
+ name: zod.string(),
1467
+ value: zod.string()
1468
+ })
1469
+ ).optional(),
1470
+ weight: zod.strictObject({
1471
+ value: zod.number(),
1472
+ unit: zod.string()
1473
+ })
1474
+ });
1475
+ var deleteVariantParams = zod.strictObject({
1476
+ productId: zod.uuid(),
1477
+ id: zod.uuid()
1478
+ });
1479
+ var getVariantPricingParams = zod.strictObject({
1480
+ variantId: zod.uuid()
1481
+ });
1482
+ var getVariantPricingResponse = zod.strictObject({
1483
+ variantId: zod.uuid(),
1484
+ baseAmount: zod.number(),
1485
+ baseCurrency: zod.string(),
1486
+ effectiveAmount: zod.number(),
1487
+ effectiveCurrency: zod.string(),
1488
+ sale: zod.union([
1489
+ zod.null(),
1490
+ zod.strictObject({
1491
+ amount: zod.number(),
1492
+ currency: zod.string(),
1493
+ startAt: zod.iso.datetime({}),
1494
+ endAt: zod.iso.datetime({}),
1495
+ isActive: zod.boolean()
1496
+ })
1497
+ ]).optional(),
1498
+ wholesale: zod.array(
1499
+ zod.strictObject({
1500
+ minQty: zod.number(),
1501
+ amount: zod.number(),
1502
+ currency: zod.string()
1503
+ })
1504
+ ).optional()
1505
+ });
1506
+ var upsertVariantPricingParams = zod.strictObject({
1507
+ variantId: zod.uuid()
1508
+ });
1509
+ var upsertVariantPricingBody = zod.strictObject({
1510
+ baseAmount: zod.number(),
1511
+ baseCurrency: zod.string(),
1512
+ sale: zod.union([
1513
+ zod.null(),
1514
+ zod.strictObject({
1515
+ amount: zod.number(),
1516
+ currency: zod.string(),
1517
+ startAt: zod.iso.datetime({}),
1518
+ endAt: zod.iso.datetime({})
1519
+ })
1520
+ ]).optional(),
1521
+ wholesale: zod.array(
1522
+ zod.strictObject({
1523
+ minQty: zod.number(),
1524
+ amount: zod.number(),
1525
+ currency: zod.string()
1526
+ })
1527
+ ).optional()
1528
+ });
1529
+ var upsertVariantPricingResponse = zod.strictObject({
1530
+ variantId: zod.uuid(),
1531
+ baseAmount: zod.number(),
1532
+ baseCurrency: zod.string(),
1533
+ effectiveAmount: zod.number(),
1534
+ effectiveCurrency: zod.string(),
1535
+ sale: zod.union([
1536
+ zod.null(),
1537
+ zod.strictObject({
1538
+ amount: zod.number(),
1539
+ currency: zod.string(),
1540
+ startAt: zod.iso.datetime({}),
1541
+ endAt: zod.iso.datetime({}),
1542
+ isActive: zod.boolean()
1543
+ })
1544
+ ]).optional(),
1545
+ wholesale: zod.array(
1546
+ zod.strictObject({
1547
+ minQty: zod.number(),
1548
+ amount: zod.number(),
1549
+ currency: zod.string()
1550
+ })
1551
+ ).optional()
1552
+ });
1553
+ var deleteVariantPricingParams = zod.strictObject({
1554
+ variantId: zod.uuid()
1555
+ });
1322
1556
  var createStockItemsBody = zod.strictObject({
1323
1557
  name: zod.string(),
1324
1558
  sku: zod.string(),
@@ -1371,9 +1605,10 @@ var createBatchBody = zod.strictObject({
1371
1605
  receivedBy: zod.string().nullish()
1372
1606
  });
1373
1607
  var consumeBatchParams = zod.strictObject({
1374
- id: zod.uuid().describe("Batch identifier.")
1608
+ itemId: zod.uuid().describe("Stock item identifier.")
1375
1609
  });
1376
1610
  var consumeBatchBody = zod.strictObject({
1611
+ warehouseId: zod.uuid(),
1377
1612
  quantity: zod.number(),
1378
1613
  sourceType: zod.enum([
1379
1614
  "LOAN_OUT",
@@ -1560,22 +1795,31 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1560
1795
  // Annotate the CommonJS export names for ESM import in node:
1561
1796
  0 && (module.exports = {
1562
1797
  ConsumeBatchSourceType,
1798
+ ProductClassification,
1799
+ ProductStatus,
1563
1800
  SourceTypeEnum,
1564
1801
  consumeBatch,
1565
1802
  consumeBatchBody,
1566
1803
  consumeBatchParams,
1567
1804
  createBatch,
1568
1805
  createBatchBody,
1569
- createCatalogItem,
1570
- createCatalogItemBody,
1806
+ createProduct,
1807
+ createProductBody,
1571
1808
  createStockItems,
1572
1809
  createStockItemsBody,
1810
+ createVariant,
1811
+ createVariantBody,
1812
+ createVariantParams,
1573
1813
  createWarehouse,
1574
1814
  createWarehouseBody,
1575
1815
  deleteApiIdentityAdminRolesId,
1576
1816
  deleteApiIdentityAdminRolesIdParams,
1577
- deleteCatalogItem,
1578
- deleteCatalogItemParams,
1817
+ deleteProduct,
1818
+ deleteProductParams,
1819
+ deleteVariant,
1820
+ deleteVariantParams,
1821
+ deleteVariantPricing,
1822
+ deleteVariantPricingParams,
1579
1823
  deleteWarehouse,
1580
1824
  deleteWarehouseParams,
1581
1825
  getApiIdentityAdminPermissions,
@@ -1604,16 +1848,16 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1604
1848
  getApiIdentityManage2faResponse,
1605
1849
  getApiIdentityManageInfo,
1606
1850
  getApiIdentityManageInfoResponse,
1607
- getCatalogItem,
1608
- getCatalogItemParams,
1609
- getCatalogItemResponse,
1610
1851
  getConsumeBatchMutationOptions,
1611
1852
  getCreateBatchMutationOptions,
1612
- getCreateCatalogItemMutationOptions,
1853
+ getCreateProductMutationOptions,
1613
1854
  getCreateStockItemsMutationOptions,
1855
+ getCreateVariantMutationOptions,
1614
1856
  getCreateWarehouseMutationOptions,
1615
1857
  getDeleteApiIdentityAdminRolesIdMutationOptions,
1616
- getDeleteCatalogItemMutationOptions,
1858
+ getDeleteProductMutationOptions,
1859
+ getDeleteVariantMutationOptions,
1860
+ getDeleteVariantPricingMutationOptions,
1617
1861
  getDeleteWarehouseMutationOptions,
1618
1862
  getGetApiIdentityAdminPermissionsQueryKey,
1619
1863
  getGetApiIdentityAdminPermissionsQueryOptions,
@@ -1633,21 +1877,27 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1633
1877
  getGetApiIdentityManage2faQueryOptions,
1634
1878
  getGetApiIdentityManageInfoQueryKey,
1635
1879
  getGetApiIdentityManageInfoQueryOptions,
1636
- getGetCatalogItemQueryKey,
1637
- getGetCatalogItemQueryOptions,
1638
1880
  getGetHealthQueryKey,
1639
1881
  getGetHealthQueryOptions,
1882
+ getGetProductQueryKey,
1883
+ getGetProductQueryOptions,
1884
+ getGetVariantPricingQueryKey,
1885
+ getGetVariantPricingQueryOptions,
1886
+ getGetVariantQueryKey,
1887
+ getGetVariantQueryOptions,
1640
1888
  getGetWarehouseByIdQueryKey,
1641
1889
  getGetWarehouseByIdQueryOptions,
1642
1890
  getGetWarehouseOptionsQueryKey,
1643
1891
  getGetWarehouseOptionsQueryOptions,
1644
1892
  getHealth,
1645
- getListCatalogItemsQueryKey,
1646
- getListCatalogItemsQueryOptions,
1893
+ getListProductsQueryKey,
1894
+ getListProductsQueryOptions,
1647
1895
  getListStockItemsQueryKey,
1648
1896
  getListStockItemsQueryOptions,
1649
1897
  getListStockMovementsQueryKey,
1650
1898
  getListStockMovementsQueryOptions,
1899
+ getListVariantsQueryKey,
1900
+ getListVariantsQueryOptions,
1651
1901
  getListWarehousesQueryKey,
1652
1902
  getListWarehousesQueryOptions,
1653
1903
  getPostApiIdentityAdminRolesMutationOptions,
@@ -1658,6 +1908,9 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1658
1908
  getPostApiIdentityManage2faMutationOptions,
1659
1909
  getPostApiIdentityManageInfoMutationOptions,
1660
1910
  getPostApiIdentityResetPasswordMutationOptions,
1911
+ getProduct,
1912
+ getProductParams,
1913
+ getProductResponse,
1661
1914
  getPutApiIdentityAdminRolesIdMutationOptions,
1662
1915
  getPutApiIdentityAdminRolesIdPermissionsMutationOptions,
1663
1916
  getPutApiIdentityAdminUsersIdActiveMutationOptions,
@@ -1665,19 +1918,27 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1665
1918
  getSearchAddressesQueryKey,
1666
1919
  getSearchAddressesQueryOptions,
1667
1920
  getToggleWarehouseStatusMutationOptions,
1668
- getUpdateCatalogItemMutationOptions,
1921
+ getUpdateProductMutationOptions,
1922
+ getUpdateVariantMutationOptions,
1669
1923
  getUpdateWarehouseMutationOptions,
1924
+ getUpsertVariantPricingMutationOptions,
1925
+ getVariant,
1926
+ getVariantParams,
1927
+ getVariantPricing,
1928
+ getVariantPricingParams,
1929
+ getVariantPricingResponse,
1930
+ getVariantResponse,
1670
1931
  getWarehouseById,
1671
1932
  getWarehouseByIdParams,
1672
1933
  getWarehouseByIdResponse,
1673
1934
  getWarehouseOptions,
1674
1935
  getWarehouseOptionsResponse,
1675
1936
  getWarehouseOptionsResponseItem,
1676
- listCatalogItems,
1677
- listCatalogItemsQueryPageDefault,
1678
- listCatalogItemsQueryPageSizeDefault,
1679
- listCatalogItemsQueryParams,
1680
- listCatalogItemsResponse,
1937
+ listProducts,
1938
+ listProductsQueryPageDefault,
1939
+ listProductsQueryPageSizeDefault,
1940
+ listProductsQueryParams,
1941
+ listProductsResponse,
1681
1942
  listStockItems,
1682
1943
  listStockItemsQueryDescendingDefault,
1683
1944
  listStockItemsQueryPageDefault,
@@ -1690,6 +1951,12 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1690
1951
  listStockMovementsQueryPageSizeDefault,
1691
1952
  listStockMovementsQueryParams,
1692
1953
  listStockMovementsResponse,
1954
+ listVariants,
1955
+ listVariantsParams,
1956
+ listVariantsQueryPageDefault,
1957
+ listVariantsQueryPageSizeDefault,
1958
+ listVariantsQueryParams,
1959
+ listVariantsResponse,
1693
1960
  listWarehouses,
1694
1961
  listWarehousesQueryPageDefault,
1695
1962
  listWarehousesQueryPageSizeDefault,
@@ -1732,20 +1999,31 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1732
1999
  searchAddressesResponseItem,
1733
2000
  toggleWarehouseStatus,
1734
2001
  toggleWarehouseStatusParams,
1735
- updateCatalogItem,
1736
- updateCatalogItemBody,
1737
- updateCatalogItemParams,
1738
- updateCatalogItemResponse,
2002
+ updateProduct,
2003
+ updateProductBody,
2004
+ updateProductParams,
2005
+ updateProductResponse,
2006
+ updateVariant,
2007
+ updateVariantBody,
2008
+ updateVariantParams,
2009
+ updateVariantResponse,
1739
2010
  updateWarehouse,
1740
2011
  updateWarehouseBody,
1741
2012
  updateWarehouseParams,
2013
+ upsertVariantPricing,
2014
+ upsertVariantPricingBody,
2015
+ upsertVariantPricingParams,
2016
+ upsertVariantPricingResponse,
1742
2017
  useConsumeBatch,
1743
2018
  useCreateBatch,
1744
- useCreateCatalogItem,
2019
+ useCreateProduct,
1745
2020
  useCreateStockItems,
2021
+ useCreateVariant,
1746
2022
  useCreateWarehouse,
1747
2023
  useDeleteApiIdentityAdminRolesId,
1748
- useDeleteCatalogItem,
2024
+ useDeleteProduct,
2025
+ useDeleteVariant,
2026
+ useDeleteVariantPricing,
1749
2027
  useDeleteWarehouse,
1750
2028
  useGetApiIdentityAdminPermissions,
1751
2029
  useGetApiIdentityAdminRoles,
@@ -1756,13 +2034,16 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1756
2034
  useGetApiIdentityAntiforgery,
1757
2035
  useGetApiIdentityManage2fa,
1758
2036
  useGetApiIdentityManageInfo,
1759
- useGetCatalogItem,
1760
2037
  useGetHealth,
2038
+ useGetProduct,
2039
+ useGetVariant,
2040
+ useGetVariantPricing,
1761
2041
  useGetWarehouseById,
1762
2042
  useGetWarehouseOptions,
1763
- useListCatalogItems,
2043
+ useListProducts,
1764
2044
  useListStockItems,
1765
2045
  useListStockMovements,
2046
+ useListVariants,
1766
2047
  useListWarehouses,
1767
2048
  usePostApiIdentityAdminRoles,
1768
2049
  usePostApiIdentityAdminUsersIdLogout,
@@ -1778,7 +2059,9 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1778
2059
  usePutApiIdentityAdminUsersIdRoles,
1779
2060
  useSearchAddresses,
1780
2061
  useToggleWarehouseStatus,
1781
- useUpdateCatalogItem,
1782
- useUpdateWarehouse
2062
+ useUpdateProduct,
2063
+ useUpdateVariant,
2064
+ useUpdateWarehouse,
2065
+ useUpsertVariantPricing
1783
2066
  });
1784
2067
  //# sourceMappingURL=index.js.map