@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.mjs CHANGED
@@ -9,6 +9,15 @@ var ConsumeBatchSourceType = {
9
9
  DAMAGED: "DAMAGED",
10
10
  INTERNAL_USE: "INTERNAL_USE"
11
11
  };
12
+ var ProductClassification = {
13
+ Physical: "Physical",
14
+ Digital: "Digital"
15
+ };
16
+ var ProductStatus = {
17
+ Tes: "Tes",
18
+ Live: "Live",
19
+ Archived: "Archived"
20
+ };
12
21
  var SourceTypeEnum = {
13
22
  PURCHASE: "PURCHASE",
14
23
  CUSTOMER_RETURN: "CUSTOMER_RETURN",
@@ -174,91 +183,236 @@ function useSearchAddresses(params, options, queryClient) {
174
183
  query.queryKey = queryOptions.queryKey;
175
184
  return query;
176
185
  }
177
- var createCatalogItem = (upsertCatalogItemRequest, options) => {
178
- return axios.post(`/api/catalog`, upsertCatalogItemRequest, options);
186
+ var createProduct = (createProductRequest, options) => {
187
+ return axios.post(`/api/catalog/products`, createProductRequest, options);
179
188
  };
180
- var getCreateCatalogItemMutationOptions = (options) => {
181
- const mutationKey = ["createCatalogItem"];
189
+ var getCreateProductMutationOptions = (options) => {
190
+ const mutationKey = ["createProduct"];
182
191
  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 };
183
192
  const mutationFn = (props) => {
184
193
  const { data } = props ?? {};
185
- return createCatalogItem(data, axiosOptions);
194
+ return createProduct(data, axiosOptions);
186
195
  };
187
196
  return { mutationFn, ...mutationOptions };
188
197
  };
189
- var useCreateCatalogItem = (options, queryClient) => {
190
- const mutationOptions = getCreateCatalogItemMutationOptions(options);
198
+ var useCreateProduct = (options, queryClient) => {
199
+ const mutationOptions = getCreateProductMutationOptions(options);
191
200
  return useMutation(mutationOptions, queryClient);
192
201
  };
193
- var listCatalogItems = (params, options) => {
194
- return axios.get(`/api/catalog`, {
202
+ var listProducts = (params, options) => {
203
+ return axios.get(`/api/catalog/products`, {
195
204
  ...options,
196
205
  params: { ...params, ...options?.params }
197
206
  });
198
207
  };
199
- var getListCatalogItemsQueryKey = (params) => {
200
- return [`/api/catalog`, ...params ? [params] : []];
208
+ var getListProductsQueryKey = (params) => {
209
+ return [`/api/catalog/products`, ...params ? [params] : []];
201
210
  };
202
- var getListCatalogItemsQueryOptions = (params, options) => {
211
+ var getListProductsQueryOptions = (params, options) => {
203
212
  const { query: queryOptions, axios: axiosOptions } = options ?? {};
204
- const queryKey = queryOptions?.queryKey ?? getListCatalogItemsQueryKey(params);
205
- const queryFn = ({ signal }) => listCatalogItems(params, { signal, ...axiosOptions });
213
+ const queryKey = queryOptions?.queryKey ?? getListProductsQueryKey(params);
214
+ const queryFn = ({ signal }) => listProducts(params, { signal, ...axiosOptions });
206
215
  return { queryKey, queryFn, ...queryOptions };
207
216
  };
208
- function useListCatalogItems(params, options, queryClient) {
209
- const queryOptions = getListCatalogItemsQueryOptions(params, options);
217
+ function useListProducts(params, options, queryClient) {
218
+ const queryOptions = getListProductsQueryOptions(params, options);
219
+ const query = useQuery(queryOptions, queryClient);
220
+ query.queryKey = queryOptions.queryKey;
221
+ return query;
222
+ }
223
+ var getProduct = (id, options) => {
224
+ return axios.get(`/api/catalog/products/${id}`, options);
225
+ };
226
+ var getGetProductQueryKey = (id) => {
227
+ return [`/api/catalog/products/${id}`];
228
+ };
229
+ var getGetProductQueryOptions = (id, options) => {
230
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
231
+ const queryKey = queryOptions?.queryKey ?? getGetProductQueryKey(id);
232
+ const queryFn = ({ signal }) => getProduct(id, { signal, ...axiosOptions });
233
+ return { queryKey, queryFn, enabled: !!id, ...queryOptions };
234
+ };
235
+ function useGetProduct(id, options, queryClient) {
236
+ const queryOptions = getGetProductQueryOptions(id, options);
210
237
  const query = useQuery(queryOptions, queryClient);
211
238
  query.queryKey = queryOptions.queryKey;
212
239
  return query;
213
240
  }
214
- var updateCatalogItem = (id, upsertCatalogItemRequest, options) => {
215
- return axios.put(`/api/catalog/${id}`, upsertCatalogItemRequest, options);
241
+ var updateProduct = (id, updateProductRequest, options) => {
242
+ return axios.put(`/api/catalog/products/${id}`, updateProductRequest, options);
216
243
  };
217
- var getUpdateCatalogItemMutationOptions = (options) => {
218
- const mutationKey = ["updateCatalogItem"];
244
+ var getUpdateProductMutationOptions = (options) => {
245
+ const mutationKey = ["updateProduct"];
219
246
  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 };
220
247
  const mutationFn = (props) => {
221
248
  const { id, data } = props ?? {};
222
- return updateCatalogItem(id, data, axiosOptions);
249
+ return updateProduct(id, data, axiosOptions);
250
+ };
251
+ return { mutationFn, ...mutationOptions };
252
+ };
253
+ var useUpdateProduct = (options, queryClient) => {
254
+ const mutationOptions = getUpdateProductMutationOptions(options);
255
+ return useMutation(mutationOptions, queryClient);
256
+ };
257
+ var deleteProduct = (id, options) => {
258
+ return axios.delete(`/api/catalog/products/${id}`, options);
259
+ };
260
+ var getDeleteProductMutationOptions = (options) => {
261
+ const mutationKey = ["deleteProduct"];
262
+ 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 };
263
+ const mutationFn = (props) => {
264
+ const { id } = props ?? {};
265
+ return deleteProduct(id, axiosOptions);
266
+ };
267
+ return { mutationFn, ...mutationOptions };
268
+ };
269
+ var useDeleteProduct = (options, queryClient) => {
270
+ const mutationOptions = getDeleteProductMutationOptions(options);
271
+ return useMutation(mutationOptions, queryClient);
272
+ };
273
+ var createVariant = (productId, createVariantRequest, options) => {
274
+ return axios.post(`/api/catalog/products/${productId}/variants`, createVariantRequest, options);
275
+ };
276
+ var getCreateVariantMutationOptions = (options) => {
277
+ const mutationKey = ["createVariant"];
278
+ 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 };
279
+ const mutationFn = (props) => {
280
+ const { productId, data } = props ?? {};
281
+ return createVariant(productId, data, axiosOptions);
223
282
  };
224
283
  return { mutationFn, ...mutationOptions };
225
284
  };
226
- var useUpdateCatalogItem = (options, queryClient) => {
227
- const mutationOptions = getUpdateCatalogItemMutationOptions(options);
285
+ var useCreateVariant = (options, queryClient) => {
286
+ const mutationOptions = getCreateVariantMutationOptions(options);
228
287
  return useMutation(mutationOptions, queryClient);
229
288
  };
230
- var getCatalogItem = (id, options) => {
231
- return axios.get(`/api/catalog/${id}`, options);
289
+ var listVariants = (productId, params, options) => {
290
+ return axios.get(`/api/catalog/products/${productId}/variants`, {
291
+ ...options,
292
+ params: { ...params, ...options?.params }
293
+ });
232
294
  };
233
- var getGetCatalogItemQueryKey = (id) => {
234
- return [`/api/catalog/${id}`];
295
+ var getListVariantsQueryKey = (productId, params) => {
296
+ return [`/api/catalog/products/${productId}/variants`, ...params ? [params] : []];
235
297
  };
236
- var getGetCatalogItemQueryOptions = (id, options) => {
298
+ var getListVariantsQueryOptions = (productId, params, options) => {
237
299
  const { query: queryOptions, axios: axiosOptions } = options ?? {};
238
- const queryKey = queryOptions?.queryKey ?? getGetCatalogItemQueryKey(id);
239
- const queryFn = ({ signal }) => getCatalogItem(id, { signal, ...axiosOptions });
240
- return { queryKey, queryFn, enabled: !!id, ...queryOptions };
300
+ const queryKey = queryOptions?.queryKey ?? getListVariantsQueryKey(productId, params);
301
+ const queryFn = ({ signal }) => listVariants(productId, params, { signal, ...axiosOptions });
302
+ return { queryKey, queryFn, enabled: !!productId, ...queryOptions };
241
303
  };
242
- function useGetCatalogItem(id, options, queryClient) {
243
- const queryOptions = getGetCatalogItemQueryOptions(id, options);
304
+ function useListVariants(productId, params, options, queryClient) {
305
+ const queryOptions = getListVariantsQueryOptions(productId, params, options);
244
306
  const query = useQuery(queryOptions, queryClient);
245
307
  query.queryKey = queryOptions.queryKey;
246
308
  return query;
247
309
  }
248
- var deleteCatalogItem = (id, options) => {
249
- return axios.delete(`/api/catalog/${id}`, options);
310
+ var getVariant = (productId, id, options) => {
311
+ return axios.get(`/api/catalog/products/${productId}/variants/${id}`, options);
312
+ };
313
+ var getGetVariantQueryKey = (productId, id) => {
314
+ return [`/api/catalog/products/${productId}/variants/${id}`];
250
315
  };
251
- var getDeleteCatalogItemMutationOptions = (options) => {
252
- const mutationKey = ["deleteCatalogItem"];
316
+ var getGetVariantQueryOptions = (productId, id, options) => {
317
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
318
+ const queryKey = queryOptions?.queryKey ?? getGetVariantQueryKey(productId, id);
319
+ const queryFn = ({ signal }) => getVariant(productId, id, { signal, ...axiosOptions });
320
+ return { queryKey, queryFn, enabled: !!(productId && id), ...queryOptions };
321
+ };
322
+ function useGetVariant(productId, id, options, queryClient) {
323
+ const queryOptions = getGetVariantQueryOptions(productId, id, options);
324
+ const query = useQuery(queryOptions, queryClient);
325
+ query.queryKey = queryOptions.queryKey;
326
+ return query;
327
+ }
328
+ var updateVariant = (productId, id, updateVariantRequest, options) => {
329
+ return axios.put(
330
+ `/api/catalog/products/${productId}/variants/${id}`,
331
+ updateVariantRequest,
332
+ options
333
+ );
334
+ };
335
+ var getUpdateVariantMutationOptions = (options) => {
336
+ const mutationKey = ["updateVariant"];
253
337
  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 };
254
338
  const mutationFn = (props) => {
255
- const { id } = props ?? {};
256
- return deleteCatalogItem(id, axiosOptions);
339
+ const { productId, id, data } = props ?? {};
340
+ return updateVariant(productId, id, data, axiosOptions);
257
341
  };
258
342
  return { mutationFn, ...mutationOptions };
259
343
  };
260
- var useDeleteCatalogItem = (options, queryClient) => {
261
- const mutationOptions = getDeleteCatalogItemMutationOptions(options);
344
+ var useUpdateVariant = (options, queryClient) => {
345
+ const mutationOptions = getUpdateVariantMutationOptions(options);
346
+ return useMutation(mutationOptions, queryClient);
347
+ };
348
+ var deleteVariant = (productId, id, options) => {
349
+ return axios.delete(`/api/catalog/products/${productId}/variants/${id}`, options);
350
+ };
351
+ var getDeleteVariantMutationOptions = (options) => {
352
+ const mutationKey = ["deleteVariant"];
353
+ 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 };
354
+ const mutationFn = (props) => {
355
+ const { productId, id } = props ?? {};
356
+ return deleteVariant(productId, id, axiosOptions);
357
+ };
358
+ return { mutationFn, ...mutationOptions };
359
+ };
360
+ var useDeleteVariant = (options, queryClient) => {
361
+ const mutationOptions = getDeleteVariantMutationOptions(options);
362
+ return useMutation(mutationOptions, queryClient);
363
+ };
364
+ var getVariantPricing = (variantId, options) => {
365
+ return axios.get(`/api/catalog/variants/${variantId}/pricing`, options);
366
+ };
367
+ var getGetVariantPricingQueryKey = (variantId) => {
368
+ return [`/api/catalog/variants/${variantId}/pricing`];
369
+ };
370
+ var getGetVariantPricingQueryOptions = (variantId, options) => {
371
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
372
+ const queryKey = queryOptions?.queryKey ?? getGetVariantPricingQueryKey(variantId);
373
+ const queryFn = ({ signal }) => getVariantPricing(variantId, { signal, ...axiosOptions });
374
+ return { queryKey, queryFn, enabled: !!variantId, ...queryOptions };
375
+ };
376
+ function useGetVariantPricing(variantId, options, queryClient) {
377
+ const queryOptions = getGetVariantPricingQueryOptions(variantId, options);
378
+ const query = useQuery(queryOptions, queryClient);
379
+ query.queryKey = queryOptions.queryKey;
380
+ return query;
381
+ }
382
+ var upsertVariantPricing = (variantId, upsertVariantPricingRequest, options) => {
383
+ return axios.put(
384
+ `/api/catalog/variants/${variantId}/pricing`,
385
+ upsertVariantPricingRequest,
386
+ options
387
+ );
388
+ };
389
+ var getUpsertVariantPricingMutationOptions = (options) => {
390
+ const mutationKey = ["upsertVariantPricing"];
391
+ 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 };
392
+ const mutationFn = (props) => {
393
+ const { variantId, data } = props ?? {};
394
+ return upsertVariantPricing(variantId, data, axiosOptions);
395
+ };
396
+ return { mutationFn, ...mutationOptions };
397
+ };
398
+ var useUpsertVariantPricing = (options, queryClient) => {
399
+ const mutationOptions = getUpsertVariantPricingMutationOptions(options);
400
+ return useMutation(mutationOptions, queryClient);
401
+ };
402
+ var deleteVariantPricing = (variantId, options) => {
403
+ return axios.delete(`/api/catalog/variants/${variantId}/pricing`, options);
404
+ };
405
+ var getDeleteVariantPricingMutationOptions = (options) => {
406
+ const mutationKey = ["deleteVariantPricing"];
407
+ 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 };
408
+ const mutationFn = (props) => {
409
+ const { variantId } = props ?? {};
410
+ return deleteVariantPricing(variantId, axiosOptions);
411
+ };
412
+ return { mutationFn, ...mutationOptions };
413
+ };
414
+ var useDeleteVariantPricing = (options, queryClient) => {
415
+ const mutationOptions = getDeleteVariantPricingMutationOptions(options);
262
416
  return useMutation(mutationOptions, queryClient);
263
417
  };
264
418
  var createStockItems = (createStockItemCommand, options) => {
@@ -314,15 +468,15 @@ var useCreateBatch = (options, queryClient) => {
314
468
  const mutationOptions = getCreateBatchMutationOptions(options);
315
469
  return useMutation(mutationOptions, queryClient);
316
470
  };
317
- var consumeBatch = (id, consumeBatchRequest, options) => {
318
- return axios.post(`/api/batches/${id}/consume`, consumeBatchRequest, options);
471
+ var consumeBatch = (itemId, consumeBatchRequest, options) => {
472
+ return axios.post(`/api/batches/${itemId}/consume`, consumeBatchRequest, options);
319
473
  };
320
474
  var getConsumeBatchMutationOptions = (options) => {
321
475
  const mutationKey = ["consumeBatch"];
322
476
  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 };
323
477
  const mutationFn = (props) => {
324
- const { id, data } = props ?? {};
325
- return consumeBatch(id, data, axiosOptions);
478
+ const { itemId, data } = props ?? {};
479
+ return consumeBatch(itemId, data, axiosOptions);
326
480
  };
327
481
  return { mutationFn, ...mutationOptions };
328
482
  };
@@ -847,66 +1001,28 @@ var searchAddressesResponseItem = zod.strictObject({
847
1001
  zipCode: zod.string().optional()
848
1002
  });
849
1003
  var searchAddressesResponse = zod.array(searchAddressesResponseItem);
850
- var createCatalogItemBody = zod.strictObject({
1004
+ var createProductBody = zod.strictObject({
851
1005
  categoryId: zod.uuid(),
852
1006
  name: zod.string(),
853
1007
  slug: zod.string(),
854
- status: zod.string(),
855
- classification: zod.string(),
856
- variants: zod.array(
857
- zod.strictObject({
858
- id: zod.uuid().nullish(),
859
- code: zod.string(),
860
- itemId: zod.uuid(),
861
- multiplier: zod.number(),
862
- attributes: zod.array(
863
- zod.strictObject({
864
- name: zod.string(),
865
- value: zod.string()
866
- })
867
- ),
868
- weight: zod.strictObject({
869
- value: zod.number(),
870
- unit: zod.string()
871
- }),
872
- price: zod.strictObject({
873
- baseAmount: zod.number(),
874
- baseCurrency: zod.string(),
875
- sale: zod.union([
876
- zod.null(),
877
- zod.strictObject({
878
- amount: zod.number(),
879
- currency: zod.string(),
880
- startAt: zod.iso.datetime({}),
881
- endAt: zod.iso.datetime({})
882
- })
883
- ]).optional(),
884
- wholesale: zod.array(
885
- zod.strictObject({
886
- minQty: zod.number(),
887
- amount: zod.number(),
888
- currency: zod.string()
889
- })
890
- ).nullish()
891
- })
892
- })
893
- )
1008
+ status: zod.enum(["Tes", "Live", "Archived"]).optional(),
1009
+ classification: zod.enum(["Physical", "Digital"])
894
1010
  });
895
- var listCatalogItemsQueryPageDefault = 1;
896
- var listCatalogItemsQueryPageSizeDefault = 10;
897
- var listCatalogItemsQueryParams = zod.strictObject({
898
- page: zod.coerce.number().default(listCatalogItemsQueryPageDefault),
899
- pageSize: zod.coerce.number().default(listCatalogItemsQueryPageSizeDefault)
1011
+ var listProductsQueryPageDefault = 1;
1012
+ var listProductsQueryPageSizeDefault = 10;
1013
+ var listProductsQueryParams = zod.strictObject({
1014
+ page: zod.coerce.number().default(listProductsQueryPageDefault),
1015
+ pageSize: zod.coerce.number().default(listProductsQueryPageSizeDefault)
900
1016
  });
901
- var listCatalogItemsResponse = zod.strictObject({
1017
+ var listProductsResponse = zod.strictObject({
902
1018
  items: zod.array(
903
1019
  zod.strictObject({
904
1020
  id: zod.uuid(),
905
1021
  categoryId: zod.uuid(),
906
1022
  name: zod.string(),
907
1023
  slug: zod.string(),
908
- status: zod.string(),
909
- classification: zod.string(),
1024
+ status: zod.enum(["Tes", "Live", "Archived"]),
1025
+ classification: zod.enum(["Physical", "Digital"]),
910
1026
  variantCount: zod.number()
911
1027
  })
912
1028
  ),
@@ -917,152 +1033,222 @@ var listCatalogItemsResponse = zod.strictObject({
917
1033
  hasNextPage: zod.boolean().optional(),
918
1034
  hasPreviousPage: zod.boolean().optional()
919
1035
  });
920
- var updateCatalogItemParams = zod.strictObject({
1036
+ var getProductParams = zod.strictObject({
921
1037
  id: zod.uuid()
922
1038
  });
923
- var updateCatalogItemBody = zod.strictObject({
1039
+ var getProductResponse = zod.strictObject({
1040
+ id: zod.uuid(),
924
1041
  categoryId: zod.uuid(),
925
1042
  name: zod.string(),
926
1043
  slug: zod.string(),
927
- status: zod.string(),
928
- classification: zod.string(),
929
- variants: zod.array(
930
- zod.strictObject({
931
- id: zod.uuid().nullish(),
932
- code: zod.string(),
933
- itemId: zod.uuid(),
934
- multiplier: zod.number(),
935
- attributes: zod.array(
936
- zod.strictObject({
937
- name: zod.string(),
938
- value: zod.string()
939
- })
940
- ),
941
- weight: zod.strictObject({
942
- value: zod.number(),
943
- unit: zod.string()
944
- }),
945
- price: zod.strictObject({
946
- baseAmount: zod.number(),
947
- baseCurrency: zod.string(),
948
- sale: zod.union([
949
- zod.null(),
950
- zod.strictObject({
951
- amount: zod.number(),
952
- currency: zod.string(),
953
- startAt: zod.iso.datetime({}),
954
- endAt: zod.iso.datetime({})
955
- })
956
- ]).optional(),
957
- wholesale: zod.array(
958
- zod.strictObject({
959
- minQty: zod.number(),
960
- amount: zod.number(),
961
- currency: zod.string()
962
- })
963
- ).nullish()
964
- })
965
- })
966
- )
1044
+ status: zod.enum(["Tes", "Live", "Archived"]),
1045
+ classification: zod.enum(["Physical", "Digital"]),
1046
+ variantCount: zod.number()
1047
+ });
1048
+ var updateProductParams = zod.strictObject({
1049
+ id: zod.uuid()
967
1050
  });
968
- var updateCatalogItemResponse = zod.strictObject({
1051
+ var updateProductBody = zod.strictObject({
1052
+ categoryId: zod.uuid(),
1053
+ name: zod.string(),
1054
+ slug: zod.string(),
1055
+ status: zod.enum(["Tes", "Live", "Archived"]),
1056
+ classification: zod.enum(["Physical", "Digital"])
1057
+ });
1058
+ var updateProductResponse = zod.strictObject({
969
1059
  id: zod.uuid(),
970
1060
  categoryId: zod.uuid(),
971
1061
  name: zod.string(),
972
1062
  slug: zod.string(),
973
- status: zod.string(),
974
- classification: zod.string(),
975
- variants: zod.array(
1063
+ status: zod.enum(["Tes", "Live", "Archived"]),
1064
+ classification: zod.enum(["Physical", "Digital"]),
1065
+ variantCount: zod.number()
1066
+ });
1067
+ var deleteProductParams = zod.strictObject({
1068
+ id: zod.uuid()
1069
+ });
1070
+ var createVariantParams = zod.strictObject({
1071
+ productId: zod.uuid()
1072
+ });
1073
+ var createVariantBody = zod.strictObject({
1074
+ code: zod.string(),
1075
+ attributes: zod.array(
976
1076
  zod.strictObject({
977
- id: zod.uuid().nullish(),
1077
+ name: zod.string(),
1078
+ value: zod.string()
1079
+ })
1080
+ ).optional(),
1081
+ weight: zod.strictObject({
1082
+ value: zod.number(),
1083
+ unit: zod.string()
1084
+ })
1085
+ });
1086
+ var listVariantsParams = zod.strictObject({
1087
+ productId: zod.uuid()
1088
+ });
1089
+ var listVariantsQueryPageDefault = 1;
1090
+ var listVariantsQueryPageSizeDefault = 10;
1091
+ var listVariantsQueryParams = zod.strictObject({
1092
+ page: zod.coerce.number().default(listVariantsQueryPageDefault),
1093
+ pageSize: zod.coerce.number().default(listVariantsQueryPageSizeDefault)
1094
+ });
1095
+ var listVariantsResponse = zod.strictObject({
1096
+ items: zod.array(
1097
+ zod.strictObject({
1098
+ id: zod.uuid(),
1099
+ productId: zod.uuid(),
978
1100
  code: zod.string(),
979
- itemId: zod.uuid(),
980
- multiplier: zod.number(),
981
1101
  attributes: zod.array(
982
1102
  zod.strictObject({
983
1103
  name: zod.string(),
984
1104
  value: zod.string()
985
1105
  })
986
- ),
1106
+ ).optional(),
987
1107
  weight: zod.strictObject({
988
1108
  value: zod.number(),
989
1109
  unit: zod.string()
990
- }),
991
- price: zod.strictObject({
992
- baseAmount: zod.number(),
993
- baseCurrency: zod.string(),
994
- sale: zod.union([
995
- zod.null(),
996
- zod.strictObject({
997
- amount: zod.number(),
998
- currency: zod.string(),
999
- startAt: zod.iso.datetime({}),
1000
- endAt: zod.iso.datetime({})
1001
- })
1002
- ]).optional(),
1003
- wholesale: zod.array(
1004
- zod.strictObject({
1005
- minQty: zod.number(),
1006
- amount: zod.number(),
1007
- currency: zod.string()
1008
- })
1009
- ).nullish()
1010
1110
  })
1011
1111
  })
1012
- )
1112
+ ),
1113
+ page: zod.number(),
1114
+ pageSize: zod.number(),
1115
+ totalCount: zod.number(),
1116
+ totalPages: zod.number().optional(),
1117
+ hasNextPage: zod.boolean().optional(),
1118
+ hasPreviousPage: zod.boolean().optional()
1013
1119
  });
1014
- var getCatalogItemParams = zod.strictObject({
1120
+ var getVariantParams = zod.strictObject({
1121
+ productId: zod.uuid(),
1015
1122
  id: zod.uuid()
1016
1123
  });
1017
- var getCatalogItemResponse = zod.strictObject({
1124
+ var getVariantResponse = zod.strictObject({
1018
1125
  id: zod.uuid(),
1019
- categoryId: zod.uuid(),
1020
- name: zod.string(),
1021
- slug: zod.string(),
1022
- status: zod.string(),
1023
- classification: zod.string(),
1024
- variants: zod.array(
1126
+ productId: zod.uuid(),
1127
+ code: zod.string(),
1128
+ attributes: zod.array(
1025
1129
  zod.strictObject({
1026
- id: zod.uuid().nullish(),
1027
- code: zod.string(),
1028
- itemId: zod.uuid(),
1029
- multiplier: zod.number(),
1030
- attributes: zod.array(
1031
- zod.strictObject({
1032
- name: zod.string(),
1033
- value: zod.string()
1034
- })
1035
- ),
1036
- weight: zod.strictObject({
1037
- value: zod.number(),
1038
- unit: zod.string()
1039
- }),
1040
- price: zod.strictObject({
1041
- baseAmount: zod.number(),
1042
- baseCurrency: zod.string(),
1043
- sale: zod.union([
1044
- zod.null(),
1045
- zod.strictObject({
1046
- amount: zod.number(),
1047
- currency: zod.string(),
1048
- startAt: zod.iso.datetime({}),
1049
- endAt: zod.iso.datetime({})
1050
- })
1051
- ]).optional(),
1052
- wholesale: zod.array(
1053
- zod.strictObject({
1054
- minQty: zod.number(),
1055
- amount: zod.number(),
1056
- currency: zod.string()
1057
- })
1058
- ).nullish()
1059
- })
1130
+ name: zod.string(),
1131
+ value: zod.string()
1060
1132
  })
1061
- )
1133
+ ).optional(),
1134
+ weight: zod.strictObject({
1135
+ value: zod.number(),
1136
+ unit: zod.string()
1137
+ })
1062
1138
  });
1063
- var deleteCatalogItemParams = zod.strictObject({
1139
+ var updateVariantParams = zod.strictObject({
1140
+ productId: zod.uuid(),
1064
1141
  id: zod.uuid()
1065
1142
  });
1143
+ var updateVariantBody = zod.strictObject({
1144
+ code: zod.string(),
1145
+ attributes: zod.array(
1146
+ zod.strictObject({
1147
+ name: zod.string(),
1148
+ value: zod.string()
1149
+ })
1150
+ ).optional(),
1151
+ weight: zod.strictObject({
1152
+ value: zod.number(),
1153
+ unit: zod.string()
1154
+ })
1155
+ });
1156
+ var updateVariantResponse = zod.strictObject({
1157
+ id: zod.uuid(),
1158
+ productId: zod.uuid(),
1159
+ code: zod.string(),
1160
+ attributes: zod.array(
1161
+ zod.strictObject({
1162
+ name: zod.string(),
1163
+ value: zod.string()
1164
+ })
1165
+ ).optional(),
1166
+ weight: zod.strictObject({
1167
+ value: zod.number(),
1168
+ unit: zod.string()
1169
+ })
1170
+ });
1171
+ var deleteVariantParams = zod.strictObject({
1172
+ productId: zod.uuid(),
1173
+ id: zod.uuid()
1174
+ });
1175
+ var getVariantPricingParams = zod.strictObject({
1176
+ variantId: zod.uuid()
1177
+ });
1178
+ var getVariantPricingResponse = zod.strictObject({
1179
+ variantId: zod.uuid(),
1180
+ baseAmount: zod.number(),
1181
+ baseCurrency: zod.string(),
1182
+ effectiveAmount: zod.number(),
1183
+ effectiveCurrency: zod.string(),
1184
+ sale: zod.union([
1185
+ zod.null(),
1186
+ zod.strictObject({
1187
+ amount: zod.number(),
1188
+ currency: zod.string(),
1189
+ startAt: zod.iso.datetime({}),
1190
+ endAt: zod.iso.datetime({}),
1191
+ isActive: zod.boolean()
1192
+ })
1193
+ ]).optional(),
1194
+ wholesale: zod.array(
1195
+ zod.strictObject({
1196
+ minQty: zod.number(),
1197
+ amount: zod.number(),
1198
+ currency: zod.string()
1199
+ })
1200
+ ).optional()
1201
+ });
1202
+ var upsertVariantPricingParams = zod.strictObject({
1203
+ variantId: zod.uuid()
1204
+ });
1205
+ var upsertVariantPricingBody = zod.strictObject({
1206
+ baseAmount: zod.number(),
1207
+ baseCurrency: zod.string(),
1208
+ sale: zod.union([
1209
+ zod.null(),
1210
+ zod.strictObject({
1211
+ amount: zod.number(),
1212
+ currency: zod.string(),
1213
+ startAt: zod.iso.datetime({}),
1214
+ endAt: zod.iso.datetime({})
1215
+ })
1216
+ ]).optional(),
1217
+ wholesale: zod.array(
1218
+ zod.strictObject({
1219
+ minQty: zod.number(),
1220
+ amount: zod.number(),
1221
+ currency: zod.string()
1222
+ })
1223
+ ).optional()
1224
+ });
1225
+ var upsertVariantPricingResponse = zod.strictObject({
1226
+ variantId: zod.uuid(),
1227
+ baseAmount: zod.number(),
1228
+ baseCurrency: zod.string(),
1229
+ effectiveAmount: zod.number(),
1230
+ effectiveCurrency: zod.string(),
1231
+ sale: zod.union([
1232
+ zod.null(),
1233
+ zod.strictObject({
1234
+ amount: zod.number(),
1235
+ currency: zod.string(),
1236
+ startAt: zod.iso.datetime({}),
1237
+ endAt: zod.iso.datetime({}),
1238
+ isActive: zod.boolean()
1239
+ })
1240
+ ]).optional(),
1241
+ wholesale: zod.array(
1242
+ zod.strictObject({
1243
+ minQty: zod.number(),
1244
+ amount: zod.number(),
1245
+ currency: zod.string()
1246
+ })
1247
+ ).optional()
1248
+ });
1249
+ var deleteVariantPricingParams = zod.strictObject({
1250
+ variantId: zod.uuid()
1251
+ });
1066
1252
  var createStockItemsBody = zod.strictObject({
1067
1253
  name: zod.string(),
1068
1254
  sku: zod.string(),
@@ -1115,9 +1301,10 @@ var createBatchBody = zod.strictObject({
1115
1301
  receivedBy: zod.string().nullish()
1116
1302
  });
1117
1303
  var consumeBatchParams = zod.strictObject({
1118
- id: zod.uuid().describe("Batch identifier.")
1304
+ itemId: zod.uuid().describe("Stock item identifier.")
1119
1305
  });
1120
1306
  var consumeBatchBody = zod.strictObject({
1307
+ warehouseId: zod.uuid(),
1121
1308
  quantity: zod.number(),
1122
1309
  sourceType: zod.enum([
1123
1310
  "LOAN_OUT",
@@ -1303,22 +1490,31 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1303
1490
  });
1304
1491
  export {
1305
1492
  ConsumeBatchSourceType,
1493
+ ProductClassification,
1494
+ ProductStatus,
1306
1495
  SourceTypeEnum,
1307
1496
  consumeBatch,
1308
1497
  consumeBatchBody,
1309
1498
  consumeBatchParams,
1310
1499
  createBatch,
1311
1500
  createBatchBody,
1312
- createCatalogItem,
1313
- createCatalogItemBody,
1501
+ createProduct,
1502
+ createProductBody,
1314
1503
  createStockItems,
1315
1504
  createStockItemsBody,
1505
+ createVariant,
1506
+ createVariantBody,
1507
+ createVariantParams,
1316
1508
  createWarehouse,
1317
1509
  createWarehouseBody,
1318
1510
  deleteApiIdentityAdminRolesId,
1319
1511
  deleteApiIdentityAdminRolesIdParams,
1320
- deleteCatalogItem,
1321
- deleteCatalogItemParams,
1512
+ deleteProduct,
1513
+ deleteProductParams,
1514
+ deleteVariant,
1515
+ deleteVariantParams,
1516
+ deleteVariantPricing,
1517
+ deleteVariantPricingParams,
1322
1518
  deleteWarehouse,
1323
1519
  deleteWarehouseParams,
1324
1520
  getApiIdentityAdminPermissions,
@@ -1347,16 +1543,16 @@ export {
1347
1543
  getApiIdentityManage2faResponse,
1348
1544
  getApiIdentityManageInfo,
1349
1545
  getApiIdentityManageInfoResponse,
1350
- getCatalogItem,
1351
- getCatalogItemParams,
1352
- getCatalogItemResponse,
1353
1546
  getConsumeBatchMutationOptions,
1354
1547
  getCreateBatchMutationOptions,
1355
- getCreateCatalogItemMutationOptions,
1548
+ getCreateProductMutationOptions,
1356
1549
  getCreateStockItemsMutationOptions,
1550
+ getCreateVariantMutationOptions,
1357
1551
  getCreateWarehouseMutationOptions,
1358
1552
  getDeleteApiIdentityAdminRolesIdMutationOptions,
1359
- getDeleteCatalogItemMutationOptions,
1553
+ getDeleteProductMutationOptions,
1554
+ getDeleteVariantMutationOptions,
1555
+ getDeleteVariantPricingMutationOptions,
1360
1556
  getDeleteWarehouseMutationOptions,
1361
1557
  getGetApiIdentityAdminPermissionsQueryKey,
1362
1558
  getGetApiIdentityAdminPermissionsQueryOptions,
@@ -1376,21 +1572,27 @@ export {
1376
1572
  getGetApiIdentityManage2faQueryOptions,
1377
1573
  getGetApiIdentityManageInfoQueryKey,
1378
1574
  getGetApiIdentityManageInfoQueryOptions,
1379
- getGetCatalogItemQueryKey,
1380
- getGetCatalogItemQueryOptions,
1381
1575
  getGetHealthQueryKey,
1382
1576
  getGetHealthQueryOptions,
1577
+ getGetProductQueryKey,
1578
+ getGetProductQueryOptions,
1579
+ getGetVariantPricingQueryKey,
1580
+ getGetVariantPricingQueryOptions,
1581
+ getGetVariantQueryKey,
1582
+ getGetVariantQueryOptions,
1383
1583
  getGetWarehouseByIdQueryKey,
1384
1584
  getGetWarehouseByIdQueryOptions,
1385
1585
  getGetWarehouseOptionsQueryKey,
1386
1586
  getGetWarehouseOptionsQueryOptions,
1387
1587
  getHealth,
1388
- getListCatalogItemsQueryKey,
1389
- getListCatalogItemsQueryOptions,
1588
+ getListProductsQueryKey,
1589
+ getListProductsQueryOptions,
1390
1590
  getListStockItemsQueryKey,
1391
1591
  getListStockItemsQueryOptions,
1392
1592
  getListStockMovementsQueryKey,
1393
1593
  getListStockMovementsQueryOptions,
1594
+ getListVariantsQueryKey,
1595
+ getListVariantsQueryOptions,
1394
1596
  getListWarehousesQueryKey,
1395
1597
  getListWarehousesQueryOptions,
1396
1598
  getPostApiIdentityAdminRolesMutationOptions,
@@ -1401,6 +1603,9 @@ export {
1401
1603
  getPostApiIdentityManage2faMutationOptions,
1402
1604
  getPostApiIdentityManageInfoMutationOptions,
1403
1605
  getPostApiIdentityResetPasswordMutationOptions,
1606
+ getProduct,
1607
+ getProductParams,
1608
+ getProductResponse,
1404
1609
  getPutApiIdentityAdminRolesIdMutationOptions,
1405
1610
  getPutApiIdentityAdminRolesIdPermissionsMutationOptions,
1406
1611
  getPutApiIdentityAdminUsersIdActiveMutationOptions,
@@ -1408,19 +1613,27 @@ export {
1408
1613
  getSearchAddressesQueryKey,
1409
1614
  getSearchAddressesQueryOptions,
1410
1615
  getToggleWarehouseStatusMutationOptions,
1411
- getUpdateCatalogItemMutationOptions,
1616
+ getUpdateProductMutationOptions,
1617
+ getUpdateVariantMutationOptions,
1412
1618
  getUpdateWarehouseMutationOptions,
1619
+ getUpsertVariantPricingMutationOptions,
1620
+ getVariant,
1621
+ getVariantParams,
1622
+ getVariantPricing,
1623
+ getVariantPricingParams,
1624
+ getVariantPricingResponse,
1625
+ getVariantResponse,
1413
1626
  getWarehouseById,
1414
1627
  getWarehouseByIdParams,
1415
1628
  getWarehouseByIdResponse,
1416
1629
  getWarehouseOptions,
1417
1630
  getWarehouseOptionsResponse,
1418
1631
  getWarehouseOptionsResponseItem,
1419
- listCatalogItems,
1420
- listCatalogItemsQueryPageDefault,
1421
- listCatalogItemsQueryPageSizeDefault,
1422
- listCatalogItemsQueryParams,
1423
- listCatalogItemsResponse,
1632
+ listProducts,
1633
+ listProductsQueryPageDefault,
1634
+ listProductsQueryPageSizeDefault,
1635
+ listProductsQueryParams,
1636
+ listProductsResponse,
1424
1637
  listStockItems,
1425
1638
  listStockItemsQueryDescendingDefault,
1426
1639
  listStockItemsQueryPageDefault,
@@ -1433,6 +1646,12 @@ export {
1433
1646
  listStockMovementsQueryPageSizeDefault,
1434
1647
  listStockMovementsQueryParams,
1435
1648
  listStockMovementsResponse,
1649
+ listVariants,
1650
+ listVariantsParams,
1651
+ listVariantsQueryPageDefault,
1652
+ listVariantsQueryPageSizeDefault,
1653
+ listVariantsQueryParams,
1654
+ listVariantsResponse,
1436
1655
  listWarehouses,
1437
1656
  listWarehousesQueryPageDefault,
1438
1657
  listWarehousesQueryPageSizeDefault,
@@ -1475,20 +1694,31 @@ export {
1475
1694
  searchAddressesResponseItem,
1476
1695
  toggleWarehouseStatus,
1477
1696
  toggleWarehouseStatusParams,
1478
- updateCatalogItem,
1479
- updateCatalogItemBody,
1480
- updateCatalogItemParams,
1481
- updateCatalogItemResponse,
1697
+ updateProduct,
1698
+ updateProductBody,
1699
+ updateProductParams,
1700
+ updateProductResponse,
1701
+ updateVariant,
1702
+ updateVariantBody,
1703
+ updateVariantParams,
1704
+ updateVariantResponse,
1482
1705
  updateWarehouse,
1483
1706
  updateWarehouseBody,
1484
1707
  updateWarehouseParams,
1708
+ upsertVariantPricing,
1709
+ upsertVariantPricingBody,
1710
+ upsertVariantPricingParams,
1711
+ upsertVariantPricingResponse,
1485
1712
  useConsumeBatch,
1486
1713
  useCreateBatch,
1487
- useCreateCatalogItem,
1714
+ useCreateProduct,
1488
1715
  useCreateStockItems,
1716
+ useCreateVariant,
1489
1717
  useCreateWarehouse,
1490
1718
  useDeleteApiIdentityAdminRolesId,
1491
- useDeleteCatalogItem,
1719
+ useDeleteProduct,
1720
+ useDeleteVariant,
1721
+ useDeleteVariantPricing,
1492
1722
  useDeleteWarehouse,
1493
1723
  useGetApiIdentityAdminPermissions,
1494
1724
  useGetApiIdentityAdminRoles,
@@ -1499,13 +1729,16 @@ export {
1499
1729
  useGetApiIdentityAntiforgery,
1500
1730
  useGetApiIdentityManage2fa,
1501
1731
  useGetApiIdentityManageInfo,
1502
- useGetCatalogItem,
1503
1732
  useGetHealth,
1733
+ useGetProduct,
1734
+ useGetVariant,
1735
+ useGetVariantPricing,
1504
1736
  useGetWarehouseById,
1505
1737
  useGetWarehouseOptions,
1506
- useListCatalogItems,
1738
+ useListProducts,
1507
1739
  useListStockItems,
1508
1740
  useListStockMovements,
1741
+ useListVariants,
1509
1742
  useListWarehouses,
1510
1743
  usePostApiIdentityAdminRoles,
1511
1744
  usePostApiIdentityAdminUsersIdLogout,
@@ -1521,7 +1754,9 @@ export {
1521
1754
  usePutApiIdentityAdminUsersIdRoles,
1522
1755
  useSearchAddresses,
1523
1756
  useToggleWarehouseStatus,
1524
- useUpdateCatalogItem,
1525
- useUpdateWarehouse
1757
+ useUpdateProduct,
1758
+ useUpdateVariant,
1759
+ useUpdateWarehouse,
1760
+ useUpsertVariantPricing
1526
1761
  };
1527
1762
  //# sourceMappingURL=index.mjs.map