@ecomiq/core 0.1.5 → 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.
- package/dist/client.cjs +46 -39
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +46 -39
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +49 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47 -40
- package/dist/index.js.map +1 -1
- package/dist/models/geo.cjs +10 -2
- package/dist/models/geo.cjs.map +1 -1
- package/dist/models/geo.d.cts +14 -14
- package/dist/models/geo.d.ts +14 -14
- package/dist/models/geo.js +10 -2
- package/dist/models/geo.js.map +1 -1
- package/dist/models/ids.cjs +17 -0
- package/dist/models/ids.cjs.map +1 -0
- package/dist/models/ids.d.cts +12 -0
- package/dist/models/ids.d.ts +12 -0
- package/dist/models/ids.js +13 -0
- package/dist/models/ids.js.map +1 -0
- package/dist/models/products.cjs +12 -4
- package/dist/models/products.cjs.map +1 -1
- package/dist/models/products.d.cts +4 -4
- package/dist/models/products.d.ts +4 -4
- package/dist/models/products.js +12 -4
- package/dist/models/products.js.map +1 -1
- package/dist/models/search.cjs +11 -5
- package/dist/models/search.cjs.map +1 -1
- package/dist/models/search.d.cts +1 -1
- package/dist/models/search.d.ts +1 -1
- package/dist/models/search.js +11 -5
- package/dist/models/search.js.map +1 -1
- package/dist/models/settings.cjs +20 -10
- package/dist/models/settings.cjs.map +1 -1
- package/dist/models/settings.d.cts +64 -63
- package/dist/models/settings.d.ts +64 -63
- package/dist/models/settings.js +18 -11
- package/dist/models/settings.js.map +1 -1
- package/dist/models/storefront-cart.cjs +23 -15
- package/dist/models/storefront-cart.cjs.map +1 -1
- package/dist/models/storefront-cart.d.cts +23 -23
- package/dist/models/storefront-cart.d.ts +23 -23
- package/dist/models/storefront-cart.js +23 -15
- package/dist/models/storefront-cart.js.map +1 -1
- package/dist/models/storefront-checkout.cjs +28 -22
- package/dist/models/storefront-checkout.cjs.map +1 -1
- package/dist/models/storefront-checkout.d.cts +43 -43
- package/dist/models/storefront-checkout.d.ts +43 -43
- package/dist/models/storefront-checkout.js +28 -22
- package/dist/models/storefront-checkout.js.map +1 -1
- package/dist/models/storefront-reviews.cjs +12 -4
- package/dist/models/storefront-reviews.cjs.map +1 -1
- package/dist/models/storefront-reviews.js +12 -4
- package/dist/models/storefront-reviews.js.map +1 -1
- 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:
|
|
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:
|
|
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:
|
|
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:
|
|
216
|
+
sellerId: OptionalEntityIdSchema
|
|
209
217
|
});
|
|
210
218
|
var SpecItemSchema = zod.z.object({
|
|
211
219
|
key: zod.z.string(),
|
|
@@ -312,7 +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
323
|
var StoreTypeSchema = zod.z.enum([
|
|
317
324
|
"b2C",
|
|
318
325
|
"marketplace",
|
|
@@ -375,9 +382,9 @@ var StoreCheckoutSettingsSchema = zod.z.object({
|
|
|
375
382
|
ordersAndPayments: StoreCheckoutOrdersAndPaymentsSettingsSchema
|
|
376
383
|
}).strict();
|
|
377
384
|
var StorefrontStoreShape = {
|
|
378
|
-
id:
|
|
379
|
-
tenantId:
|
|
380
|
-
sellerId:
|
|
385
|
+
id: EntityIdSchema,
|
|
386
|
+
tenantId: EntityIdSchema,
|
|
387
|
+
sellerId: NullableEntityIdSchema,
|
|
381
388
|
type: StoreTypeSchema,
|
|
382
389
|
isActive: zod.z.boolean(),
|
|
383
390
|
name: zod.z.string(),
|
|
@@ -458,13 +465,13 @@ var CmsMenuDtoSchema = zod.z.object({
|
|
|
458
465
|
items: zod.z.array(CmsMenuItemSchema)
|
|
459
466
|
}).strict();
|
|
460
467
|
var CmsBlockDtoSchema = zod.z.object({
|
|
461
|
-
id:
|
|
468
|
+
id: EntityIdSchema,
|
|
462
469
|
type: zod.z.string(),
|
|
463
470
|
order: zod.z.number().int(),
|
|
464
471
|
settings: JsonElementSchema
|
|
465
472
|
}).strict();
|
|
466
473
|
var CmsSectionDtoSchema = zod.z.object({
|
|
467
|
-
id:
|
|
474
|
+
id: EntityIdSchema,
|
|
468
475
|
type: zod.z.string(),
|
|
469
476
|
order: zod.z.number().int(),
|
|
470
477
|
settings: JsonElementSchema,
|
|
@@ -473,7 +480,7 @@ var CmsSectionDtoSchema = zod.z.object({
|
|
|
473
480
|
var CmsContentChannelSchema = zod.z.enum(["storefront", "pos"]);
|
|
474
481
|
var CmsPageStatusSchema = zod.z.enum(["draft", "published", "archived"]);
|
|
475
482
|
var CmsPageDetailsDtoSchema = zod.z.object({
|
|
476
|
-
id:
|
|
483
|
+
id: EntityIdSchema,
|
|
477
484
|
name: zod.z.string(),
|
|
478
485
|
slug: zod.z.string(),
|
|
479
486
|
channel: CmsContentChannelSchema,
|
|
@@ -484,11 +491,11 @@ var CmsPageDetailsDtoSchema = zod.z.object({
|
|
|
484
491
|
status: CmsPageStatusSchema,
|
|
485
492
|
hasPublishedVersion: zod.z.boolean(),
|
|
486
493
|
publishedOn: NullableDateTimeOffsetSchema,
|
|
487
|
-
publishedBy:
|
|
494
|
+
publishedBy: NullableEntityIdSchema,
|
|
488
495
|
createdOn: DateTimeOffsetSchema,
|
|
489
496
|
updatedOn: NullableDateTimeOffsetSchema,
|
|
490
|
-
createdBy:
|
|
491
|
-
updatedBy:
|
|
497
|
+
createdBy: NullableEntityIdSchema,
|
|
498
|
+
updatedBy: NullableEntityIdSchema,
|
|
492
499
|
lastModifiedBy: zod.z.string().nullable()
|
|
493
500
|
}).strict();
|
|
494
501
|
var CmsSnapshotDtoSchema = zod.z.object({
|
|
@@ -599,7 +606,7 @@ async function getRelatedProducts(api, params) {
|
|
|
599
606
|
var ProductAutocompleteParamsSchema = zod.z.object({
|
|
600
607
|
search: zod.z.string().min(2).max(80),
|
|
601
608
|
limit: zod.z.number().int().positive().max(20).default(8),
|
|
602
|
-
sellerId:
|
|
609
|
+
sellerId: OptionalEntityIdSchema
|
|
603
610
|
});
|
|
604
611
|
var ProductSuggestionSchema = zod.z.object({
|
|
605
612
|
id: ProductPublicIdSchema,
|
|
@@ -723,7 +730,7 @@ var StorefrontCartBundleItemSchema = zod.z.object({
|
|
|
723
730
|
quantity: zod.z.number().int().positive()
|
|
724
731
|
});
|
|
725
732
|
var StorefrontCartItemSchema = zod.z.object({
|
|
726
|
-
id:
|
|
733
|
+
id: EntityIdSchema,
|
|
727
734
|
productId: zod.z.number().int().safe().nonnegative(),
|
|
728
735
|
title: zod.z.string(),
|
|
729
736
|
variantLabel: zod.z.string().nullable(),
|
|
@@ -737,20 +744,20 @@ var StorefrontCartItemSchema = zod.z.object({
|
|
|
737
744
|
bundleItems: zod.z.array(StorefrontCartBundleItemSchema)
|
|
738
745
|
});
|
|
739
746
|
var StorefrontCartShippingMethodSchema = zod.z.object({
|
|
740
|
-
id:
|
|
741
|
-
shippingMethodId:
|
|
742
|
-
rateId:
|
|
747
|
+
id: EntityIdSchema,
|
|
748
|
+
shippingMethodId: NullableEntityIdSchema,
|
|
749
|
+
rateId: NullableEntityIdSchema,
|
|
743
750
|
name: zod.z.string(),
|
|
744
751
|
description: zod.z.string().nullable(),
|
|
745
752
|
total: zod.z.number(),
|
|
746
|
-
locationId:
|
|
753
|
+
locationId: NullableEntityIdSchema,
|
|
747
754
|
estimatedDays: zod.z.number().int().nullable(),
|
|
748
|
-
pickupPointId:
|
|
755
|
+
pickupPointId: NullableEntityIdSchema,
|
|
749
756
|
scheduledDate: zod.z.string().nullable(),
|
|
750
757
|
scheduledTime: zod.z.string().nullable(),
|
|
751
758
|
serviceCode: zod.z.string().nullable(),
|
|
752
|
-
sellerId:
|
|
753
|
-
shippingProfileId:
|
|
759
|
+
sellerId: NullableEntityIdSchema,
|
|
760
|
+
shippingProfileId: NullableEntityIdSchema
|
|
754
761
|
});
|
|
755
762
|
var StorefrontCartTotalsSchema = zod.z.object({
|
|
756
763
|
subtotal: zod.z.number(),
|
|
@@ -771,7 +778,7 @@ var StorefrontCartStatusSchema = zod.z.enum([
|
|
|
771
778
|
"failed"
|
|
772
779
|
]);
|
|
773
780
|
var StorefrontCartSchema = zod.z.object({
|
|
774
|
-
id:
|
|
781
|
+
id: EntityIdSchema,
|
|
775
782
|
cartNumber: zod.z.string(),
|
|
776
783
|
email: zod.z.string().nullable(),
|
|
777
784
|
phone: zod.z.string().nullable(),
|
|
@@ -793,26 +800,26 @@ var CreateCartParamsSchema = zod.z.object({
|
|
|
793
800
|
email: zod.z.string().email().optional()
|
|
794
801
|
});
|
|
795
802
|
var GetCartParamsSchema = zod.z.object({
|
|
796
|
-
cartId:
|
|
803
|
+
cartId: EntityIdSchema
|
|
797
804
|
});
|
|
798
805
|
var CartItemModifierSchema = zod.z.object({
|
|
799
806
|
modifierGroupId: zod.z.number().int().safe().positive(),
|
|
800
807
|
optionIds: zod.z.array(zod.z.number().int().safe().positive()).min(1)
|
|
801
808
|
});
|
|
802
809
|
var AddCartItemParamsSchema = zod.z.object({
|
|
803
|
-
cartId:
|
|
810
|
+
cartId: EntityIdSchema,
|
|
804
811
|
variantId: zod.z.number().int().safe().positive(),
|
|
805
812
|
quantity: zod.z.number().int().positive(),
|
|
806
813
|
modifiers: zod.z.array(CartItemModifierSchema).optional()
|
|
807
814
|
});
|
|
808
815
|
var UpdateCartItemQuantityParamsSchema = zod.z.object({
|
|
809
|
-
cartId:
|
|
810
|
-
cartItemId:
|
|
816
|
+
cartId: EntityIdSchema,
|
|
817
|
+
cartItemId: EntityIdSchema,
|
|
811
818
|
quantity: zod.z.number().int().nonnegative()
|
|
812
819
|
});
|
|
813
820
|
var RemoveCartItemParamsSchema = zod.z.object({
|
|
814
|
-
cartId:
|
|
815
|
-
cartItemId:
|
|
821
|
+
cartId: EntityIdSchema,
|
|
822
|
+
cartItemId: EntityIdSchema
|
|
816
823
|
});
|
|
817
824
|
|
|
818
825
|
// src/services/cart.service.ts
|
|
@@ -878,7 +885,7 @@ async function getPageBySlug(api, pageSlug) {
|
|
|
878
885
|
return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
|
|
879
886
|
}
|
|
880
887
|
var CartBuyerParamsSchema = zod.z.object({
|
|
881
|
-
cartId:
|
|
888
|
+
cartId: EntityIdSchema,
|
|
882
889
|
email: zod.z.string().email(),
|
|
883
890
|
firstName: zod.z.string().min(1),
|
|
884
891
|
lastName: zod.z.string().min(1),
|
|
@@ -904,7 +911,7 @@ var CartAddressWriteSchema = zod.z.object({
|
|
|
904
911
|
}).nullable().optional()
|
|
905
912
|
});
|
|
906
913
|
var CartAddressesParamsSchema = zod.z.object({
|
|
907
|
-
cartId:
|
|
914
|
+
cartId: EntityIdSchema,
|
|
908
915
|
shippingAddress: CartAddressWriteSchema,
|
|
909
916
|
billingAddress: CartAddressWriteSchema
|
|
910
917
|
});
|
|
@@ -937,7 +944,7 @@ var StorefrontOrderBumpSchema = zod.z.object({
|
|
|
937
944
|
description: zod.z.string().nullable().optional()
|
|
938
945
|
});
|
|
939
946
|
var CartCheckoutReadParamsSchema = zod.z.object({
|
|
940
|
-
cartId:
|
|
947
|
+
cartId: EntityIdSchema
|
|
941
948
|
});
|
|
942
949
|
var CartCheckoutReadResponseSchema = zod.z.object({
|
|
943
950
|
cart: StorefrontCartSchema,
|
|
@@ -984,7 +991,7 @@ var CartCheckoutResponseSchema = zod.z.object({
|
|
|
984
991
|
cart: StorefrontCartSchema.optional()
|
|
985
992
|
}).passthrough();
|
|
986
993
|
var CartCheckoutParamsSchema = zod.z.object({
|
|
987
|
-
cartId:
|
|
994
|
+
cartId: EntityIdSchema,
|
|
988
995
|
paymentMethodCode: zod.z.string().min(1),
|
|
989
996
|
externalRef: zod.z.string().min(1),
|
|
990
997
|
receiptUrl: zod.z.string().min(1).optional()
|
|
@@ -1017,11 +1024,11 @@ var ShippingOptionsResponseSchema = zod.z.object({
|
|
|
1017
1024
|
groups: zod.z.array(ShippingOptionGroupSchema)
|
|
1018
1025
|
});
|
|
1019
1026
|
var GetShippingOptionsParamsSchema = zod.z.object({
|
|
1020
|
-
cartId:
|
|
1027
|
+
cartId: EntityIdSchema,
|
|
1021
1028
|
postalCode: zod.z.string().min(1)
|
|
1022
1029
|
});
|
|
1023
1030
|
var PutShippingMethodParamsSchema = zod.z.object({
|
|
1024
|
-
cartId:
|
|
1031
|
+
cartId: EntityIdSchema,
|
|
1025
1032
|
rateId: zod.z.string().min(1),
|
|
1026
1033
|
shippingMethodId: zod.z.string().min(1),
|
|
1027
1034
|
serviceCode: zod.z.string().nullable().optional(),
|
|
@@ -1037,7 +1044,7 @@ var CartPaymentReceiptResponseSchema = zod.z.object({
|
|
|
1037
1044
|
url: zod.z.string()
|
|
1038
1045
|
});
|
|
1039
1046
|
var CartPromotionCodeParamsSchema = zod.z.object({
|
|
1040
|
-
cartId:
|
|
1047
|
+
cartId: EntityIdSchema,
|
|
1041
1048
|
code: zod.z.string().min(1)
|
|
1042
1049
|
});
|
|
1043
1050
|
|
|
@@ -1133,12 +1140,12 @@ var CountrySchema = zod.z.object({
|
|
|
1133
1140
|
var CountriesSchema = zod.z.array(CountrySchema);
|
|
1134
1141
|
var GeoDivisionTypeSchema = zod.z.enum(["level1", "level2", "level3"]);
|
|
1135
1142
|
var GeoDivisionSchema = zod.z.object({
|
|
1136
|
-
id:
|
|
1143
|
+
id: EntityIdSchema,
|
|
1137
1144
|
countryCode: zod.z.string().length(2),
|
|
1138
1145
|
type: GeoDivisionTypeSchema,
|
|
1139
1146
|
code: zod.z.string().min(1),
|
|
1140
1147
|
name: zod.z.string().min(1),
|
|
1141
|
-
parentId:
|
|
1148
|
+
parentId: NullableEntityIdSchema,
|
|
1142
1149
|
source: zod.z.string().min(1)
|
|
1143
1150
|
}).strict();
|
|
1144
1151
|
var DepartmentSchema = GeoDivisionSchema;
|
|
@@ -1952,6 +1959,7 @@ exports.DepartmentSchema = DepartmentSchema;
|
|
|
1952
1959
|
exports.DepartmentsSchema = DepartmentsSchema;
|
|
1953
1960
|
exports.DistrictSchema = DistrictSchema;
|
|
1954
1961
|
exports.DistrictsSchema = DistrictsSchema;
|
|
1962
|
+
exports.EntityIdSchema = EntityIdSchema;
|
|
1955
1963
|
exports.FacetItemSchema = FacetItemSchema;
|
|
1956
1964
|
exports.FacetSchema = FacetSchema;
|
|
1957
1965
|
exports.GeoDivisionSchema = GeoDivisionSchema;
|
|
@@ -1963,6 +1971,8 @@ exports.GetProvincesParamsSchema = GetProvincesParamsSchema;
|
|
|
1963
1971
|
exports.GetShippingOptionsParamsSchema = GetShippingOptionsParamsSchema;
|
|
1964
1972
|
exports.JsonElementSchema = JsonElementSchema;
|
|
1965
1973
|
exports.ListProductReviewsParamsSchema = ListProductReviewsParamsSchema;
|
|
1974
|
+
exports.NullableEntityIdSchema = NullableEntityIdSchema;
|
|
1975
|
+
exports.OptionalEntityIdSchema = OptionalEntityIdSchema;
|
|
1966
1976
|
exports.PriceTierSchema = PriceTierSchema;
|
|
1967
1977
|
exports.ProductAutocompleteParamsSchema = ProductAutocompleteParamsSchema;
|
|
1968
1978
|
exports.ProductDetailParamsSchema = ProductDetailParamsSchema;
|