@ecomiq/core 0.1.7 → 0.1.8
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 +26 -16
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +26 -16
- package/dist/client.js.map +1 -1
- package/dist/index.cjs +27 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +27 -17
- package/dist/index.js.map +1 -1
- package/dist/models/collections.cjs +9 -1
- package/dist/models/collections.cjs.map +1 -1
- package/dist/models/collections.d.cts +6 -6
- package/dist/models/collections.d.ts +6 -6
- package/dist/models/collections.js +9 -1
- package/dist/models/collections.js.map +1 -1
- package/dist/models/storefront-checkout.cjs +18 -7
- package/dist/models/storefront-checkout.cjs.map +1 -1
- package/dist/models/storefront-checkout.d.cts +530 -2158
- package/dist/models/storefront-checkout.d.ts +530 -2158
- package/dist/models/storefront-checkout.js +18 -8
- package/dist/models/storefront-checkout.js.map +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -105,8 +105,16 @@ function createApi(options = {}) {
|
|
|
105
105
|
postForm: (path, body, schema, opts) => request("POST", path, schema, { ...opts, body })
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
|
+
var EntityIdSchema = zod.z.union([
|
|
109
|
+
zod.z.string().uuid(),
|
|
110
|
+
zod.z.string().regex(/^\d+$/, "Expected numeric id")
|
|
111
|
+
]);
|
|
112
|
+
var NullableEntityIdSchema = EntityIdSchema.nullable();
|
|
113
|
+
var OptionalEntityIdSchema = EntityIdSchema.optional();
|
|
114
|
+
|
|
115
|
+
// src/models/collections.ts
|
|
108
116
|
var CollectionSchema = zod.z.object({
|
|
109
|
-
id:
|
|
117
|
+
id: EntityIdSchema,
|
|
110
118
|
slug: zod.z.string(),
|
|
111
119
|
name: zod.z.string(),
|
|
112
120
|
description: zod.z.string().nullable().optional(),
|
|
@@ -115,14 +123,6 @@ var CollectionSchema = zod.z.object({
|
|
|
115
123
|
productCount: zod.z.number().optional()
|
|
116
124
|
});
|
|
117
125
|
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
|
|
126
126
|
var ProductPublicIdSchema = zod.z.union([
|
|
127
127
|
zod.z.string().regex(/^[1-9]\d*$/),
|
|
128
128
|
zod.z.number().int().safe().positive()
|
|
@@ -845,6 +845,16 @@ async function getCollectionBySlug(api, collectionSlug) {
|
|
|
845
845
|
async function getPageBySlug(api, pageSlug) {
|
|
846
846
|
return api.get(`pages/${encodeURIComponent(pageSlug)}`, CmsPageDetailsDtoSchema);
|
|
847
847
|
}
|
|
848
|
+
var CheckoutMetadataValueSchema = zod.z.lazy(
|
|
849
|
+
() => zod.z.union([
|
|
850
|
+
zod.z.string(),
|
|
851
|
+
zod.z.number(),
|
|
852
|
+
zod.z.boolean(),
|
|
853
|
+
zod.z.null(),
|
|
854
|
+
zod.z.array(CheckoutMetadataValueSchema),
|
|
855
|
+
zod.z.record(zod.z.string(), CheckoutMetadataValueSchema)
|
|
856
|
+
])
|
|
857
|
+
);
|
|
848
858
|
var CartBuyerParamsSchema = zod.z.object({
|
|
849
859
|
cartId: EntityIdSchema,
|
|
850
860
|
email: zod.z.string().email(),
|
|
@@ -921,13 +931,13 @@ var CartCheckoutPaymentActionSchema = zod.z.object({
|
|
|
921
931
|
phoneNumber: zod.z.string().nullable().optional(),
|
|
922
932
|
accountHolder: zod.z.string().nullable().optional(),
|
|
923
933
|
qrImageUrl: zod.z.string().nullable().optional()
|
|
924
|
-
}).
|
|
934
|
+
}).strip().nullable().optional(),
|
|
925
935
|
url: zod.z.string().nullable().optional(),
|
|
926
936
|
html: zod.z.string().nullable().optional(),
|
|
927
937
|
clientSecret: zod.z.string().nullable().optional(),
|
|
928
938
|
qrCode: zod.z.string().nullable().optional(),
|
|
929
939
|
expiresAt: zod.z.string().nullable().optional()
|
|
930
|
-
}).
|
|
940
|
+
}).strip();
|
|
931
941
|
var CartCheckoutPaymentSchema = zod.z.object({
|
|
932
942
|
transactionId: zod.z.string(),
|
|
933
943
|
paymentMethodCode: zod.z.string(),
|
|
@@ -938,7 +948,7 @@ var CartCheckoutPaymentSchema = zod.z.object({
|
|
|
938
948
|
actionType: zod.z.string(),
|
|
939
949
|
receiptUrl: zod.z.string().nullable().optional(),
|
|
940
950
|
action: CartCheckoutPaymentActionSchema.nullable().optional()
|
|
941
|
-
}).
|
|
951
|
+
}).strip();
|
|
942
952
|
var CartCheckoutResponseSchema = zod.z.object({
|
|
943
953
|
publicKey: zod.z.string().optional(),
|
|
944
954
|
publishableKey: zod.z.string().optional(),
|
|
@@ -950,7 +960,7 @@ var CartCheckoutResponseSchema = zod.z.object({
|
|
|
950
960
|
orderIds: zod.z.array(zod.z.coerce.string()).optional(),
|
|
951
961
|
payment: CartCheckoutPaymentSchema.optional(),
|
|
952
962
|
cart: StorefrontCartSchema.optional()
|
|
953
|
-
}).
|
|
963
|
+
}).strip();
|
|
954
964
|
var CartCheckoutParamsSchema = zod.z.object({
|
|
955
965
|
cartId: EntityIdSchema,
|
|
956
966
|
paymentMethodCode: zod.z.string().min(1),
|
|
@@ -971,8 +981,8 @@ var ShippingRateSchema = zod.z.object({
|
|
|
971
981
|
deliveryLocationName: zod.z.string().nullable().optional(),
|
|
972
982
|
estimatedDeliveryDays: zod.z.number().nullable().optional(),
|
|
973
983
|
serviceCode: zod.z.string().nullable().optional(),
|
|
974
|
-
metadata: zod.z.record(zod.z.string(),
|
|
975
|
-
}).
|
|
984
|
+
metadata: zod.z.record(zod.z.string(), CheckoutMetadataValueSchema).optional()
|
|
985
|
+
}).strip();
|
|
976
986
|
var ShippingOptionGroupSchema = zod.z.object({
|
|
977
987
|
sellerId: zod.z.string(),
|
|
978
988
|
shippingProfileId: zod.z.string().nullable().optional(),
|
|
@@ -980,7 +990,7 @@ var ShippingOptionGroupSchema = zod.z.object({
|
|
|
980
990
|
totalWeight: zod.z.number().optional(),
|
|
981
991
|
itemIds: zod.z.array(zod.z.string()).optional(),
|
|
982
992
|
rates: zod.z.array(ShippingRateSchema)
|
|
983
|
-
}).
|
|
993
|
+
}).strip();
|
|
984
994
|
var ShippingOptionsResponseSchema = zod.z.object({
|
|
985
995
|
groups: zod.z.array(ShippingOptionGroupSchema)
|
|
986
996
|
});
|