@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/client.cjs CHANGED
@@ -115,6 +115,14 @@ var CollectionSchema = zod.z.object({
115
115
  productCount: zod.z.number().optional()
116
116
  });
117
117
  var CollectionsSchema = zod.z.array(CollectionSchema);
118
+ var EntityIdSchema = zod.z.union([
119
+ zod.z.string().uuid(),
120
+ zod.z.string().regex(/^\d+$/, "Expected numeric id")
121
+ ]);
122
+ var NullableEntityIdSchema = EntityIdSchema.nullable();
123
+ var OptionalEntityIdSchema = EntityIdSchema.optional();
124
+
125
+ // src/models/products.ts
118
126
  var ProductPublicIdSchema = zod.z.union([
119
127
  zod.z.string().regex(/^[1-9]\d*$/),
120
128
  zod.z.number().int().safe().positive()
@@ -173,7 +181,7 @@ var ProductsParamsSchema = zod.z.object({
173
181
  page: zod.z.number().int().positive().default(1),
174
182
  pageSize: zod.z.number().int().positive().max(100).default(24),
175
183
  sort: ProductSortSchema.optional(),
176
- sellerId: zod.z.string().uuid().optional(),
184
+ sellerId: OptionalEntityIdSchema,
177
185
  search: zod.z.string().optional(),
178
186
  collection: zod.z.string().optional(),
179
187
  collections: zod.z.array(zod.z.string()).optional(),
@@ -187,18 +195,18 @@ var ProductsParamsSchema = zod.z.object({
187
195
  tag: zod.z.string().optional(),
188
196
  tags: zod.z.array(zod.z.string()).optional(),
189
197
  filters: zod.z.array(zod.z.string()).optional(),
190
- locationId: zod.z.string().uuid().optional(),
198
+ locationId: OptionalEntityIdSchema,
191
199
  inStock: zod.z.boolean().optional(),
192
200
  minPrice: zod.z.number().nonnegative().optional(),
193
201
  maxPrice: zod.z.number().nonnegative().optional()
194
202
  });
195
203
  var ProductDetailParamsSchema = zod.z.object({
196
- sellerId: zod.z.string().uuid().optional()
204
+ sellerId: OptionalEntityIdSchema
197
205
  });
198
206
  var RelatedProductsParamsSchema = zod.z.object({
199
207
  productId: ProductPublicIdSchema,
200
208
  limit: zod.z.number().int().positive().max(12).default(8),
201
- sellerId: zod.z.string().uuid().optional()
209
+ sellerId: OptionalEntityIdSchema
202
210
  });
203
211
  var SpecItemSchema = zod.z.object({
204
212
  key: zod.z.string(),
@@ -302,12 +310,6 @@ var JsonElementSchema = zod.z.lazy(
302
310
  );
303
311
  var DateTimeOffsetSchema = zod.z.string().datetime({ offset: true });
304
312
  var NullableDateTimeOffsetSchema = DateTimeOffsetSchema.nullable();
305
- var NullableUuidSchema = zod.z.string().uuid().nullable();
306
- var EntityIdSchema = zod.z.union([
307
- zod.z.string().uuid(),
308
- zod.z.string().regex(/^\d+$/, "Expected numeric id")
309
- ]);
310
- var NullableEntityIdSchema = EntityIdSchema.nullable();
311
313
  var StoreTypeSchema = zod.z.enum([
312
314
  "b2C",
313
315
  "marketplace",
@@ -479,11 +481,11 @@ var CmsPageDetailsDtoSchema = zod.z.object({
479
481
  status: CmsPageStatusSchema,
480
482
  hasPublishedVersion: zod.z.boolean(),
481
483
  publishedOn: NullableDateTimeOffsetSchema,
482
- publishedBy: NullableUuidSchema,
484
+ publishedBy: NullableEntityIdSchema,
483
485
  createdOn: DateTimeOffsetSchema,
484
486
  updatedOn: NullableDateTimeOffsetSchema,
485
- createdBy: NullableUuidSchema,
486
- updatedBy: NullableUuidSchema,
487
+ createdBy: NullableEntityIdSchema,
488
+ updatedBy: NullableEntityIdSchema,
487
489
  lastModifiedBy: zod.z.string().nullable()
488
490
  }).strict();
489
491
  var CmsSnapshotDtoSchema = zod.z.object({
@@ -575,7 +577,7 @@ async function getRelatedProducts(api, params) {
575
577
  var ProductAutocompleteParamsSchema = zod.z.object({
576
578
  search: zod.z.string().min(2).max(80),
577
579
  limit: zod.z.number().int().positive().max(20).default(8),
578
- sellerId: zod.z.string().uuid().optional()
580
+ sellerId: OptionalEntityIdSchema
579
581
  });
580
582
  var ProductSuggestionSchema = zod.z.object({
581
583
  id: ProductPublicIdSchema,
@@ -689,7 +691,7 @@ var StorefrontCartBundleItemSchema = zod.z.object({
689
691
  quantity: zod.z.number().int().positive()
690
692
  });
691
693
  var StorefrontCartItemSchema = zod.z.object({
692
- id: zod.z.string().uuid(),
694
+ id: EntityIdSchema,
693
695
  productId: zod.z.number().int().safe().nonnegative(),
694
696
  title: zod.z.string(),
695
697
  variantLabel: zod.z.string().nullable(),
@@ -703,20 +705,20 @@ var StorefrontCartItemSchema = zod.z.object({
703
705
  bundleItems: zod.z.array(StorefrontCartBundleItemSchema)
704
706
  });
705
707
  var StorefrontCartShippingMethodSchema = zod.z.object({
706
- id: zod.z.string().uuid(),
707
- shippingMethodId: zod.z.string().uuid().nullable(),
708
- rateId: zod.z.string().uuid().nullable(),
708
+ id: EntityIdSchema,
709
+ shippingMethodId: NullableEntityIdSchema,
710
+ rateId: NullableEntityIdSchema,
709
711
  name: zod.z.string(),
710
712
  description: zod.z.string().nullable(),
711
713
  total: zod.z.number(),
712
- locationId: zod.z.string().uuid().nullable(),
714
+ locationId: NullableEntityIdSchema,
713
715
  estimatedDays: zod.z.number().int().nullable(),
714
- pickupPointId: zod.z.string().uuid().nullable(),
716
+ pickupPointId: NullableEntityIdSchema,
715
717
  scheduledDate: zod.z.string().nullable(),
716
718
  scheduledTime: zod.z.string().nullable(),
717
719
  serviceCode: zod.z.string().nullable(),
718
- sellerId: zod.z.string().uuid().nullable(),
719
- shippingProfileId: zod.z.string().uuid().nullable()
720
+ sellerId: NullableEntityIdSchema,
721
+ shippingProfileId: NullableEntityIdSchema
720
722
  });
721
723
  var StorefrontCartTotalsSchema = zod.z.object({
722
724
  subtotal: zod.z.number(),
@@ -737,7 +739,7 @@ var StorefrontCartStatusSchema = zod.z.enum([
737
739
  "failed"
738
740
  ]);
739
741
  var StorefrontCartSchema = zod.z.object({
740
- id: zod.z.string().uuid(),
742
+ id: EntityIdSchema,
741
743
  cartNumber: zod.z.string(),
742
744
  email: zod.z.string().nullable(),
743
745
  phone: zod.z.string().nullable(),
@@ -759,26 +761,26 @@ var CreateCartParamsSchema = zod.z.object({
759
761
  email: zod.z.string().email().optional()
760
762
  });
761
763
  var GetCartParamsSchema = zod.z.object({
762
- cartId: zod.z.string().uuid()
764
+ cartId: EntityIdSchema
763
765
  });
764
766
  var CartItemModifierSchema = zod.z.object({
765
767
  modifierGroupId: zod.z.number().int().safe().positive(),
766
768
  optionIds: zod.z.array(zod.z.number().int().safe().positive()).min(1)
767
769
  });
768
770
  var AddCartItemParamsSchema = zod.z.object({
769
- cartId: zod.z.string().uuid(),
771
+ cartId: EntityIdSchema,
770
772
  variantId: zod.z.number().int().safe().positive(),
771
773
  quantity: zod.z.number().int().positive(),
772
774
  modifiers: zod.z.array(CartItemModifierSchema).optional()
773
775
  });
774
776
  var UpdateCartItemQuantityParamsSchema = zod.z.object({
775
- cartId: zod.z.string().uuid(),
776
- cartItemId: zod.z.string().uuid(),
777
+ cartId: EntityIdSchema,
778
+ cartItemId: EntityIdSchema,
777
779
  quantity: zod.z.number().int().nonnegative()
778
780
  });
779
781
  var RemoveCartItemParamsSchema = zod.z.object({
780
- cartId: zod.z.string().uuid(),
781
- cartItemId: zod.z.string().uuid()
782
+ cartId: EntityIdSchema,
783
+ cartItemId: EntityIdSchema
782
784
  });
783
785
 
784
786
  // src/services/cart.service.ts
@@ -844,7 +846,7 @@ async function getPageBySlug(api, pageSlug) {
844
846
  return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
845
847
  }
846
848
  var CartBuyerParamsSchema = zod.z.object({
847
- cartId: zod.z.string().uuid(),
849
+ cartId: EntityIdSchema,
848
850
  email: zod.z.string().email(),
849
851
  firstName: zod.z.string().min(1),
850
852
  lastName: zod.z.string().min(1),
@@ -870,7 +872,7 @@ var CartAddressWriteSchema = zod.z.object({
870
872
  }).nullable().optional()
871
873
  });
872
874
  var CartAddressesParamsSchema = zod.z.object({
873
- cartId: zod.z.string().uuid(),
875
+ cartId: EntityIdSchema,
874
876
  shippingAddress: CartAddressWriteSchema,
875
877
  billingAddress: CartAddressWriteSchema
876
878
  });
@@ -903,7 +905,7 @@ var StorefrontOrderBumpSchema = zod.z.object({
903
905
  description: zod.z.string().nullable().optional()
904
906
  });
905
907
  var CartCheckoutReadParamsSchema = zod.z.object({
906
- cartId: zod.z.string().uuid()
908
+ cartId: EntityIdSchema
907
909
  });
908
910
  var CartCheckoutReadResponseSchema = zod.z.object({
909
911
  cart: StorefrontCartSchema,
@@ -950,7 +952,7 @@ var CartCheckoutResponseSchema = zod.z.object({
950
952
  cart: StorefrontCartSchema.optional()
951
953
  }).passthrough();
952
954
  var CartCheckoutParamsSchema = zod.z.object({
953
- cartId: zod.z.string().uuid(),
955
+ cartId: EntityIdSchema,
954
956
  paymentMethodCode: zod.z.string().min(1),
955
957
  externalRef: zod.z.string().min(1),
956
958
  receiptUrl: zod.z.string().min(1).optional()
@@ -983,11 +985,11 @@ var ShippingOptionsResponseSchema = zod.z.object({
983
985
  groups: zod.z.array(ShippingOptionGroupSchema)
984
986
  });
985
987
  var GetShippingOptionsParamsSchema = zod.z.object({
986
- cartId: zod.z.string().uuid(),
988
+ cartId: EntityIdSchema,
987
989
  postalCode: zod.z.string().min(1)
988
990
  });
989
991
  var PutShippingMethodParamsSchema = zod.z.object({
990
- cartId: zod.z.string().uuid(),
992
+ cartId: EntityIdSchema,
991
993
  rateId: zod.z.string().min(1),
992
994
  shippingMethodId: zod.z.string().min(1),
993
995
  serviceCode: zod.z.string().nullable().optional(),
@@ -1003,7 +1005,7 @@ var CartPaymentReceiptResponseSchema = zod.z.object({
1003
1005
  url: zod.z.string()
1004
1006
  });
1005
1007
  var CartPromotionCodeParamsSchema = zod.z.object({
1006
- cartId: zod.z.string().uuid(),
1008
+ cartId: EntityIdSchema,
1007
1009
  code: zod.z.string().min(1)
1008
1010
  });
1009
1011
 
@@ -1099,12 +1101,12 @@ var CountrySchema = zod.z.object({
1099
1101
  var CountriesSchema = zod.z.array(CountrySchema);
1100
1102
  var GeoDivisionTypeSchema = zod.z.enum(["level1", "level2", "level3"]);
1101
1103
  var GeoDivisionSchema = zod.z.object({
1102
- id: zod.z.string().uuid(),
1104
+ id: EntityIdSchema,
1103
1105
  countryCode: zod.z.string().length(2),
1104
1106
  type: GeoDivisionTypeSchema,
1105
1107
  code: zod.z.string().min(1),
1106
1108
  name: zod.z.string().min(1),
1107
- parentId: zod.z.string().uuid().nullable(),
1109
+ parentId: NullableEntityIdSchema,
1108
1110
  source: zod.z.string().min(1)
1109
1111
  }).strict();
1110
1112
  var DepartmentSchema = GeoDivisionSchema;