@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/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:
|
|
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:
|
|
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:
|
|
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:
|
|
209
|
+
sellerId: OptionalEntityIdSchema
|
|
202
210
|
});
|
|
203
211
|
var SpecItemSchema = zod.z.object({
|
|
204
212
|
key: zod.z.string(),
|
|
@@ -302,7 +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
313
|
var StoreTypeSchema = zod.z.enum([
|
|
307
314
|
"b2C",
|
|
308
315
|
"marketplace",
|
|
@@ -365,9 +372,9 @@ var StoreCheckoutSettingsSchema = zod.z.object({
|
|
|
365
372
|
ordersAndPayments: StoreCheckoutOrdersAndPaymentsSettingsSchema
|
|
366
373
|
}).strict();
|
|
367
374
|
var StorefrontStoreShape = {
|
|
368
|
-
id:
|
|
369
|
-
tenantId:
|
|
370
|
-
sellerId:
|
|
375
|
+
id: EntityIdSchema,
|
|
376
|
+
tenantId: EntityIdSchema,
|
|
377
|
+
sellerId: NullableEntityIdSchema,
|
|
371
378
|
type: StoreTypeSchema,
|
|
372
379
|
isActive: zod.z.boolean(),
|
|
373
380
|
name: zod.z.string(),
|
|
@@ -448,13 +455,13 @@ var CmsMenuDtoSchema = zod.z.object({
|
|
|
448
455
|
items: zod.z.array(CmsMenuItemSchema)
|
|
449
456
|
}).strict();
|
|
450
457
|
var CmsBlockDtoSchema = zod.z.object({
|
|
451
|
-
id:
|
|
458
|
+
id: EntityIdSchema,
|
|
452
459
|
type: zod.z.string(),
|
|
453
460
|
order: zod.z.number().int(),
|
|
454
461
|
settings: JsonElementSchema
|
|
455
462
|
}).strict();
|
|
456
463
|
var CmsSectionDtoSchema = zod.z.object({
|
|
457
|
-
id:
|
|
464
|
+
id: EntityIdSchema,
|
|
458
465
|
type: zod.z.string(),
|
|
459
466
|
order: zod.z.number().int(),
|
|
460
467
|
settings: JsonElementSchema,
|
|
@@ -463,7 +470,7 @@ var CmsSectionDtoSchema = zod.z.object({
|
|
|
463
470
|
var CmsContentChannelSchema = zod.z.enum(["storefront", "pos"]);
|
|
464
471
|
var CmsPageStatusSchema = zod.z.enum(["draft", "published", "archived"]);
|
|
465
472
|
var CmsPageDetailsDtoSchema = zod.z.object({
|
|
466
|
-
id:
|
|
473
|
+
id: EntityIdSchema,
|
|
467
474
|
name: zod.z.string(),
|
|
468
475
|
slug: zod.z.string(),
|
|
469
476
|
channel: CmsContentChannelSchema,
|
|
@@ -474,11 +481,11 @@ var CmsPageDetailsDtoSchema = zod.z.object({
|
|
|
474
481
|
status: CmsPageStatusSchema,
|
|
475
482
|
hasPublishedVersion: zod.z.boolean(),
|
|
476
483
|
publishedOn: NullableDateTimeOffsetSchema,
|
|
477
|
-
publishedBy:
|
|
484
|
+
publishedBy: NullableEntityIdSchema,
|
|
478
485
|
createdOn: DateTimeOffsetSchema,
|
|
479
486
|
updatedOn: NullableDateTimeOffsetSchema,
|
|
480
|
-
createdBy:
|
|
481
|
-
updatedBy:
|
|
487
|
+
createdBy: NullableEntityIdSchema,
|
|
488
|
+
updatedBy: NullableEntityIdSchema,
|
|
482
489
|
lastModifiedBy: zod.z.string().nullable()
|
|
483
490
|
}).strict();
|
|
484
491
|
var CmsSnapshotDtoSchema = zod.z.object({
|
|
@@ -570,7 +577,7 @@ async function getRelatedProducts(api, params) {
|
|
|
570
577
|
var ProductAutocompleteParamsSchema = zod.z.object({
|
|
571
578
|
search: zod.z.string().min(2).max(80),
|
|
572
579
|
limit: zod.z.number().int().positive().max(20).default(8),
|
|
573
|
-
sellerId:
|
|
580
|
+
sellerId: OptionalEntityIdSchema
|
|
574
581
|
});
|
|
575
582
|
var ProductSuggestionSchema = zod.z.object({
|
|
576
583
|
id: ProductPublicIdSchema,
|
|
@@ -684,7 +691,7 @@ var StorefrontCartBundleItemSchema = zod.z.object({
|
|
|
684
691
|
quantity: zod.z.number().int().positive()
|
|
685
692
|
});
|
|
686
693
|
var StorefrontCartItemSchema = zod.z.object({
|
|
687
|
-
id:
|
|
694
|
+
id: EntityIdSchema,
|
|
688
695
|
productId: zod.z.number().int().safe().nonnegative(),
|
|
689
696
|
title: zod.z.string(),
|
|
690
697
|
variantLabel: zod.z.string().nullable(),
|
|
@@ -698,20 +705,20 @@ var StorefrontCartItemSchema = zod.z.object({
|
|
|
698
705
|
bundleItems: zod.z.array(StorefrontCartBundleItemSchema)
|
|
699
706
|
});
|
|
700
707
|
var StorefrontCartShippingMethodSchema = zod.z.object({
|
|
701
|
-
id:
|
|
702
|
-
shippingMethodId:
|
|
703
|
-
rateId:
|
|
708
|
+
id: EntityIdSchema,
|
|
709
|
+
shippingMethodId: NullableEntityIdSchema,
|
|
710
|
+
rateId: NullableEntityIdSchema,
|
|
704
711
|
name: zod.z.string(),
|
|
705
712
|
description: zod.z.string().nullable(),
|
|
706
713
|
total: zod.z.number(),
|
|
707
|
-
locationId:
|
|
714
|
+
locationId: NullableEntityIdSchema,
|
|
708
715
|
estimatedDays: zod.z.number().int().nullable(),
|
|
709
|
-
pickupPointId:
|
|
716
|
+
pickupPointId: NullableEntityIdSchema,
|
|
710
717
|
scheduledDate: zod.z.string().nullable(),
|
|
711
718
|
scheduledTime: zod.z.string().nullable(),
|
|
712
719
|
serviceCode: zod.z.string().nullable(),
|
|
713
|
-
sellerId:
|
|
714
|
-
shippingProfileId:
|
|
720
|
+
sellerId: NullableEntityIdSchema,
|
|
721
|
+
shippingProfileId: NullableEntityIdSchema
|
|
715
722
|
});
|
|
716
723
|
var StorefrontCartTotalsSchema = zod.z.object({
|
|
717
724
|
subtotal: zod.z.number(),
|
|
@@ -732,7 +739,7 @@ var StorefrontCartStatusSchema = zod.z.enum([
|
|
|
732
739
|
"failed"
|
|
733
740
|
]);
|
|
734
741
|
var StorefrontCartSchema = zod.z.object({
|
|
735
|
-
id:
|
|
742
|
+
id: EntityIdSchema,
|
|
736
743
|
cartNumber: zod.z.string(),
|
|
737
744
|
email: zod.z.string().nullable(),
|
|
738
745
|
phone: zod.z.string().nullable(),
|
|
@@ -754,26 +761,26 @@ var CreateCartParamsSchema = zod.z.object({
|
|
|
754
761
|
email: zod.z.string().email().optional()
|
|
755
762
|
});
|
|
756
763
|
var GetCartParamsSchema = zod.z.object({
|
|
757
|
-
cartId:
|
|
764
|
+
cartId: EntityIdSchema
|
|
758
765
|
});
|
|
759
766
|
var CartItemModifierSchema = zod.z.object({
|
|
760
767
|
modifierGroupId: zod.z.number().int().safe().positive(),
|
|
761
768
|
optionIds: zod.z.array(zod.z.number().int().safe().positive()).min(1)
|
|
762
769
|
});
|
|
763
770
|
var AddCartItemParamsSchema = zod.z.object({
|
|
764
|
-
cartId:
|
|
771
|
+
cartId: EntityIdSchema,
|
|
765
772
|
variantId: zod.z.number().int().safe().positive(),
|
|
766
773
|
quantity: zod.z.number().int().positive(),
|
|
767
774
|
modifiers: zod.z.array(CartItemModifierSchema).optional()
|
|
768
775
|
});
|
|
769
776
|
var UpdateCartItemQuantityParamsSchema = zod.z.object({
|
|
770
|
-
cartId:
|
|
771
|
-
cartItemId:
|
|
777
|
+
cartId: EntityIdSchema,
|
|
778
|
+
cartItemId: EntityIdSchema,
|
|
772
779
|
quantity: zod.z.number().int().nonnegative()
|
|
773
780
|
});
|
|
774
781
|
var RemoveCartItemParamsSchema = zod.z.object({
|
|
775
|
-
cartId:
|
|
776
|
-
cartItemId:
|
|
782
|
+
cartId: EntityIdSchema,
|
|
783
|
+
cartItemId: EntityIdSchema
|
|
777
784
|
});
|
|
778
785
|
|
|
779
786
|
// src/services/cart.service.ts
|
|
@@ -839,7 +846,7 @@ async function getPageBySlug(api, pageSlug) {
|
|
|
839
846
|
return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
|
|
840
847
|
}
|
|
841
848
|
var CartBuyerParamsSchema = zod.z.object({
|
|
842
|
-
cartId:
|
|
849
|
+
cartId: EntityIdSchema,
|
|
843
850
|
email: zod.z.string().email(),
|
|
844
851
|
firstName: zod.z.string().min(1),
|
|
845
852
|
lastName: zod.z.string().min(1),
|
|
@@ -865,7 +872,7 @@ var CartAddressWriteSchema = zod.z.object({
|
|
|
865
872
|
}).nullable().optional()
|
|
866
873
|
});
|
|
867
874
|
var CartAddressesParamsSchema = zod.z.object({
|
|
868
|
-
cartId:
|
|
875
|
+
cartId: EntityIdSchema,
|
|
869
876
|
shippingAddress: CartAddressWriteSchema,
|
|
870
877
|
billingAddress: CartAddressWriteSchema
|
|
871
878
|
});
|
|
@@ -898,7 +905,7 @@ var StorefrontOrderBumpSchema = zod.z.object({
|
|
|
898
905
|
description: zod.z.string().nullable().optional()
|
|
899
906
|
});
|
|
900
907
|
var CartCheckoutReadParamsSchema = zod.z.object({
|
|
901
|
-
cartId:
|
|
908
|
+
cartId: EntityIdSchema
|
|
902
909
|
});
|
|
903
910
|
var CartCheckoutReadResponseSchema = zod.z.object({
|
|
904
911
|
cart: StorefrontCartSchema,
|
|
@@ -945,7 +952,7 @@ var CartCheckoutResponseSchema = zod.z.object({
|
|
|
945
952
|
cart: StorefrontCartSchema.optional()
|
|
946
953
|
}).passthrough();
|
|
947
954
|
var CartCheckoutParamsSchema = zod.z.object({
|
|
948
|
-
cartId:
|
|
955
|
+
cartId: EntityIdSchema,
|
|
949
956
|
paymentMethodCode: zod.z.string().min(1),
|
|
950
957
|
externalRef: zod.z.string().min(1),
|
|
951
958
|
receiptUrl: zod.z.string().min(1).optional()
|
|
@@ -978,11 +985,11 @@ var ShippingOptionsResponseSchema = zod.z.object({
|
|
|
978
985
|
groups: zod.z.array(ShippingOptionGroupSchema)
|
|
979
986
|
});
|
|
980
987
|
var GetShippingOptionsParamsSchema = zod.z.object({
|
|
981
|
-
cartId:
|
|
988
|
+
cartId: EntityIdSchema,
|
|
982
989
|
postalCode: zod.z.string().min(1)
|
|
983
990
|
});
|
|
984
991
|
var PutShippingMethodParamsSchema = zod.z.object({
|
|
985
|
-
cartId:
|
|
992
|
+
cartId: EntityIdSchema,
|
|
986
993
|
rateId: zod.z.string().min(1),
|
|
987
994
|
shippingMethodId: zod.z.string().min(1),
|
|
988
995
|
serviceCode: zod.z.string().nullable().optional(),
|
|
@@ -998,7 +1005,7 @@ var CartPaymentReceiptResponseSchema = zod.z.object({
|
|
|
998
1005
|
url: zod.z.string()
|
|
999
1006
|
});
|
|
1000
1007
|
var CartPromotionCodeParamsSchema = zod.z.object({
|
|
1001
|
-
cartId:
|
|
1008
|
+
cartId: EntityIdSchema,
|
|
1002
1009
|
code: zod.z.string().min(1)
|
|
1003
1010
|
});
|
|
1004
1011
|
|
|
@@ -1094,12 +1101,12 @@ var CountrySchema = zod.z.object({
|
|
|
1094
1101
|
var CountriesSchema = zod.z.array(CountrySchema);
|
|
1095
1102
|
var GeoDivisionTypeSchema = zod.z.enum(["level1", "level2", "level3"]);
|
|
1096
1103
|
var GeoDivisionSchema = zod.z.object({
|
|
1097
|
-
id:
|
|
1104
|
+
id: EntityIdSchema,
|
|
1098
1105
|
countryCode: zod.z.string().length(2),
|
|
1099
1106
|
type: GeoDivisionTypeSchema,
|
|
1100
1107
|
code: zod.z.string().min(1),
|
|
1101
1108
|
name: zod.z.string().min(1),
|
|
1102
|
-
parentId:
|
|
1109
|
+
parentId: NullableEntityIdSchema,
|
|
1103
1110
|
source: zod.z.string().min(1)
|
|
1104
1111
|
}).strict();
|
|
1105
1112
|
var DepartmentSchema = GeoDivisionSchema;
|