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