@rebuy/rebuy 2.5.0-rc.2 → 2.5.0-rc.3
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/index.js +484 -308
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +484 -308
- package/dist/index.mjs.map +4 -4
- package/dist/schema/index.d.ts +1 -0
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/product.d.ts +382 -0
- package/dist/schema/product.d.ts.map +1 -0
- package/dist/schema/widgets/checkoutAndBeyond/common.d.ts +6 -6
- package/dist/schema/widgets/checkoutAndBeyond/offers.d.ts +1 -1
- package/dist/schema/widgets/checkoutAndBeyond/product.d.ts +1 -1
- package/dist/schema/widgets/checkoutAndBeyond/products.d.ts +1 -1
- package/dist/schema/widgets/checkoutAndBeyond/variants.d.ts +1 -1
- package/dist/schema/widgets/contentBlock.d.ts +1 -0
- package/dist/schema/widgets/contentBlock.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -734,57 +734,230 @@ var RebuyClient = class {
|
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
736
|
|
|
737
|
-
// src/schema/
|
|
737
|
+
// src/schema/product.ts
|
|
738
738
|
import { z } from "zod/v4";
|
|
739
|
-
var
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
739
|
+
var zDatetime = z.iso.datetime({ offset: true });
|
|
740
|
+
var cacheInfoSchema = z.strictObject({
|
|
741
|
+
cachedAtTime: z.union([z.string(), z.number()]),
|
|
742
|
+
cacheExpires: z.union([z.string(), z.number()]).optional(),
|
|
743
|
+
cacheKey: z.string(),
|
|
744
|
+
cacheKeyReadable: z.string(),
|
|
745
|
+
cacheType: z.string().optional(),
|
|
746
|
+
loadedOptions: z.record(z.string(), z.boolean()).optional()
|
|
747
|
+
});
|
|
748
|
+
var categorySchema = z.strictObject({
|
|
749
|
+
adminGraphqlApiId: z.string(),
|
|
750
|
+
fullName: z.string(),
|
|
751
|
+
name: z.string()
|
|
752
|
+
});
|
|
753
|
+
var metafieldSchema = z.strictObject({
|
|
754
|
+
key: z.string(),
|
|
755
|
+
namespace: z.string(),
|
|
756
|
+
type: z.string(),
|
|
757
|
+
value: z.string()
|
|
758
|
+
});
|
|
759
|
+
var imageSchema = z.strictObject({
|
|
760
|
+
adminGraphqlApiId: z.string(),
|
|
761
|
+
alt: z.string().nullable(),
|
|
762
|
+
createdAt: zDatetime.optional(),
|
|
763
|
+
height: z.number(),
|
|
764
|
+
id: z.number(),
|
|
765
|
+
metafields: z.array(metafieldSchema).optional(),
|
|
766
|
+
position: z.number(),
|
|
767
|
+
productId: z.number(),
|
|
768
|
+
src: z.url(),
|
|
769
|
+
updatedAt: zDatetime.optional(),
|
|
770
|
+
variantIds: z.array(z.number()),
|
|
771
|
+
width: z.number()
|
|
772
|
+
});
|
|
773
|
+
var mediaSchema = z.strictObject({
|
|
774
|
+
adminGraphqlApiId: z.string(),
|
|
775
|
+
alt: z.string().nullable(),
|
|
776
|
+
createdAt: zDatetime,
|
|
777
|
+
id: z.number(),
|
|
778
|
+
mediaContentType: z.string(),
|
|
779
|
+
position: z.number(),
|
|
780
|
+
previewImage: z.strictObject({ height: z.number(), src: z.url(), status: z.string(), width: z.number() }),
|
|
781
|
+
productId: z.number(),
|
|
782
|
+
status: z.string(),
|
|
783
|
+
updatedAt: zDatetime,
|
|
784
|
+
variantIds: z.array(z.number())
|
|
785
|
+
});
|
|
786
|
+
var optionSchema = z.strictObject({
|
|
787
|
+
id: z.number(),
|
|
788
|
+
name: z.string(),
|
|
789
|
+
position: z.number(),
|
|
790
|
+
productId: z.number(),
|
|
791
|
+
values: z.array(z.string())
|
|
792
|
+
});
|
|
793
|
+
var priceAdjustmentSchema = z.strictObject({
|
|
794
|
+
orderCount: z.number().optional(),
|
|
795
|
+
position: z.number(),
|
|
796
|
+
value: z.string(),
|
|
797
|
+
valueType: z.string()
|
|
798
|
+
});
|
|
799
|
+
var ratingsSchema = z.union([
|
|
800
|
+
z.strictObject({ judgemeAverageStarRating: z.number(), judgemeTotalReviews: z.number() }),
|
|
801
|
+
z.strictObject({ junipAverageStarRating: z.number(), junipTotalReviews: z.number() }),
|
|
802
|
+
z.strictObject({ klaviyoAverageStarRating: z.number(), klaviyoTotalReviews: z.number() }),
|
|
803
|
+
z.strictObject({ looxAverageStarRating: z.number(), looxTotalReviews: z.number() }),
|
|
804
|
+
z.strictObject({ okendoAverageStarRating: z.number(), okendoTotalReviews: z.number() }),
|
|
805
|
+
z.strictObject({ opinewAverageStarRating: z.number(), opinewTotalReviews: z.number() }),
|
|
806
|
+
z.strictObject({ rechargeAverageStarRating: z.number(), rechargeTotalReviews: z.number() }),
|
|
807
|
+
z.strictObject({ reviewsioAverageStarRating: z.number(), reviewsioTotalReviews: z.number() }),
|
|
808
|
+
z.strictObject({ stampedAverageStarRating: z.number(), stampedTotalReviews: z.number() }),
|
|
809
|
+
z.strictObject({ yotpoAverageStarRating: z.number(), yotpoTotalReviews: z.number() })
|
|
810
|
+
]);
|
|
811
|
+
var sellingPlanSchema = z.strictObject({
|
|
812
|
+
description: z.string().optional(),
|
|
813
|
+
id: z.number(),
|
|
814
|
+
name: z.string(),
|
|
815
|
+
options: z.array(z.strictObject({ name: z.string(), position: z.number(), value: z.string() })),
|
|
816
|
+
orderIntervalFrequency: z.string().optional(),
|
|
817
|
+
orderIntervalUnitType: z.string().optional(),
|
|
818
|
+
position: z.number().optional(),
|
|
819
|
+
priceAdjustments: z.array(priceAdjustmentSchema),
|
|
820
|
+
shopifyVariantId: z.string().optional()
|
|
821
|
+
});
|
|
822
|
+
var sellingPlanAllocationSchema = z.strictObject({
|
|
823
|
+
compareAtPrice: z.number(),
|
|
824
|
+
perDeliveryPrice: z.number(),
|
|
825
|
+
price: z.number(),
|
|
826
|
+
priceAdjustments: z.array(priceAdjustmentSchema),
|
|
827
|
+
sellingPlanGroupId: z.string(),
|
|
828
|
+
sellingPlanId: z.number()
|
|
829
|
+
});
|
|
830
|
+
var sellingPlanGroupSchema = z.strictObject({
|
|
831
|
+
appId: z.string().optional(),
|
|
832
|
+
description: z.string().optional(),
|
|
833
|
+
discountAmount: z.number().optional(),
|
|
834
|
+
discountType: z.string().optional(),
|
|
835
|
+
id: z.string(),
|
|
836
|
+
name: z.string(),
|
|
837
|
+
options: z.array(optionSchema),
|
|
838
|
+
requiresSellingPlan: z.boolean().optional(),
|
|
839
|
+
sellingPlans: z.array(sellingPlanSchema),
|
|
840
|
+
variants: z.array(z.number())
|
|
841
|
+
});
|
|
842
|
+
var variantSchema = z.strictObject({
|
|
843
|
+
adminGraphqlApiId: z.string(),
|
|
844
|
+
barcode: z.string().nullable(),
|
|
845
|
+
compareAtPrice: z.string().nullable(),
|
|
846
|
+
createdAt: zDatetime,
|
|
847
|
+
fulfillmentService: z.string().nullish(),
|
|
848
|
+
grams: z.number(),
|
|
849
|
+
id: z.number(),
|
|
850
|
+
imageId: z.number().nullable(),
|
|
851
|
+
inventoryItemId: z.number().optional(),
|
|
852
|
+
inventoryManagement: z.string().nullable(),
|
|
853
|
+
inventoryPolicy: z.string(),
|
|
854
|
+
inventoryQuantity: z.number(),
|
|
855
|
+
link: z.url(),
|
|
856
|
+
oldInventoryQuantity: z.number().optional(),
|
|
857
|
+
option1: z.string(),
|
|
858
|
+
option2: z.string().nullable(),
|
|
859
|
+
option3: z.string().nullable(),
|
|
860
|
+
position: z.number(),
|
|
861
|
+
price: z.string(),
|
|
862
|
+
productId: z.number(),
|
|
863
|
+
requiresShipping: z.boolean(),
|
|
864
|
+
sellingPlanAllocations: z.array(sellingPlanAllocationSchema).optional(),
|
|
865
|
+
sku: z.string().nullable(),
|
|
866
|
+
taxable: z.boolean(),
|
|
867
|
+
taxCode: z.string().optional(),
|
|
868
|
+
title: z.string(),
|
|
869
|
+
updatedAt: zDatetime,
|
|
870
|
+
weight: z.number(),
|
|
871
|
+
weightUnit: z.string().optional()
|
|
872
|
+
});
|
|
873
|
+
var productSchema = z.strictObject({
|
|
874
|
+
adminGraphqlApiId: z.string(),
|
|
875
|
+
bodyHtml: z.string().nullable(),
|
|
876
|
+
cacheInfo: cacheInfoSchema,
|
|
877
|
+
category: categorySchema.nullish(),
|
|
878
|
+
collectionIds: z.array(z.number()),
|
|
879
|
+
createdAt: zDatetime,
|
|
880
|
+
description: z.string(),
|
|
881
|
+
handle: z.string(),
|
|
882
|
+
hasVariantsThatRequiresComponents: z.boolean().optional(),
|
|
883
|
+
id: z.number(),
|
|
884
|
+
image: imageSchema.nullable(),
|
|
885
|
+
images: z.array(imageSchema).nullable(),
|
|
886
|
+
link: z.url(),
|
|
887
|
+
media: z.array(mediaSchema).optional(),
|
|
888
|
+
metafields: z.array(metafieldSchema).optional(),
|
|
889
|
+
options: z.array(optionSchema),
|
|
890
|
+
owner: z.union([z.string(), z.number()]),
|
|
891
|
+
productType: z.string(),
|
|
892
|
+
publishedAt: zDatetime.nullable(),
|
|
893
|
+
publishedScope: z.string().optional(),
|
|
894
|
+
purchaseOptions: z.array(z.strictObject({ discountOptions: z.array(z.never()) })).optional(),
|
|
895
|
+
ratings: ratingsSchema.optional(),
|
|
896
|
+
selectedIndexPurchasedOption: z.number().optional(),
|
|
897
|
+
sellingPlanAllocation: sellingPlanAllocationSchema.optional(),
|
|
898
|
+
sellingPlanGroups: z.array(sellingPlanGroupSchema).optional(),
|
|
899
|
+
status: z.string(),
|
|
900
|
+
tags: z.string(),
|
|
901
|
+
templateSuffix: z.string().nullable(),
|
|
902
|
+
title: z.string(),
|
|
903
|
+
updatedAt: zDatetime,
|
|
904
|
+
variantGids: z.array(z.strictObject({ adminGraphqlApiId: z.string(), updatedAt: zDatetime })).optional(),
|
|
905
|
+
variantIds: z.array(z.strictObject({ id: z.number() })).optional(),
|
|
906
|
+
variants: z.array(variantSchema),
|
|
907
|
+
vendor: z.string()
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
// src/schema/shopConfig.ts
|
|
911
|
+
import { z as z2 } from "zod/v4";
|
|
912
|
+
var ShopConfig = z2.strictObject({
|
|
913
|
+
activeExperiments: z2.array(
|
|
914
|
+
z2.strictObject({
|
|
915
|
+
data: z2.array(
|
|
916
|
+
z2.strictObject({
|
|
917
|
+
aliasName: z2.string(),
|
|
918
|
+
cssInput: z2.string().nullish(),
|
|
919
|
+
elementId: z2.coerce.number(),
|
|
920
|
+
id: z2.coerce.number(),
|
|
921
|
+
javascriptInput: z2.string().nullish(),
|
|
922
|
+
traffic: z2.coerce.number()
|
|
750
923
|
})
|
|
751
924
|
),
|
|
752
|
-
id:
|
|
753
|
-
name:
|
|
754
|
-
pageTarget:
|
|
755
|
-
pageTargetUrl:
|
|
756
|
-
placeholderId:
|
|
757
|
-
type:
|
|
925
|
+
id: z2.coerce.number(),
|
|
926
|
+
name: z2.string(),
|
|
927
|
+
pageTarget: z2.string().nullable(),
|
|
928
|
+
pageTargetUrl: z2.string().nullable(),
|
|
929
|
+
placeholderId: z2.coerce.number().nullable(),
|
|
930
|
+
type: z2.string()
|
|
758
931
|
})
|
|
759
932
|
),
|
|
760
|
-
activePackages:
|
|
761
|
-
|
|
762
|
-
cancelledAt:
|
|
763
|
-
id:
|
|
764
|
-
installedAt:
|
|
765
|
-
isActive:
|
|
766
|
-
isBillable:
|
|
767
|
-
packageId:
|
|
768
|
-
packageName:
|
|
769
|
-
shortName:
|
|
770
|
-
trialDays:
|
|
771
|
-
uninstalledAt:
|
|
933
|
+
activePackages: z2.array(
|
|
934
|
+
z2.strictObject({
|
|
935
|
+
cancelledAt: z2.string().nullable(),
|
|
936
|
+
id: z2.number(),
|
|
937
|
+
installedAt: z2.string().nullable(),
|
|
938
|
+
isActive: z2.boolean(),
|
|
939
|
+
isBillable: z2.boolean(),
|
|
940
|
+
packageId: z2.number(),
|
|
941
|
+
packageName: z2.string(),
|
|
942
|
+
shortName: z2.string(),
|
|
943
|
+
trialDays: z2.number(),
|
|
944
|
+
uninstalledAt: z2.string().nullable()
|
|
772
945
|
})
|
|
773
946
|
),
|
|
774
|
-
apiKey:
|
|
775
|
-
billingVersion:
|
|
776
|
-
cacheKey:
|
|
777
|
-
carousel:
|
|
778
|
-
currency:
|
|
779
|
-
currencySymbol:
|
|
780
|
-
domain:
|
|
781
|
-
enabledJquery:
|
|
782
|
-
enabledPresentmentCurrencies:
|
|
783
|
-
hasSmartCollectionsEnabled:
|
|
784
|
-
hasSmartSearchEnabled:
|
|
785
|
-
id:
|
|
786
|
-
integrations:
|
|
787
|
-
|
|
947
|
+
apiKey: z2.string(),
|
|
948
|
+
billingVersion: z2.string(),
|
|
949
|
+
cacheKey: z2.coerce.number(),
|
|
950
|
+
carousel: z2.enum(["flickity", "splide"]),
|
|
951
|
+
currency: z2.string(),
|
|
952
|
+
currencySymbol: z2.string(),
|
|
953
|
+
domain: z2.string(),
|
|
954
|
+
enabledJquery: z2.boolean(),
|
|
955
|
+
enabledPresentmentCurrencies: z2.array(z2.string()),
|
|
956
|
+
hasSmartCollectionsEnabled: z2.boolean(),
|
|
957
|
+
hasSmartSearchEnabled: z2.boolean(),
|
|
958
|
+
id: z2.coerce.number(),
|
|
959
|
+
integrations: z2.record(
|
|
960
|
+
z2.enum([
|
|
788
961
|
"attentive",
|
|
789
962
|
"judgeme",
|
|
790
963
|
"junip",
|
|
@@ -797,56 +970,56 @@ var ShopConfig = z.strictObject({
|
|
|
797
970
|
"stamped",
|
|
798
971
|
"yotpo"
|
|
799
972
|
]),
|
|
800
|
-
|
|
973
|
+
z2.boolean()
|
|
801
974
|
),
|
|
802
|
-
markets:
|
|
803
|
-
enabled:
|
|
975
|
+
markets: z2.strictObject({
|
|
976
|
+
enabled: z2.boolean()
|
|
804
977
|
}),
|
|
805
|
-
moneyFormat:
|
|
806
|
-
myshopifyDomain:
|
|
807
|
-
primaryLocale:
|
|
808
|
-
productGroupsEnabled:
|
|
809
|
-
rechargeCustomDomain:
|
|
810
|
-
sellingPlansEnabled:
|
|
811
|
-
shopId:
|
|
812
|
-
shopifySellingPlansEnabled:
|
|
813
|
-
shopName:
|
|
814
|
-
storefrontAccessToken:
|
|
815
|
-
useRebuyIcons:
|
|
978
|
+
moneyFormat: z2.string(),
|
|
979
|
+
myshopifyDomain: z2.string(),
|
|
980
|
+
primaryLocale: z2.string(),
|
|
981
|
+
productGroupsEnabled: z2.enum(["no", "yes"]).transform((value) => value === "yes"),
|
|
982
|
+
rechargeCustomDomain: z2.string().nullable(),
|
|
983
|
+
sellingPlansEnabled: z2.boolean(),
|
|
984
|
+
shopId: z2.number(),
|
|
985
|
+
shopifySellingPlansEnabled: z2.boolean(),
|
|
986
|
+
shopName: z2.string(),
|
|
987
|
+
storefrontAccessToken: z2.string().nullable(),
|
|
988
|
+
useRebuyIcons: z2.boolean()
|
|
816
989
|
});
|
|
817
990
|
|
|
818
991
|
// src/schema/userConfig.ts
|
|
819
|
-
import { z as
|
|
820
|
-
var UserConfig =
|
|
992
|
+
import { z as z3 } from "zod/v4";
|
|
993
|
+
var UserConfig = z3.strictObject({
|
|
821
994
|
shop: ShopConfig,
|
|
822
|
-
smartCart:
|
|
823
|
-
smartFlows:
|
|
995
|
+
smartCart: z3.unknown(),
|
|
996
|
+
smartFlows: z3.array(z3.unknown())
|
|
824
997
|
});
|
|
825
998
|
|
|
826
999
|
// src/schema/widgetData.ts
|
|
827
|
-
import { z as
|
|
1000
|
+
import { z as z29 } from "zod/v4";
|
|
828
1001
|
|
|
829
1002
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
830
|
-
import { z as
|
|
831
|
-
var ABTestingPlaceholder =
|
|
832
|
-
type:
|
|
833
|
-
version:
|
|
1003
|
+
import { z as z4 } from "zod/v4";
|
|
1004
|
+
var ABTestingPlaceholder = z4.looseObject({
|
|
1005
|
+
type: z4.literal("placeholder"),
|
|
1006
|
+
version: z4.undefined()
|
|
834
1007
|
});
|
|
835
1008
|
|
|
836
1009
|
// src/schema/widgets/checkoutAndBeyond/constants.ts
|
|
837
1010
|
import { uniqBy } from "lodash-es";
|
|
838
|
-
import { z as
|
|
1011
|
+
import { z as z6 } from "zod/v4";
|
|
839
1012
|
|
|
840
1013
|
// src/schema/widgets/checkoutAndBeyond/common.ts
|
|
841
|
-
import { z as
|
|
1014
|
+
import { z as z5 } from "zod/v4";
|
|
842
1015
|
var borderRadii = ["none", "small", "base", "large", "fullyRounded"];
|
|
843
|
-
var borderRadius =
|
|
1016
|
+
var borderRadius = z5.enum(borderRadii);
|
|
844
1017
|
var BorderRadius = borderRadius.enum;
|
|
845
1018
|
var borderStyles = ["none", "base", "dotted", "dashed"];
|
|
846
|
-
var borderStyle =
|
|
1019
|
+
var borderStyle = z5.enum(borderStyles);
|
|
847
1020
|
var BorderStyle = borderStyle.enum;
|
|
848
1021
|
var borderWidths = ["base", "medium", "thick"];
|
|
849
|
-
var borderWidth =
|
|
1022
|
+
var borderWidth = z5.enum(borderWidths);
|
|
850
1023
|
var BorderWidth = borderWidth.enum;
|
|
851
1024
|
var buttonActions = [
|
|
852
1025
|
"addToOrder",
|
|
@@ -859,7 +1032,7 @@ var buttonActions = [
|
|
|
859
1032
|
"showVariants",
|
|
860
1033
|
"switchToSubscription"
|
|
861
1034
|
];
|
|
862
|
-
var buttonAction =
|
|
1035
|
+
var buttonAction = z5.enum(buttonActions);
|
|
863
1036
|
var ButtonAction = buttonAction.enum;
|
|
864
1037
|
var buttonFields = [
|
|
865
1038
|
"addedToCart",
|
|
@@ -880,13 +1053,13 @@ var buttonFields = [
|
|
|
880
1053
|
"switchToSubscriptionNoDiscount",
|
|
881
1054
|
"switchToSubscriptionWithDiscount"
|
|
882
1055
|
];
|
|
883
|
-
var buttonField =
|
|
1056
|
+
var buttonField = z5.enum(buttonFields);
|
|
884
1057
|
var ButtonField = buttonField.enum;
|
|
885
1058
|
var buttonStyles = ["primary", "secondary", "plain", "custom"];
|
|
886
|
-
var buttonStyle =
|
|
1059
|
+
var buttonStyle = z5.enum(buttonStyles);
|
|
887
1060
|
var ButtonStyle = buttonStyle.enum;
|
|
888
1061
|
var directions = ["columns", "rows"];
|
|
889
|
-
var direction =
|
|
1062
|
+
var direction = z5.enum(directions);
|
|
890
1063
|
var Direction = direction.enum;
|
|
891
1064
|
var editorModes = [
|
|
892
1065
|
"checkoutExtension",
|
|
@@ -896,10 +1069,10 @@ var editorModes = [
|
|
|
896
1069
|
"ordersIndexPage",
|
|
897
1070
|
"customerProfilePage"
|
|
898
1071
|
];
|
|
899
|
-
var editorMode =
|
|
1072
|
+
var editorMode = z5.enum(editorModes);
|
|
900
1073
|
var EditorMode = editorMode.enum;
|
|
901
1074
|
var horizontalAlignments = ["start", "center", "end"];
|
|
902
|
-
var horizontalAlignment =
|
|
1075
|
+
var horizontalAlignment = z5.enum(horizontalAlignments);
|
|
903
1076
|
var HorizontalAlignment = horizontalAlignment.enum;
|
|
904
1077
|
var languageKeys = [
|
|
905
1078
|
"ar",
|
|
@@ -929,13 +1102,13 @@ var languageKeys = [
|
|
|
929
1102
|
"vi",
|
|
930
1103
|
"zh"
|
|
931
1104
|
];
|
|
932
|
-
var languageKey =
|
|
1105
|
+
var languageKey = z5.enum(languageKeys);
|
|
933
1106
|
var LanguageKey = languageKey.enum;
|
|
934
1107
|
var objectFits = ["cover", "contain"];
|
|
935
|
-
var objectFit =
|
|
1108
|
+
var objectFit = z5.enum(objectFits);
|
|
936
1109
|
var ObjectFit = objectFit.enum;
|
|
937
1110
|
var quantityInputs = ["select", "number"];
|
|
938
|
-
var quantityInput =
|
|
1111
|
+
var quantityInput = z5.enum(quantityInputs);
|
|
939
1112
|
var QuantityInput = quantityInput.enum;
|
|
940
1113
|
var sectionTypes = [
|
|
941
1114
|
"button",
|
|
@@ -952,25 +1125,25 @@ var sectionTypes = [
|
|
|
952
1125
|
"text",
|
|
953
1126
|
"variants"
|
|
954
1127
|
];
|
|
955
|
-
var sectionType =
|
|
1128
|
+
var sectionType = z5.enum(sectionTypes);
|
|
956
1129
|
var SectionType = sectionType.enum;
|
|
957
1130
|
var spacings = ["none", "extraTight", "tight", "base", "loose", "extraLoose"];
|
|
958
|
-
var spacing =
|
|
1131
|
+
var spacing = z5.enum(spacings);
|
|
959
1132
|
var Spacing = spacing.enum;
|
|
960
1133
|
var textAlignments = ["start", "center", "end"];
|
|
961
|
-
var textAlignment =
|
|
1134
|
+
var textAlignment = z5.enum(textAlignments);
|
|
962
1135
|
var TextAlignment = textAlignment.enum;
|
|
963
1136
|
var textColorNames = ["base", "subdued", "accent", "decorative", "success", "warning", "critical"];
|
|
964
|
-
var textColorName =
|
|
1137
|
+
var textColorName = z5.enum(textColorNames);
|
|
965
1138
|
var TextColorName = textColorName.enum;
|
|
966
1139
|
var textSizeNames = ["extraSmall", "small", "base", "medium", "large", "extraLarge"];
|
|
967
|
-
var textSizeName =
|
|
1140
|
+
var textSizeName = z5.enum(textSizeNames);
|
|
968
1141
|
var TextSizeName = textSizeName.enum;
|
|
969
1142
|
var variantSelectors = ["menu", "button", "radio", "color", "image"];
|
|
970
|
-
var variantSelector =
|
|
1143
|
+
var variantSelector = z5.enum(variantSelectors);
|
|
971
1144
|
var VariantSelector = variantSelector.enum;
|
|
972
1145
|
var verticalAlignments = ["top", "middle", "bottom"];
|
|
973
|
-
var verticalAlignment =
|
|
1146
|
+
var verticalAlignment = z5.enum(verticalAlignments);
|
|
974
1147
|
var VerticalAlignment = verticalAlignment.enum;
|
|
975
1148
|
|
|
976
1149
|
// src/schema/widgets/checkoutAndBeyond/constants.ts
|
|
@@ -1046,26 +1219,26 @@ var widgetTypes = [
|
|
|
1046
1219
|
"ui_extension_line_item_editor",
|
|
1047
1220
|
"ui_extension_progress_bar"
|
|
1048
1221
|
];
|
|
1049
|
-
var widgetType =
|
|
1222
|
+
var widgetType = z6.enum(widgetTypes);
|
|
1050
1223
|
var WidgetType = widgetType.enum;
|
|
1051
1224
|
|
|
1052
1225
|
// src/schema/widgets/checkoutAndBeyond/root.ts
|
|
1053
|
-
import { z as
|
|
1226
|
+
import { z as z21 } from "zod/v4";
|
|
1054
1227
|
|
|
1055
1228
|
// src/schema/widgets/checkoutAndBeyond/layout.ts
|
|
1056
1229
|
import { v7 as uuidv712 } from "uuid";
|
|
1057
|
-
import { z as
|
|
1230
|
+
import { z as z20 } from "zod/v4";
|
|
1058
1231
|
|
|
1059
1232
|
// src/schema/widgets/checkoutAndBeyond/shared.ts
|
|
1060
|
-
import { z as
|
|
1233
|
+
import { z as z19 } from "zod/v4";
|
|
1061
1234
|
|
|
1062
1235
|
// src/schema/widgets/checkoutAndBeyond/button.ts
|
|
1063
1236
|
import { v7 as uuidv73 } from "uuid";
|
|
1064
|
-
import { z as
|
|
1237
|
+
import { z as z9 } from "zod/v4";
|
|
1065
1238
|
|
|
1066
1239
|
// src/schema/widgets/checkoutAndBeyond/image.ts
|
|
1067
1240
|
import { v7 as uuidv7 } from "uuid";
|
|
1068
|
-
import { z as
|
|
1241
|
+
import { z as z7 } from "zod/v4";
|
|
1069
1242
|
|
|
1070
1243
|
// src/schema/widgets/checkoutAndBeyond/regex.ts
|
|
1071
1244
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
@@ -1112,77 +1285,77 @@ var convertNumericObjects = (input) => {
|
|
|
1112
1285
|
};
|
|
1113
1286
|
|
|
1114
1287
|
// src/schema/widgets/checkoutAndBeyond/image.ts
|
|
1115
|
-
var CABImageSection =
|
|
1116
|
-
altText:
|
|
1117
|
-
aspectRatio:
|
|
1118
|
-
border:
|
|
1119
|
-
buttonField:
|
|
1120
|
-
category:
|
|
1121
|
-
name:
|
|
1122
|
-
naturalHeight:
|
|
1123
|
-
naturalWidth:
|
|
1124
|
-
objectFit:
|
|
1125
|
-
sectionId:
|
|
1126
|
-
sectionType:
|
|
1127
|
-
source:
|
|
1128
|
-
width:
|
|
1288
|
+
var CABImageSection = z7.object({
|
|
1289
|
+
altText: z7.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1290
|
+
aspectRatio: z7.literal(1).nullable().default(null),
|
|
1291
|
+
border: z7.lazy(() => CABBorder),
|
|
1292
|
+
buttonField: z7.enum(buttonFields).optional(),
|
|
1293
|
+
category: z7.enum(["gallery", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
1294
|
+
name: z7.string().optional(),
|
|
1295
|
+
naturalHeight: z7.number().default(0),
|
|
1296
|
+
naturalWidth: z7.number().default(0),
|
|
1297
|
+
objectFit: z7.enum(objectFits).default(ObjectFit.cover),
|
|
1298
|
+
sectionId: z7.uuid().default(() => uuidv7()),
|
|
1299
|
+
sectionType: z7.literal(SectionType.image).default(SectionType.image),
|
|
1300
|
+
source: z7.union([z7.url(), z7.literal(""), z7.string().regex(DYNAMIC_TOKEN_REGEX)]).default(""),
|
|
1301
|
+
width: z7.number().default(100)
|
|
1129
1302
|
});
|
|
1130
1303
|
|
|
1131
1304
|
// src/schema/widgets/checkoutAndBeyond/text.ts
|
|
1132
1305
|
import { forEach, isString as isString2 } from "lodash-es";
|
|
1133
1306
|
import { v7 as uuidv72 } from "uuid";
|
|
1134
|
-
import { z as
|
|
1135
|
-
var enumOrOmit = (...vals) =>
|
|
1136
|
-
var TiptapText =
|
|
1137
|
-
marks:
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
attrs:
|
|
1144
|
-
class:
|
|
1145
|
-
href:
|
|
1146
|
-
rel:
|
|
1147
|
-
target:
|
|
1307
|
+
import { z as z8 } from "zod/v4";
|
|
1308
|
+
var enumOrOmit = (...vals) => z8.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1309
|
+
var TiptapText = z8.object({
|
|
1310
|
+
marks: z8.union([
|
|
1311
|
+
z8.array(
|
|
1312
|
+
z8.discriminatedUnion("type", [
|
|
1313
|
+
z8.object({ type: z8.literal("bold") }),
|
|
1314
|
+
z8.object({ type: z8.literal("italic") }),
|
|
1315
|
+
z8.object({
|
|
1316
|
+
attrs: z8.object({
|
|
1317
|
+
class: z8.string().nullable(),
|
|
1318
|
+
href: z8.union([z8.url(), z8.string().regex(DYNAMIC_TOKEN_REGEX)]),
|
|
1319
|
+
rel: z8.string().default("noopener noreferrer nofollow"),
|
|
1320
|
+
target: z8.string().default("_blank")
|
|
1148
1321
|
}),
|
|
1149
|
-
type:
|
|
1322
|
+
type: z8.literal("link")
|
|
1150
1323
|
}),
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
attrs:
|
|
1324
|
+
z8.object({ type: z8.literal("strike") }),
|
|
1325
|
+
z8.object({
|
|
1326
|
+
attrs: z8.object({
|
|
1154
1327
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
1155
1328
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
1156
1329
|
}),
|
|
1157
|
-
type:
|
|
1330
|
+
type: z8.literal("textStyle")
|
|
1158
1331
|
})
|
|
1159
1332
|
])
|
|
1160
1333
|
),
|
|
1161
|
-
|
|
1334
|
+
z8.strictObject({}).transform(() => [])
|
|
1162
1335
|
]).optional(),
|
|
1163
|
-
text:
|
|
1164
|
-
type:
|
|
1336
|
+
text: z8.string().default(""),
|
|
1337
|
+
type: z8.literal("text").default("text")
|
|
1165
1338
|
});
|
|
1166
|
-
var TiptapParagraph =
|
|
1167
|
-
attrs:
|
|
1339
|
+
var TiptapParagraph = z8.object({
|
|
1340
|
+
attrs: z8.object({
|
|
1168
1341
|
textAlign: enumOrOmit(...textAlignments)
|
|
1169
1342
|
}).default({ textAlign: TextAlignment.start }),
|
|
1170
|
-
content:
|
|
1171
|
-
type:
|
|
1343
|
+
content: z8.union([z8.array(TiptapText), z8.strictObject({}).transform(() => [])]).default(() => []),
|
|
1344
|
+
type: z8.literal("paragraph").default("paragraph")
|
|
1172
1345
|
});
|
|
1173
|
-
var TiptapDocument =
|
|
1174
|
-
attrs:
|
|
1346
|
+
var TiptapDocument = z8.object({
|
|
1347
|
+
attrs: z8.object({
|
|
1175
1348
|
blockSpacing: enumOrOmit(...spacings)
|
|
1176
1349
|
}).default({ blockSpacing: Spacing.base }),
|
|
1177
|
-
content:
|
|
1178
|
-
type:
|
|
1350
|
+
content: z8.union([z8.array(TiptapParagraph), z8.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
1351
|
+
type: z8.literal("doc").default("doc")
|
|
1179
1352
|
});
|
|
1180
|
-
var CABTextSection =
|
|
1181
|
-
buttonField:
|
|
1182
|
-
content:
|
|
1183
|
-
name:
|
|
1184
|
-
sectionId:
|
|
1185
|
-
sectionType:
|
|
1353
|
+
var CABTextSection = z8.object({
|
|
1354
|
+
buttonField: z8.enum(buttonFields).optional(),
|
|
1355
|
+
content: z8.record(z8.string(), z8.union([z8.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
1356
|
+
name: z8.string().optional(),
|
|
1357
|
+
sectionId: z8.uuid().default(() => uuidv72()),
|
|
1358
|
+
sectionType: z8.literal(SectionType.text).default(SectionType.text)
|
|
1186
1359
|
}).superRefine(({ buttonField: buttonField2, content }, ctx) => {
|
|
1187
1360
|
if (buttonField2 === ButtonField.destinationUrl && content) {
|
|
1188
1361
|
forEach(content, (value, lang) => {
|
|
@@ -1203,99 +1376,99 @@ var CABTextSection = z7.object({
|
|
|
1203
1376
|
});
|
|
1204
1377
|
|
|
1205
1378
|
// src/schema/widgets/checkoutAndBeyond/button.ts
|
|
1206
|
-
var CABButtonContent =
|
|
1207
|
-
var CABButtonSection =
|
|
1208
|
-
action:
|
|
1209
|
-
buttonStyle:
|
|
1210
|
-
custom:
|
|
1211
|
-
color:
|
|
1212
|
-
height:
|
|
1213
|
-
width:
|
|
1379
|
+
var CABButtonContent = z9.lazy(() => z9.discriminatedUnion("sectionType", [CABImageSection, CABTextSection]));
|
|
1380
|
+
var CABButtonSection = z9.object({
|
|
1381
|
+
action: z9.union([z9.literal(""), z9.enum(buttonActions)]).default(""),
|
|
1382
|
+
buttonStyle: z9.enum(buttonStyles).default(ButtonStyle.primary),
|
|
1383
|
+
custom: z9.object({
|
|
1384
|
+
color: z9.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
1385
|
+
height: z9.number().default(52),
|
|
1386
|
+
width: z9.number().default(300)
|
|
1214
1387
|
}).default({
|
|
1215
1388
|
color: "#005bd3",
|
|
1216
1389
|
height: 52,
|
|
1217
1390
|
width: 300
|
|
1218
1391
|
}),
|
|
1219
|
-
name:
|
|
1220
|
-
sectionId:
|
|
1221
|
-
sections:
|
|
1222
|
-
sectionType:
|
|
1392
|
+
name: z9.string().optional(),
|
|
1393
|
+
sectionId: z9.uuid().default(() => uuidv73()),
|
|
1394
|
+
sections: z9.union([z9.array(CABButtonContent), z9.strictObject({}).transform(() => [])]).default(() => []),
|
|
1395
|
+
sectionType: z9.literal(SectionType.button).default(SectionType.button)
|
|
1223
1396
|
});
|
|
1224
1397
|
|
|
1225
1398
|
// src/schema/widgets/checkoutAndBeyond/dataSource.ts
|
|
1226
1399
|
import { v7 as uuidv74 } from "uuid";
|
|
1227
|
-
import { z as
|
|
1228
|
-
var CABDataSourceSection =
|
|
1229
|
-
dataSourceId:
|
|
1230
|
-
dataSourcePath:
|
|
1231
|
-
limit:
|
|
1232
|
-
name:
|
|
1233
|
-
sectionId:
|
|
1234
|
-
sectionType:
|
|
1400
|
+
import { z as z10 } from "zod/v4";
|
|
1401
|
+
var CABDataSourceSection = z10.object({
|
|
1402
|
+
dataSourceId: z10.number().nullable().default(null),
|
|
1403
|
+
dataSourcePath: z10.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
1404
|
+
limit: z10.number().default(1),
|
|
1405
|
+
name: z10.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
1406
|
+
sectionId: z10.uuid().default(() => uuidv74()),
|
|
1407
|
+
sectionType: z10.literal(SectionType.dataSource).default(SectionType.dataSource)
|
|
1235
1408
|
});
|
|
1236
1409
|
|
|
1237
1410
|
// src/schema/widgets/checkoutAndBeyond/offers.ts
|
|
1238
|
-
import { z as
|
|
1411
|
+
import { z as z13 } from "zod/v4";
|
|
1239
1412
|
|
|
1240
1413
|
// src/schema/widgets/checkoutAndBeyond/products.ts
|
|
1241
1414
|
import { v7 as uuidv76 } from "uuid";
|
|
1242
|
-
import { z as
|
|
1415
|
+
import { z as z12 } from "zod/v4";
|
|
1243
1416
|
|
|
1244
1417
|
// src/schema/widgets/checkoutAndBeyond/product.ts
|
|
1245
1418
|
import { v7 as uuidv75 } from "uuid";
|
|
1246
|
-
import { z as
|
|
1247
|
-
var CABProductSection =
|
|
1248
|
-
name:
|
|
1249
|
-
options:
|
|
1250
|
-
|
|
1419
|
+
import { z as z11 } from "zod/v4";
|
|
1420
|
+
var CABProductSection = z11.object({
|
|
1421
|
+
name: z11.string().optional(),
|
|
1422
|
+
options: z11.array(
|
|
1423
|
+
z11.object({
|
|
1251
1424
|
/** `name` represents `Color`, `Size`, etc. */
|
|
1252
|
-
name:
|
|
1253
|
-
optionId:
|
|
1254
|
-
selector:
|
|
1255
|
-
values:
|
|
1256
|
-
|
|
1257
|
-
color:
|
|
1258
|
-
image:
|
|
1425
|
+
name: z11.string(),
|
|
1426
|
+
optionId: z11.number(),
|
|
1427
|
+
selector: z11.enum(variantSelectors).default(VariantSelector.menu),
|
|
1428
|
+
values: z11.array(
|
|
1429
|
+
z11.object({
|
|
1430
|
+
color: z11.string().optional(),
|
|
1431
|
+
image: z11.lazy(() => CABImageSection).optional(),
|
|
1259
1432
|
/** `name` represents `Red`, `Blue`, etc. */
|
|
1260
|
-
name:
|
|
1261
|
-
text:
|
|
1433
|
+
name: z11.string(),
|
|
1434
|
+
text: z11.lazy(() => CABTextSection).optional()
|
|
1262
1435
|
})
|
|
1263
1436
|
)
|
|
1264
1437
|
})
|
|
1265
1438
|
).default(() => []),
|
|
1266
|
-
productId:
|
|
1267
|
-
sectionId:
|
|
1268
|
-
sectionType:
|
|
1439
|
+
productId: z11.number().nullable().default(null),
|
|
1440
|
+
sectionId: z11.uuid().default(() => uuidv75()),
|
|
1441
|
+
sectionType: z11.literal(SectionType.product).default(SectionType.product)
|
|
1269
1442
|
});
|
|
1270
1443
|
|
|
1271
1444
|
// src/schema/widgets/checkoutAndBeyond/products.ts
|
|
1272
|
-
var CABProductsSection =
|
|
1273
|
-
name:
|
|
1274
|
-
sectionId:
|
|
1275
|
-
sections:
|
|
1276
|
-
sectionType:
|
|
1445
|
+
var CABProductsSection = z12.object({
|
|
1446
|
+
name: z12.string().optional(),
|
|
1447
|
+
sectionId: z12.uuid().default(() => uuidv76()),
|
|
1448
|
+
sections: z12.union([z12.array(z12.lazy(() => CABProductSection)), z12.strictObject({}).transform(() => [])]).default(() => []),
|
|
1449
|
+
sectionType: z12.literal(SectionType.products).default(SectionType.products)
|
|
1277
1450
|
});
|
|
1278
1451
|
|
|
1279
1452
|
// src/schema/widgets/checkoutAndBeyond/offers.ts
|
|
1280
|
-
var CABOffersSection =
|
|
1453
|
+
var CABOffersSection = z13.lazy(
|
|
1281
1454
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend(
|
|
1282
|
-
|
|
1283
|
-
sections:
|
|
1284
|
-
sectionType:
|
|
1455
|
+
z13.object({
|
|
1456
|
+
sections: z13.union([z13.array(z13.lazy(() => CABSection)), z13.strictObject({}).transform(() => [])]).default(() => [CABDataSourceSection.parse({}), CABProductsSection.parse({})]),
|
|
1457
|
+
sectionType: z13.literal(SectionType.offers).default(SectionType.offers)
|
|
1285
1458
|
}).shape
|
|
1286
1459
|
)
|
|
1287
1460
|
);
|
|
1288
1461
|
|
|
1289
1462
|
// src/schema/widgets/checkoutAndBeyond/quantity.ts
|
|
1290
1463
|
import { v7 as uuidv77 } from "uuid";
|
|
1291
|
-
import { z as
|
|
1292
|
-
var CABQuantitySection =
|
|
1293
|
-
errorMessages:
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
max:
|
|
1297
|
-
min:
|
|
1298
|
-
neg:
|
|
1464
|
+
import { z as z14 } from "zod/v4";
|
|
1465
|
+
var CABQuantitySection = z14.object({
|
|
1466
|
+
errorMessages: z14.record(
|
|
1467
|
+
z14.string(),
|
|
1468
|
+
z14.object({
|
|
1469
|
+
max: z14.string().optional(),
|
|
1470
|
+
min: z14.string().optional(),
|
|
1471
|
+
neg: z14.string().optional()
|
|
1299
1472
|
})
|
|
1300
1473
|
).default({
|
|
1301
1474
|
en: {
|
|
@@ -1304,64 +1477,64 @@ var CABQuantitySection = z13.object({
|
|
|
1304
1477
|
neg: "Quantity cannot be negative"
|
|
1305
1478
|
}
|
|
1306
1479
|
}),
|
|
1307
|
-
inputType:
|
|
1308
|
-
max:
|
|
1309
|
-
min:
|
|
1310
|
-
name:
|
|
1311
|
-
sectionId:
|
|
1312
|
-
sectionType:
|
|
1480
|
+
inputType: z14.enum(quantityInputs).default(QuantityInput.select),
|
|
1481
|
+
max: z14.number().min(1).max(100).default(10),
|
|
1482
|
+
min: z14.number().min(1).default(1),
|
|
1483
|
+
name: z14.string().optional(),
|
|
1484
|
+
sectionId: z14.uuid().default(() => uuidv77()),
|
|
1485
|
+
sectionType: z14.literal(SectionType.quantity).default(SectionType.quantity)
|
|
1313
1486
|
});
|
|
1314
1487
|
|
|
1315
1488
|
// src/schema/widgets/checkoutAndBeyond/reviews.ts
|
|
1316
1489
|
import { v7 as uuidv78 } from "uuid";
|
|
1317
|
-
import { z as
|
|
1318
|
-
var CABReviewsSection =
|
|
1319
|
-
name:
|
|
1320
|
-
sectionId:
|
|
1321
|
-
sectionType:
|
|
1490
|
+
import { z as z15 } from "zod/v4";
|
|
1491
|
+
var CABReviewsSection = z15.object({
|
|
1492
|
+
name: z15.string().optional(),
|
|
1493
|
+
sectionId: z15.uuid().default(() => uuidv78()),
|
|
1494
|
+
sectionType: z15.literal(SectionType.reviews).default(SectionType.reviews)
|
|
1322
1495
|
});
|
|
1323
1496
|
|
|
1324
1497
|
// src/schema/widgets/checkoutAndBeyond/subscription.ts
|
|
1325
1498
|
import { v7 as uuidv79 } from "uuid";
|
|
1326
|
-
import { z as
|
|
1327
|
-
var CABSubscriptionSection =
|
|
1328
|
-
name:
|
|
1329
|
-
sectionId:
|
|
1330
|
-
sectionType:
|
|
1499
|
+
import { z as z16 } from "zod/v4";
|
|
1500
|
+
var CABSubscriptionSection = z16.object({
|
|
1501
|
+
name: z16.string().optional(),
|
|
1502
|
+
sectionId: z16.uuid().default(() => uuidv79()),
|
|
1503
|
+
sectionType: z16.literal(SectionType.subscription).default(SectionType.subscription)
|
|
1331
1504
|
});
|
|
1332
1505
|
|
|
1333
1506
|
// src/schema/widgets/checkoutAndBeyond/table.ts
|
|
1334
1507
|
import { v7 as uuidv710 } from "uuid";
|
|
1335
|
-
import { z as
|
|
1336
|
-
var CABTableSection =
|
|
1337
|
-
name:
|
|
1338
|
-
sectionId:
|
|
1339
|
-
sectionType:
|
|
1508
|
+
import { z as z17 } from "zod/v4";
|
|
1509
|
+
var CABTableSection = z17.object({
|
|
1510
|
+
name: z17.string().optional(),
|
|
1511
|
+
sectionId: z17.uuid().default(() => uuidv710()),
|
|
1512
|
+
sectionType: z17.literal(SectionType.table).default(SectionType.table)
|
|
1340
1513
|
});
|
|
1341
1514
|
|
|
1342
1515
|
// src/schema/widgets/checkoutAndBeyond/variants.ts
|
|
1343
1516
|
import { slice } from "lodash-es";
|
|
1344
1517
|
import { v7 as uuidv711 } from "uuid";
|
|
1345
|
-
import { z as
|
|
1346
|
-
var CABVariantsSection =
|
|
1347
|
-
name:
|
|
1348
|
-
sectionId:
|
|
1349
|
-
sectionType:
|
|
1350
|
-
selector:
|
|
1518
|
+
import { z as z18 } from "zod/v4";
|
|
1519
|
+
var CABVariantsSection = z18.object({
|
|
1520
|
+
name: z18.string().optional(),
|
|
1521
|
+
sectionId: z18.uuid().default(() => uuidv711()),
|
|
1522
|
+
sectionType: z18.literal(SectionType.variants).default(SectionType.variants),
|
|
1523
|
+
selector: z18.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu)
|
|
1351
1524
|
});
|
|
1352
1525
|
|
|
1353
1526
|
// src/schema/widgets/checkoutAndBeyond/shared.ts
|
|
1354
|
-
var CABBorder =
|
|
1355
|
-
radius:
|
|
1356
|
-
style:
|
|
1357
|
-
width:
|
|
1527
|
+
var CABBorder = z19.object({
|
|
1528
|
+
radius: z19.enum(borderRadii).default(BorderRadius.base),
|
|
1529
|
+
style: z19.enum(borderStyles).default(BorderStyle.none),
|
|
1530
|
+
width: z19.enum(borderWidths).default(BorderWidth.base)
|
|
1358
1531
|
}).default({
|
|
1359
1532
|
radius: BorderRadius.base,
|
|
1360
1533
|
style: BorderStyle.none,
|
|
1361
1534
|
width: BorderWidth.base
|
|
1362
1535
|
});
|
|
1363
|
-
var CABSection =
|
|
1364
|
-
() =>
|
|
1536
|
+
var CABSection = z19.lazy(
|
|
1537
|
+
() => z19.discriminatedUnion("sectionType", [
|
|
1365
1538
|
CABButtonSection,
|
|
1366
1539
|
CABDataSourceSection,
|
|
1367
1540
|
CABImageSection,
|
|
@@ -1379,117 +1552,117 @@ var CABSection = z18.lazy(
|
|
|
1379
1552
|
);
|
|
1380
1553
|
|
|
1381
1554
|
// src/schema/widgets/checkoutAndBeyond/layout.ts
|
|
1382
|
-
var CABLayoutSection =
|
|
1383
|
-
alignment:
|
|
1384
|
-
horizontal:
|
|
1385
|
-
vertical:
|
|
1555
|
+
var CABLayoutSection = z20.object({
|
|
1556
|
+
alignment: z20.object({
|
|
1557
|
+
horizontal: z20.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
1558
|
+
vertical: z20.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
1386
1559
|
}).default({
|
|
1387
1560
|
horizontal: HorizontalAlignment.start,
|
|
1388
1561
|
vertical: VerticalAlignment.top
|
|
1389
1562
|
}),
|
|
1390
|
-
border:
|
|
1391
|
-
direction:
|
|
1392
|
-
name:
|
|
1393
|
-
padding:
|
|
1394
|
-
sectionId:
|
|
1395
|
-
sections:
|
|
1396
|
-
sectionType:
|
|
1397
|
-
spacing:
|
|
1398
|
-
width:
|
|
1563
|
+
border: z20.lazy(() => CABBorder),
|
|
1564
|
+
direction: z20.enum(directions).default(Direction.rows),
|
|
1565
|
+
name: z20.string().optional(),
|
|
1566
|
+
padding: z20.enum(spacings).default(Spacing.none),
|
|
1567
|
+
sectionId: z20.uuid().default(() => uuidv712()),
|
|
1568
|
+
sections: z20.union([z20.array(z20.lazy(() => CABSection)), z20.strictObject({}).transform(() => [])]).default(() => []),
|
|
1569
|
+
sectionType: z20.literal(SectionType.layout).default(SectionType.layout),
|
|
1570
|
+
spacing: z20.enum(spacings).default(Spacing.base),
|
|
1571
|
+
width: z20.number().default(100)
|
|
1399
1572
|
});
|
|
1400
1573
|
|
|
1401
1574
|
// src/schema/widgets/checkoutAndBeyond/root.ts
|
|
1402
|
-
var TargetArea =
|
|
1403
|
-
fill:
|
|
1404
|
-
flip:
|
|
1405
|
-
icon:
|
|
1406
|
-
label:
|
|
1407
|
-
width:
|
|
1575
|
+
var TargetArea = z21.object({
|
|
1576
|
+
fill: z21.boolean().optional(),
|
|
1577
|
+
flip: z21.enum(["both", "horizontal", "vertical"]).optional(),
|
|
1578
|
+
icon: z21.string(),
|
|
1579
|
+
label: z21.string(),
|
|
1580
|
+
width: z21.string()
|
|
1408
1581
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
1409
1582
|
var CABRootSection = CABLayoutSection.extend(
|
|
1410
|
-
|
|
1411
|
-
editorMode:
|
|
1412
|
-
previewMode:
|
|
1413
|
-
storeId:
|
|
1583
|
+
z21.object({
|
|
1584
|
+
editorMode: z21.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
1585
|
+
previewMode: z21.boolean().default(false),
|
|
1586
|
+
storeId: z21.number().nullable().default(null),
|
|
1414
1587
|
targetArea: TargetArea.nullable(),
|
|
1415
|
-
type:
|
|
1416
|
-
version:
|
|
1417
|
-
widgetId:
|
|
1588
|
+
type: z21.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
1589
|
+
version: z21.literal(2).default(2),
|
|
1590
|
+
widgetId: z21.number().nullable().default(null)
|
|
1418
1591
|
}).shape
|
|
1419
1592
|
);
|
|
1420
1593
|
|
|
1421
1594
|
// src/schema/widgets/checkoutExtension.ts
|
|
1422
|
-
import { z as
|
|
1423
|
-
var CheckoutExtension =
|
|
1424
|
-
type:
|
|
1425
|
-
version:
|
|
1595
|
+
import { z as z22 } from "zod/v4";
|
|
1596
|
+
var CheckoutExtension = z22.looseObject({
|
|
1597
|
+
type: z22.literal(WidgetType.shopify_checkout_extension).default(WidgetType.shopify_checkout_extension),
|
|
1598
|
+
version: z22.undefined()
|
|
1426
1599
|
});
|
|
1427
1600
|
|
|
1428
1601
|
// src/schema/widgets/contentBlock.ts
|
|
1429
|
-
import { z as
|
|
1430
|
-
var ContentBlock =
|
|
1431
|
-
blockSpacing:
|
|
1432
|
-
imageBlocks:
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
altText:
|
|
1436
|
-
description:
|
|
1437
|
-
id:
|
|
1438
|
-
imagePlacement:
|
|
1439
|
-
imageSize:
|
|
1440
|
-
imageUrl:
|
|
1441
|
-
textAlignment:
|
|
1442
|
-
textSize:
|
|
1602
|
+
import { z as z23 } from "zod/v4";
|
|
1603
|
+
var ContentBlock = z23.object({
|
|
1604
|
+
blockSpacing: z23.enum(spacings),
|
|
1605
|
+
imageBlocks: z23.union([
|
|
1606
|
+
z23.array(
|
|
1607
|
+
z23.object({
|
|
1608
|
+
altText: z23.string().nullable(),
|
|
1609
|
+
description: z23.string().nullable(),
|
|
1610
|
+
id: z23.uuid(),
|
|
1611
|
+
imagePlacement: z23.enum(["top", "right", "bottom", "left"]),
|
|
1612
|
+
imageSize: z23.number(),
|
|
1613
|
+
imageUrl: z23.url(),
|
|
1614
|
+
textAlignment: z23.enum(["left", "center", "right"]),
|
|
1615
|
+
textSize: z23.enum(textSizeNames)
|
|
1443
1616
|
})
|
|
1444
1617
|
),
|
|
1445
|
-
|
|
1618
|
+
z23.strictObject({}).transform(() => [])
|
|
1446
1619
|
]),
|
|
1447
|
-
imageLayout:
|
|
1448
|
-
language:
|
|
1449
|
-
description:
|
|
1450
|
-
superTitle:
|
|
1451
|
-
title:
|
|
1620
|
+
imageLayout: z23.enum(["row", "column"]),
|
|
1621
|
+
language: z23.object({
|
|
1622
|
+
description: z23.string(),
|
|
1623
|
+
superTitle: z23.string(),
|
|
1624
|
+
title: z23.string()
|
|
1452
1625
|
}),
|
|
1453
|
-
previewMode:
|
|
1454
|
-
type:
|
|
1455
|
-
version:
|
|
1626
|
+
previewMode: z23.boolean(),
|
|
1627
|
+
type: z23.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
1628
|
+
version: z23.literal(1)
|
|
1456
1629
|
});
|
|
1457
1630
|
|
|
1458
1631
|
// src/schema/widgets/giftWithPurchase.ts
|
|
1459
|
-
import { z as z23 } from "zod/v4";
|
|
1460
|
-
var GiftWithPurchase = z23.looseObject({
|
|
1461
|
-
type: z23.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase),
|
|
1462
|
-
version: z23.undefined()
|
|
1463
|
-
});
|
|
1464
|
-
|
|
1465
|
-
// src/schema/widgets/lineItemEditor.ts
|
|
1466
1632
|
import { z as z24 } from "zod/v4";
|
|
1467
|
-
var
|
|
1468
|
-
type: z24.literal(WidgetType.
|
|
1469
|
-
version: z24.
|
|
1633
|
+
var GiftWithPurchase = z24.looseObject({
|
|
1634
|
+
type: z24.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase),
|
|
1635
|
+
version: z24.undefined()
|
|
1470
1636
|
});
|
|
1471
1637
|
|
|
1472
|
-
// src/schema/widgets/
|
|
1638
|
+
// src/schema/widgets/lineItemEditor.ts
|
|
1473
1639
|
import { z as z25 } from "zod/v4";
|
|
1474
|
-
var
|
|
1475
|
-
type: z25.literal(WidgetType.
|
|
1640
|
+
var LineItemEditor = z25.looseObject({
|
|
1641
|
+
type: z25.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
1476
1642
|
version: z25.literal(1)
|
|
1477
1643
|
});
|
|
1478
1644
|
|
|
1479
|
-
// src/schema/widgets/
|
|
1645
|
+
// src/schema/widgets/progressBar.ts
|
|
1480
1646
|
import { z as z26 } from "zod/v4";
|
|
1481
|
-
var
|
|
1482
|
-
type: z26.literal(WidgetType.
|
|
1647
|
+
var ProgressBar = z26.looseObject({
|
|
1648
|
+
type: z26.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar),
|
|
1483
1649
|
version: z26.literal(1)
|
|
1484
1650
|
});
|
|
1485
1651
|
|
|
1486
|
-
// src/schema/widgets/
|
|
1652
|
+
// src/schema/widgets/rebuyButton.ts
|
|
1487
1653
|
import { z as z27 } from "zod/v4";
|
|
1488
|
-
var
|
|
1489
|
-
type: z27.literal(WidgetType.
|
|
1654
|
+
var RebuyButton = z27.looseObject({
|
|
1655
|
+
type: z27.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
1490
1656
|
version: z27.literal(1)
|
|
1491
1657
|
});
|
|
1492
1658
|
|
|
1659
|
+
// src/schema/widgets/rebuyMonetize.ts
|
|
1660
|
+
import { z as z28 } from "zod/v4";
|
|
1661
|
+
var RebuyMonetize = z28.looseObject({
|
|
1662
|
+
type: z28.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
1663
|
+
version: z28.literal(1)
|
|
1664
|
+
});
|
|
1665
|
+
|
|
1493
1666
|
// src/schema/widgetData.ts
|
|
1494
1667
|
var extensionWidgetTypes = [
|
|
1495
1668
|
"placeholder",
|
|
@@ -1501,15 +1674,15 @@ var extensionWidgetTypes = [
|
|
|
1501
1674
|
WidgetType.ui_extension_line_item_editor,
|
|
1502
1675
|
WidgetType.ui_extension_progress_bar
|
|
1503
1676
|
];
|
|
1504
|
-
var LegacyV0Widget =
|
|
1505
|
-
var LegacyV1Widget =
|
|
1677
|
+
var LegacyV0Widget = z29.discriminatedUnion("type", [ABTestingPlaceholder, CheckoutExtension, GiftWithPurchase]);
|
|
1678
|
+
var LegacyV1Widget = z29.discriminatedUnion("type", [
|
|
1506
1679
|
ContentBlock,
|
|
1507
1680
|
LineItemEditor,
|
|
1508
1681
|
ProgressBar,
|
|
1509
1682
|
RebuyButton,
|
|
1510
1683
|
RebuyMonetize
|
|
1511
1684
|
]);
|
|
1512
|
-
var WidgetData =
|
|
1685
|
+
var WidgetData = z29.discriminatedUnion("version", [LegacyV0Widget, LegacyV1Widget, CABRootSection]);
|
|
1513
1686
|
export {
|
|
1514
1687
|
ABTestingPlaceholder,
|
|
1515
1688
|
ARRAY_INDEX_STRING,
|
|
@@ -1584,6 +1757,7 @@ export {
|
|
|
1584
1757
|
buttonActions,
|
|
1585
1758
|
buttonFields,
|
|
1586
1759
|
buttonStyles,
|
|
1760
|
+
cacheInfoSchema,
|
|
1587
1761
|
checkForHTML,
|
|
1588
1762
|
convertNumericObjects,
|
|
1589
1763
|
convertProductToStorefrontFormat,
|
|
@@ -1620,10 +1794,12 @@ export {
|
|
|
1620
1794
|
languageKeys,
|
|
1621
1795
|
objectFits,
|
|
1622
1796
|
productImageObject,
|
|
1797
|
+
productSchema,
|
|
1623
1798
|
quantityInputs,
|
|
1624
1799
|
queryStringToObject,
|
|
1625
1800
|
sectionTypes,
|
|
1626
1801
|
selectedVariantOptions,
|
|
1802
|
+
sellingPlanGroupSchema,
|
|
1627
1803
|
serialize,
|
|
1628
1804
|
sessionId,
|
|
1629
1805
|
set,
|