@ecomiq/core 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/client.cjs +40 -38
  2. package/dist/client.cjs.map +1 -1
  3. package/dist/client.d.cts +1 -0
  4. package/dist/client.d.ts +1 -0
  5. package/dist/client.js +40 -38
  6. package/dist/client.js.map +1 -1
  7. package/dist/index.cjs +41 -38
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.cts +2 -1
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +41 -39
  12. package/dist/index.js.map +1 -1
  13. package/dist/models/geo.cjs +10 -2
  14. package/dist/models/geo.cjs.map +1 -1
  15. package/dist/models/geo.d.cts +14 -14
  16. package/dist/models/geo.d.ts +14 -14
  17. package/dist/models/geo.js +10 -2
  18. package/dist/models/geo.js.map +1 -1
  19. package/dist/models/ids.cjs +17 -0
  20. package/dist/models/ids.cjs.map +1 -0
  21. package/dist/models/ids.d.cts +12 -0
  22. package/dist/models/ids.d.ts +12 -0
  23. package/dist/models/ids.js +13 -0
  24. package/dist/models/ids.js.map +1 -0
  25. package/dist/models/products.cjs +12 -4
  26. package/dist/models/products.cjs.map +1 -1
  27. package/dist/models/products.d.cts +4 -4
  28. package/dist/models/products.d.ts +4 -4
  29. package/dist/models/products.js +12 -4
  30. package/dist/models/products.js.map +1 -1
  31. package/dist/models/search.cjs +11 -5
  32. package/dist/models/search.cjs.map +1 -1
  33. package/dist/models/search.d.cts +1 -1
  34. package/dist/models/search.d.ts +1 -1
  35. package/dist/models/search.js +11 -5
  36. package/dist/models/search.js.map +1 -1
  37. package/dist/models/settings.cjs +12 -9
  38. package/dist/models/settings.cjs.map +1 -1
  39. package/dist/models/settings.d.cts +23 -25
  40. package/dist/models/settings.d.ts +23 -25
  41. package/dist/models/settings.js +12 -10
  42. package/dist/models/settings.js.map +1 -1
  43. package/dist/models/storefront-cart.cjs +23 -15
  44. package/dist/models/storefront-cart.cjs.map +1 -1
  45. package/dist/models/storefront-cart.d.cts +23 -23
  46. package/dist/models/storefront-cart.d.ts +23 -23
  47. package/dist/models/storefront-cart.js +23 -15
  48. package/dist/models/storefront-cart.js.map +1 -1
  49. package/dist/models/storefront-checkout.cjs +28 -22
  50. package/dist/models/storefront-checkout.cjs.map +1 -1
  51. package/dist/models/storefront-checkout.d.cts +43 -43
  52. package/dist/models/storefront-checkout.d.ts +43 -43
  53. package/dist/models/storefront-checkout.js +28 -22
  54. package/dist/models/storefront-checkout.js.map +1 -1
  55. package/dist/models/storefront-reviews.cjs +12 -4
  56. package/dist/models/storefront-reviews.cjs.map +1 -1
  57. package/dist/models/storefront-reviews.js +12 -4
  58. package/dist/models/storefront-reviews.js.map +1 -1
  59. package/package.json +6 -1
package/dist/index.cjs CHANGED
@@ -120,6 +120,14 @@ var CollectionSchema = zod.z.object({
120
120
  productCount: zod.z.number().optional()
121
121
  });
122
122
  var CollectionsSchema = zod.z.array(CollectionSchema);
123
+ var EntityIdSchema = zod.z.union([
124
+ zod.z.string().uuid(),
125
+ zod.z.string().regex(/^\d+$/, "Expected numeric id")
126
+ ]);
127
+ var NullableEntityIdSchema = EntityIdSchema.nullable();
128
+ var OptionalEntityIdSchema = EntityIdSchema.optional();
129
+
130
+ // src/models/products.ts
123
131
  var ProductPublicIdSchema = zod.z.union([
124
132
  zod.z.string().regex(/^[1-9]\d*$/),
125
133
  zod.z.number().int().safe().positive()
@@ -180,7 +188,7 @@ var ProductsParamsSchema = zod.z.object({
180
188
  page: zod.z.number().int().positive().default(1),
181
189
  pageSize: zod.z.number().int().positive().max(100).default(24),
182
190
  sort: ProductSortSchema.optional(),
183
- sellerId: zod.z.string().uuid().optional(),
191
+ sellerId: OptionalEntityIdSchema,
184
192
  search: zod.z.string().optional(),
185
193
  collection: zod.z.string().optional(),
186
194
  collections: zod.z.array(zod.z.string()).optional(),
@@ -194,18 +202,18 @@ var ProductsParamsSchema = zod.z.object({
194
202
  tag: zod.z.string().optional(),
195
203
  tags: zod.z.array(zod.z.string()).optional(),
196
204
  filters: zod.z.array(zod.z.string()).optional(),
197
- locationId: zod.z.string().uuid().optional(),
205
+ locationId: OptionalEntityIdSchema,
198
206
  inStock: zod.z.boolean().optional(),
199
207
  minPrice: zod.z.number().nonnegative().optional(),
200
208
  maxPrice: zod.z.number().nonnegative().optional()
201
209
  });
202
210
  var ProductDetailParamsSchema = zod.z.object({
203
- sellerId: zod.z.string().uuid().optional()
211
+ sellerId: OptionalEntityIdSchema
204
212
  });
205
213
  var RelatedProductsParamsSchema = zod.z.object({
206
214
  productId: ProductPublicIdSchema,
207
215
  limit: zod.z.number().int().positive().max(12).default(8),
208
- sellerId: zod.z.string().uuid().optional()
216
+ sellerId: OptionalEntityIdSchema
209
217
  });
210
218
  var SpecItemSchema = zod.z.object({
211
219
  key: zod.z.string(),
@@ -312,12 +320,6 @@ var JsonElementSchema = zod.z.lazy(
312
320
  );
313
321
  var DateTimeOffsetSchema = zod.z.string().datetime({ offset: true });
314
322
  var NullableDateTimeOffsetSchema = DateTimeOffsetSchema.nullable();
315
- var NullableUuidSchema = zod.z.string().uuid().nullable();
316
- var EntityIdSchema = zod.z.union([
317
- zod.z.string().uuid(),
318
- zod.z.string().regex(/^\d+$/, "Expected numeric id")
319
- ]);
320
- var NullableEntityIdSchema = EntityIdSchema.nullable();
321
323
  var StoreTypeSchema = zod.z.enum([
322
324
  "b2C",
323
325
  "marketplace",
@@ -489,11 +491,11 @@ var CmsPageDetailsDtoSchema = zod.z.object({
489
491
  status: CmsPageStatusSchema,
490
492
  hasPublishedVersion: zod.z.boolean(),
491
493
  publishedOn: NullableDateTimeOffsetSchema,
492
- publishedBy: NullableUuidSchema,
494
+ publishedBy: NullableEntityIdSchema,
493
495
  createdOn: DateTimeOffsetSchema,
494
496
  updatedOn: NullableDateTimeOffsetSchema,
495
- createdBy: NullableUuidSchema,
496
- updatedBy: NullableUuidSchema,
497
+ createdBy: NullableEntityIdSchema,
498
+ updatedBy: NullableEntityIdSchema,
497
499
  lastModifiedBy: zod.z.string().nullable()
498
500
  }).strict();
499
501
  var CmsSnapshotDtoSchema = zod.z.object({
@@ -604,7 +606,7 @@ async function getRelatedProducts(api, params) {
604
606
  var ProductAutocompleteParamsSchema = zod.z.object({
605
607
  search: zod.z.string().min(2).max(80),
606
608
  limit: zod.z.number().int().positive().max(20).default(8),
607
- sellerId: zod.z.string().uuid().optional()
609
+ sellerId: OptionalEntityIdSchema
608
610
  });
609
611
  var ProductSuggestionSchema = zod.z.object({
610
612
  id: ProductPublicIdSchema,
@@ -728,7 +730,7 @@ var StorefrontCartBundleItemSchema = zod.z.object({
728
730
  quantity: zod.z.number().int().positive()
729
731
  });
730
732
  var StorefrontCartItemSchema = zod.z.object({
731
- id: zod.z.string().uuid(),
733
+ id: EntityIdSchema,
732
734
  productId: zod.z.number().int().safe().nonnegative(),
733
735
  title: zod.z.string(),
734
736
  variantLabel: zod.z.string().nullable(),
@@ -742,20 +744,20 @@ var StorefrontCartItemSchema = zod.z.object({
742
744
  bundleItems: zod.z.array(StorefrontCartBundleItemSchema)
743
745
  });
744
746
  var StorefrontCartShippingMethodSchema = zod.z.object({
745
- id: zod.z.string().uuid(),
746
- shippingMethodId: zod.z.string().uuid().nullable(),
747
- rateId: zod.z.string().uuid().nullable(),
747
+ id: EntityIdSchema,
748
+ shippingMethodId: NullableEntityIdSchema,
749
+ rateId: NullableEntityIdSchema,
748
750
  name: zod.z.string(),
749
751
  description: zod.z.string().nullable(),
750
752
  total: zod.z.number(),
751
- locationId: zod.z.string().uuid().nullable(),
753
+ locationId: NullableEntityIdSchema,
752
754
  estimatedDays: zod.z.number().int().nullable(),
753
- pickupPointId: zod.z.string().uuid().nullable(),
755
+ pickupPointId: NullableEntityIdSchema,
754
756
  scheduledDate: zod.z.string().nullable(),
755
757
  scheduledTime: zod.z.string().nullable(),
756
758
  serviceCode: zod.z.string().nullable(),
757
- sellerId: zod.z.string().uuid().nullable(),
758
- shippingProfileId: zod.z.string().uuid().nullable()
759
+ sellerId: NullableEntityIdSchema,
760
+ shippingProfileId: NullableEntityIdSchema
759
761
  });
760
762
  var StorefrontCartTotalsSchema = zod.z.object({
761
763
  subtotal: zod.z.number(),
@@ -776,7 +778,7 @@ var StorefrontCartStatusSchema = zod.z.enum([
776
778
  "failed"
777
779
  ]);
778
780
  var StorefrontCartSchema = zod.z.object({
779
- id: zod.z.string().uuid(),
781
+ id: EntityIdSchema,
780
782
  cartNumber: zod.z.string(),
781
783
  email: zod.z.string().nullable(),
782
784
  phone: zod.z.string().nullable(),
@@ -798,26 +800,26 @@ var CreateCartParamsSchema = zod.z.object({
798
800
  email: zod.z.string().email().optional()
799
801
  });
800
802
  var GetCartParamsSchema = zod.z.object({
801
- cartId: zod.z.string().uuid()
803
+ cartId: EntityIdSchema
802
804
  });
803
805
  var CartItemModifierSchema = zod.z.object({
804
806
  modifierGroupId: zod.z.number().int().safe().positive(),
805
807
  optionIds: zod.z.array(zod.z.number().int().safe().positive()).min(1)
806
808
  });
807
809
  var AddCartItemParamsSchema = zod.z.object({
808
- cartId: zod.z.string().uuid(),
810
+ cartId: EntityIdSchema,
809
811
  variantId: zod.z.number().int().safe().positive(),
810
812
  quantity: zod.z.number().int().positive(),
811
813
  modifiers: zod.z.array(CartItemModifierSchema).optional()
812
814
  });
813
815
  var UpdateCartItemQuantityParamsSchema = zod.z.object({
814
- cartId: zod.z.string().uuid(),
815
- cartItemId: zod.z.string().uuid(),
816
+ cartId: EntityIdSchema,
817
+ cartItemId: EntityIdSchema,
816
818
  quantity: zod.z.number().int().nonnegative()
817
819
  });
818
820
  var RemoveCartItemParamsSchema = zod.z.object({
819
- cartId: zod.z.string().uuid(),
820
- cartItemId: zod.z.string().uuid()
821
+ cartId: EntityIdSchema,
822
+ cartItemId: EntityIdSchema
821
823
  });
822
824
 
823
825
  // src/services/cart.service.ts
@@ -883,7 +885,7 @@ async function getPageBySlug(api, pageSlug) {
883
885
  return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
884
886
  }
885
887
  var CartBuyerParamsSchema = zod.z.object({
886
- cartId: zod.z.string().uuid(),
888
+ cartId: EntityIdSchema,
887
889
  email: zod.z.string().email(),
888
890
  firstName: zod.z.string().min(1),
889
891
  lastName: zod.z.string().min(1),
@@ -909,7 +911,7 @@ var CartAddressWriteSchema = zod.z.object({
909
911
  }).nullable().optional()
910
912
  });
911
913
  var CartAddressesParamsSchema = zod.z.object({
912
- cartId: zod.z.string().uuid(),
914
+ cartId: EntityIdSchema,
913
915
  shippingAddress: CartAddressWriteSchema,
914
916
  billingAddress: CartAddressWriteSchema
915
917
  });
@@ -942,7 +944,7 @@ var StorefrontOrderBumpSchema = zod.z.object({
942
944
  description: zod.z.string().nullable().optional()
943
945
  });
944
946
  var CartCheckoutReadParamsSchema = zod.z.object({
945
- cartId: zod.z.string().uuid()
947
+ cartId: EntityIdSchema
946
948
  });
947
949
  var CartCheckoutReadResponseSchema = zod.z.object({
948
950
  cart: StorefrontCartSchema,
@@ -989,7 +991,7 @@ var CartCheckoutResponseSchema = zod.z.object({
989
991
  cart: StorefrontCartSchema.optional()
990
992
  }).passthrough();
991
993
  var CartCheckoutParamsSchema = zod.z.object({
992
- cartId: zod.z.string().uuid(),
994
+ cartId: EntityIdSchema,
993
995
  paymentMethodCode: zod.z.string().min(1),
994
996
  externalRef: zod.z.string().min(1),
995
997
  receiptUrl: zod.z.string().min(1).optional()
@@ -1022,11 +1024,11 @@ var ShippingOptionsResponseSchema = zod.z.object({
1022
1024
  groups: zod.z.array(ShippingOptionGroupSchema)
1023
1025
  });
1024
1026
  var GetShippingOptionsParamsSchema = zod.z.object({
1025
- cartId: zod.z.string().uuid(),
1027
+ cartId: EntityIdSchema,
1026
1028
  postalCode: zod.z.string().min(1)
1027
1029
  });
1028
1030
  var PutShippingMethodParamsSchema = zod.z.object({
1029
- cartId: zod.z.string().uuid(),
1031
+ cartId: EntityIdSchema,
1030
1032
  rateId: zod.z.string().min(1),
1031
1033
  shippingMethodId: zod.z.string().min(1),
1032
1034
  serviceCode: zod.z.string().nullable().optional(),
@@ -1042,7 +1044,7 @@ var CartPaymentReceiptResponseSchema = zod.z.object({
1042
1044
  url: zod.z.string()
1043
1045
  });
1044
1046
  var CartPromotionCodeParamsSchema = zod.z.object({
1045
- cartId: zod.z.string().uuid(),
1047
+ cartId: EntityIdSchema,
1046
1048
  code: zod.z.string().min(1)
1047
1049
  });
1048
1050
 
@@ -1138,12 +1140,12 @@ var CountrySchema = zod.z.object({
1138
1140
  var CountriesSchema = zod.z.array(CountrySchema);
1139
1141
  var GeoDivisionTypeSchema = zod.z.enum(["level1", "level2", "level3"]);
1140
1142
  var GeoDivisionSchema = zod.z.object({
1141
- id: zod.z.string().uuid(),
1143
+ id: EntityIdSchema,
1142
1144
  countryCode: zod.z.string().length(2),
1143
1145
  type: GeoDivisionTypeSchema,
1144
1146
  code: zod.z.string().min(1),
1145
1147
  name: zod.z.string().min(1),
1146
- parentId: zod.z.string().uuid().nullable(),
1148
+ parentId: NullableEntityIdSchema,
1147
1149
  source: zod.z.string().min(1)
1148
1150
  }).strict();
1149
1151
  var DepartmentSchema = GeoDivisionSchema;
@@ -1970,6 +1972,7 @@ exports.GetShippingOptionsParamsSchema = GetShippingOptionsParamsSchema;
1970
1972
  exports.JsonElementSchema = JsonElementSchema;
1971
1973
  exports.ListProductReviewsParamsSchema = ListProductReviewsParamsSchema;
1972
1974
  exports.NullableEntityIdSchema = NullableEntityIdSchema;
1975
+ exports.OptionalEntityIdSchema = OptionalEntityIdSchema;
1973
1976
  exports.PriceTierSchema = PriceTierSchema;
1974
1977
  exports.ProductAutocompleteParamsSchema = ProductAutocompleteParamsSchema;
1975
1978
  exports.ProductDetailParamsSchema = ProductDetailParamsSchema;