@arascreative/erp-api-client 1.2.0 → 2.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);
223
250
  };
224
251
  return { mutationFn, ...mutationOptions };
225
252
  };
226
- var useUpdateCatalogItem = (options, queryClient) => {
227
- const mutationOptions = getUpdateCatalogItemMutationOptions(options);
253
+ var useUpdateProduct = (options, queryClient) => {
254
+ const mutationOptions = getUpdateProductMutationOptions(options);
228
255
  return useMutation(mutationOptions, queryClient);
229
256
  };
230
- var getCatalogItem = (id, options) => {
231
- return axios.get(`/api/catalog/${id}`, options);
257
+ var deleteProduct = (id, options) => {
258
+ return axios.delete(`/api/catalog/products/${id}`, options);
232
259
  };
233
- var getGetCatalogItemQueryKey = (id) => {
234
- return [`/api/catalog/${id}`];
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 };
235
268
  };
236
- var getGetCatalogItemQueryOptions = (id, options) => {
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);
282
+ };
283
+ return { mutationFn, ...mutationOptions };
284
+ };
285
+ var useCreateVariant = (options, queryClient) => {
286
+ const mutationOptions = getCreateVariantMutationOptions(options);
287
+ return useMutation(mutationOptions, queryClient);
288
+ };
289
+ var listVariants = (productId, params, options) => {
290
+ return axios.get(`/api/catalog/products/${productId}/variants`, {
291
+ ...options,
292
+ params: { ...params, ...options?.params }
293
+ });
294
+ };
295
+ var getListVariantsQueryKey = (productId, params) => {
296
+ return [`/api/catalog/products/${productId}/variants`, ...params ? [params] : []];
297
+ };
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);
341
+ };
342
+ return { mutationFn, ...mutationOptions };
343
+ };
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);
257
395
  };
258
396
  return { mutationFn, ...mutationOptions };
259
397
  };
260
- var useDeleteCatalogItem = (options, queryClient) => {
261
- const mutationOptions = getDeleteCatalogItemMutationOptions(options);
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) => {
@@ -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(),
@@ -1303,22 +1489,31 @@ var postApiIdentityAdminUsersIdLogoutParams = zod.strictObject({
1303
1489
  });
1304
1490
  export {
1305
1491
  ConsumeBatchSourceType,
1492
+ ProductClassification,
1493
+ ProductStatus,
1306
1494
  SourceTypeEnum,
1307
1495
  consumeBatch,
1308
1496
  consumeBatchBody,
1309
1497
  consumeBatchParams,
1310
1498
  createBatch,
1311
1499
  createBatchBody,
1312
- createCatalogItem,
1313
- createCatalogItemBody,
1500
+ createProduct,
1501
+ createProductBody,
1314
1502
  createStockItems,
1315
1503
  createStockItemsBody,
1504
+ createVariant,
1505
+ createVariantBody,
1506
+ createVariantParams,
1316
1507
  createWarehouse,
1317
1508
  createWarehouseBody,
1318
1509
  deleteApiIdentityAdminRolesId,
1319
1510
  deleteApiIdentityAdminRolesIdParams,
1320
- deleteCatalogItem,
1321
- deleteCatalogItemParams,
1511
+ deleteProduct,
1512
+ deleteProductParams,
1513
+ deleteVariant,
1514
+ deleteVariantParams,
1515
+ deleteVariantPricing,
1516
+ deleteVariantPricingParams,
1322
1517
  deleteWarehouse,
1323
1518
  deleteWarehouseParams,
1324
1519
  getApiIdentityAdminPermissions,
@@ -1347,16 +1542,16 @@ export {
1347
1542
  getApiIdentityManage2faResponse,
1348
1543
  getApiIdentityManageInfo,
1349
1544
  getApiIdentityManageInfoResponse,
1350
- getCatalogItem,
1351
- getCatalogItemParams,
1352
- getCatalogItemResponse,
1353
1545
  getConsumeBatchMutationOptions,
1354
1546
  getCreateBatchMutationOptions,
1355
- getCreateCatalogItemMutationOptions,
1547
+ getCreateProductMutationOptions,
1356
1548
  getCreateStockItemsMutationOptions,
1549
+ getCreateVariantMutationOptions,
1357
1550
  getCreateWarehouseMutationOptions,
1358
1551
  getDeleteApiIdentityAdminRolesIdMutationOptions,
1359
- getDeleteCatalogItemMutationOptions,
1552
+ getDeleteProductMutationOptions,
1553
+ getDeleteVariantMutationOptions,
1554
+ getDeleteVariantPricingMutationOptions,
1360
1555
  getDeleteWarehouseMutationOptions,
1361
1556
  getGetApiIdentityAdminPermissionsQueryKey,
1362
1557
  getGetApiIdentityAdminPermissionsQueryOptions,
@@ -1376,21 +1571,27 @@ export {
1376
1571
  getGetApiIdentityManage2faQueryOptions,
1377
1572
  getGetApiIdentityManageInfoQueryKey,
1378
1573
  getGetApiIdentityManageInfoQueryOptions,
1379
- getGetCatalogItemQueryKey,
1380
- getGetCatalogItemQueryOptions,
1381
1574
  getGetHealthQueryKey,
1382
1575
  getGetHealthQueryOptions,
1576
+ getGetProductQueryKey,
1577
+ getGetProductQueryOptions,
1578
+ getGetVariantPricingQueryKey,
1579
+ getGetVariantPricingQueryOptions,
1580
+ getGetVariantQueryKey,
1581
+ getGetVariantQueryOptions,
1383
1582
  getGetWarehouseByIdQueryKey,
1384
1583
  getGetWarehouseByIdQueryOptions,
1385
1584
  getGetWarehouseOptionsQueryKey,
1386
1585
  getGetWarehouseOptionsQueryOptions,
1387
1586
  getHealth,
1388
- getListCatalogItemsQueryKey,
1389
- getListCatalogItemsQueryOptions,
1587
+ getListProductsQueryKey,
1588
+ getListProductsQueryOptions,
1390
1589
  getListStockItemsQueryKey,
1391
1590
  getListStockItemsQueryOptions,
1392
1591
  getListStockMovementsQueryKey,
1393
1592
  getListStockMovementsQueryOptions,
1593
+ getListVariantsQueryKey,
1594
+ getListVariantsQueryOptions,
1394
1595
  getListWarehousesQueryKey,
1395
1596
  getListWarehousesQueryOptions,
1396
1597
  getPostApiIdentityAdminRolesMutationOptions,
@@ -1401,6 +1602,9 @@ export {
1401
1602
  getPostApiIdentityManage2faMutationOptions,
1402
1603
  getPostApiIdentityManageInfoMutationOptions,
1403
1604
  getPostApiIdentityResetPasswordMutationOptions,
1605
+ getProduct,
1606
+ getProductParams,
1607
+ getProductResponse,
1404
1608
  getPutApiIdentityAdminRolesIdMutationOptions,
1405
1609
  getPutApiIdentityAdminRolesIdPermissionsMutationOptions,
1406
1610
  getPutApiIdentityAdminUsersIdActiveMutationOptions,
@@ -1408,19 +1612,27 @@ export {
1408
1612
  getSearchAddressesQueryKey,
1409
1613
  getSearchAddressesQueryOptions,
1410
1614
  getToggleWarehouseStatusMutationOptions,
1411
- getUpdateCatalogItemMutationOptions,
1615
+ getUpdateProductMutationOptions,
1616
+ getUpdateVariantMutationOptions,
1412
1617
  getUpdateWarehouseMutationOptions,
1618
+ getUpsertVariantPricingMutationOptions,
1619
+ getVariant,
1620
+ getVariantParams,
1621
+ getVariantPricing,
1622
+ getVariantPricingParams,
1623
+ getVariantPricingResponse,
1624
+ getVariantResponse,
1413
1625
  getWarehouseById,
1414
1626
  getWarehouseByIdParams,
1415
1627
  getWarehouseByIdResponse,
1416
1628
  getWarehouseOptions,
1417
1629
  getWarehouseOptionsResponse,
1418
1630
  getWarehouseOptionsResponseItem,
1419
- listCatalogItems,
1420
- listCatalogItemsQueryPageDefault,
1421
- listCatalogItemsQueryPageSizeDefault,
1422
- listCatalogItemsQueryParams,
1423
- listCatalogItemsResponse,
1631
+ listProducts,
1632
+ listProductsQueryPageDefault,
1633
+ listProductsQueryPageSizeDefault,
1634
+ listProductsQueryParams,
1635
+ listProductsResponse,
1424
1636
  listStockItems,
1425
1637
  listStockItemsQueryDescendingDefault,
1426
1638
  listStockItemsQueryPageDefault,
@@ -1433,6 +1645,12 @@ export {
1433
1645
  listStockMovementsQueryPageSizeDefault,
1434
1646
  listStockMovementsQueryParams,
1435
1647
  listStockMovementsResponse,
1648
+ listVariants,
1649
+ listVariantsParams,
1650
+ listVariantsQueryPageDefault,
1651
+ listVariantsQueryPageSizeDefault,
1652
+ listVariantsQueryParams,
1653
+ listVariantsResponse,
1436
1654
  listWarehouses,
1437
1655
  listWarehousesQueryPageDefault,
1438
1656
  listWarehousesQueryPageSizeDefault,
@@ -1475,20 +1693,31 @@ export {
1475
1693
  searchAddressesResponseItem,
1476
1694
  toggleWarehouseStatus,
1477
1695
  toggleWarehouseStatusParams,
1478
- updateCatalogItem,
1479
- updateCatalogItemBody,
1480
- updateCatalogItemParams,
1481
- updateCatalogItemResponse,
1696
+ updateProduct,
1697
+ updateProductBody,
1698
+ updateProductParams,
1699
+ updateProductResponse,
1700
+ updateVariant,
1701
+ updateVariantBody,
1702
+ updateVariantParams,
1703
+ updateVariantResponse,
1482
1704
  updateWarehouse,
1483
1705
  updateWarehouseBody,
1484
1706
  updateWarehouseParams,
1707
+ upsertVariantPricing,
1708
+ upsertVariantPricingBody,
1709
+ upsertVariantPricingParams,
1710
+ upsertVariantPricingResponse,
1485
1711
  useConsumeBatch,
1486
1712
  useCreateBatch,
1487
- useCreateCatalogItem,
1713
+ useCreateProduct,
1488
1714
  useCreateStockItems,
1715
+ useCreateVariant,
1489
1716
  useCreateWarehouse,
1490
1717
  useDeleteApiIdentityAdminRolesId,
1491
- useDeleteCatalogItem,
1718
+ useDeleteProduct,
1719
+ useDeleteVariant,
1720
+ useDeleteVariantPricing,
1492
1721
  useDeleteWarehouse,
1493
1722
  useGetApiIdentityAdminPermissions,
1494
1723
  useGetApiIdentityAdminRoles,
@@ -1499,13 +1728,16 @@ export {
1499
1728
  useGetApiIdentityAntiforgery,
1500
1729
  useGetApiIdentityManage2fa,
1501
1730
  useGetApiIdentityManageInfo,
1502
- useGetCatalogItem,
1503
1731
  useGetHealth,
1732
+ useGetProduct,
1733
+ useGetVariant,
1734
+ useGetVariantPricing,
1504
1735
  useGetWarehouseById,
1505
1736
  useGetWarehouseOptions,
1506
- useListCatalogItems,
1737
+ useListProducts,
1507
1738
  useListStockItems,
1508
1739
  useListStockMovements,
1740
+ useListVariants,
1509
1741
  useListWarehouses,
1510
1742
  usePostApiIdentityAdminRoles,
1511
1743
  usePostApiIdentityAdminUsersIdLogout,
@@ -1521,7 +1753,9 @@ export {
1521
1753
  usePutApiIdentityAdminUsersIdRoles,
1522
1754
  useSearchAddresses,
1523
1755
  useToggleWarehouseStatus,
1524
- useUpdateCatalogItem,
1525
- useUpdateWarehouse
1756
+ useUpdateProduct,
1757
+ useUpdateVariant,
1758
+ useUpdateWarehouse,
1759
+ useUpsertVariantPricing
1526
1760
  };
1527
1761
  //# sourceMappingURL=index.mjs.map