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