@wix/auto_sdk_stores_customizations-v-3 1.0.78 → 1.0.79
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/build/cjs/index.d.ts +30 -10
- package/build/cjs/index.js +1615 -39
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +1587 -11
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/schemas.d.ts +1 -1
- package/build/es/index.d.mts +30 -10
- package/build/es/index.mjs +1605 -39
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +1577 -11
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/schemas.d.mts +1 -1
- package/build/internal/cjs/index.d.ts +36 -12
- package/build/internal/cjs/index.js +1615 -39
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +7 -1
- package/build/internal/cjs/index.typings.js +1587 -11
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +1 -1
- package/build/internal/es/index.d.mts +36 -12
- package/build/internal/es/index.mjs +1605 -39
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +7 -1
- package/build/internal/es/index.typings.mjs +1577 -11
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// index.typings.ts
|
|
@@ -882,6 +892,1523 @@ function bulkUpdateCustomizations(payload) {
|
|
|
882
892
|
var import_image = require("@wix/sdk-runtime/transformations/image");
|
|
883
893
|
var import_image2 = require("@wix/sdk-runtime/transformations/image");
|
|
884
894
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
895
|
+
|
|
896
|
+
// src/stores-catalog-v3-customization-customizations-v-3.schemas.ts
|
|
897
|
+
var z = __toESM(require("zod"));
|
|
898
|
+
var CreateCustomizationRequest = z.object({
|
|
899
|
+
customization: z.intersection(
|
|
900
|
+
z.object({
|
|
901
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
902
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
903
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
904
|
+
).optional().nullable(),
|
|
905
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
906
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
907
|
+
key: z.string().describe(
|
|
908
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
909
|
+
).min(1).max(50).optional().nullable(),
|
|
910
|
+
name: z.string().describe(
|
|
911
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
912
|
+
).min(1).max(50),
|
|
913
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]),
|
|
914
|
+
customizationRenderType: z.enum([
|
|
915
|
+
"FREE_TEXT",
|
|
916
|
+
"TEXT_CHOICES",
|
|
917
|
+
"SWATCH_CHOICES"
|
|
918
|
+
]),
|
|
919
|
+
assignedProductsCount: z.number().int().describe(
|
|
920
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
921
|
+
).optional().nullable()
|
|
922
|
+
}),
|
|
923
|
+
z.xor([
|
|
924
|
+
z.object({
|
|
925
|
+
choicesSettings: z.never().optional(),
|
|
926
|
+
freeTextInput: z.object({
|
|
927
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
928
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
929
|
+
defaultAddedPrice: z.string().describe(
|
|
930
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
931
|
+
).optional().nullable(),
|
|
932
|
+
title: z.string().describe(
|
|
933
|
+
"Title to display to customer for their free-text input."
|
|
934
|
+
).min(1).max(100),
|
|
935
|
+
key: z.string().describe(
|
|
936
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
937
|
+
).min(1).max(150).optional().nullable()
|
|
938
|
+
}).describe(
|
|
939
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
940
|
+
)
|
|
941
|
+
}),
|
|
942
|
+
z.object({
|
|
943
|
+
freeTextInput: z.never().optional(),
|
|
944
|
+
choicesSettings: z.object({
|
|
945
|
+
choices: z.array(
|
|
946
|
+
z.intersection(
|
|
947
|
+
z.object({
|
|
948
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
949
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
950
|
+
"Must be a valid GUID"
|
|
951
|
+
).optional(),
|
|
952
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
953
|
+
key: z.string().describe(
|
|
954
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
955
|
+
).min(1).max(50).optional().nullable(),
|
|
956
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
957
|
+
defaultAddedPrice: z.string().describe(
|
|
958
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
959
|
+
).optional().nullable()
|
|
960
|
+
}),
|
|
961
|
+
z.xor([
|
|
962
|
+
z.object({ colorCode: z.never().optional() }),
|
|
963
|
+
z.object({
|
|
964
|
+
colorCode: z.string().describe(
|
|
965
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
966
|
+
).min(3).max(20)
|
|
967
|
+
})
|
|
968
|
+
])
|
|
969
|
+
)
|
|
970
|
+
).min(1).max(200)
|
|
971
|
+
}).describe(
|
|
972
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
973
|
+
)
|
|
974
|
+
})
|
|
975
|
+
])
|
|
976
|
+
).describe("Customization to create.")
|
|
977
|
+
});
|
|
978
|
+
var CreateCustomizationResponse = z.intersection(
|
|
979
|
+
z.object({
|
|
980
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
981
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
982
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
983
|
+
).optional().nullable(),
|
|
984
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
985
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
986
|
+
key: z.string().describe(
|
|
987
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
988
|
+
).min(1).max(50).optional().nullable(),
|
|
989
|
+
name: z.string().describe(
|
|
990
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
991
|
+
).min(1).max(50).optional(),
|
|
992
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
993
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
994
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
995
|
+
).optional(),
|
|
996
|
+
assignedProductsCount: z.number().int().describe(
|
|
997
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
998
|
+
).optional().nullable()
|
|
999
|
+
}),
|
|
1000
|
+
z.xor([
|
|
1001
|
+
z.object({
|
|
1002
|
+
freeTextInput: z.never().optional(),
|
|
1003
|
+
choicesSettings: z.never().optional()
|
|
1004
|
+
}),
|
|
1005
|
+
z.object({
|
|
1006
|
+
choicesSettings: z.never().optional(),
|
|
1007
|
+
freeTextInput: z.object({
|
|
1008
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1009
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1010
|
+
defaultAddedPrice: z.string().describe(
|
|
1011
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1012
|
+
).optional().nullable(),
|
|
1013
|
+
title: z.string().describe("Title to display to customer for their free-text input.").min(1).max(100).optional(),
|
|
1014
|
+
key: z.string().describe(
|
|
1015
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1016
|
+
).min(1).max(150).optional().nullable()
|
|
1017
|
+
}).describe(
|
|
1018
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1019
|
+
)
|
|
1020
|
+
}),
|
|
1021
|
+
z.object({
|
|
1022
|
+
freeTextInput: z.never().optional(),
|
|
1023
|
+
choicesSettings: z.object({
|
|
1024
|
+
choices: z.array(
|
|
1025
|
+
z.intersection(
|
|
1026
|
+
z.object({
|
|
1027
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1028
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1029
|
+
"Must be a valid GUID"
|
|
1030
|
+
).optional(),
|
|
1031
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1032
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1033
|
+
).optional(),
|
|
1034
|
+
key: z.string().describe(
|
|
1035
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1036
|
+
).min(1).max(50).optional().nullable(),
|
|
1037
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1038
|
+
defaultAddedPrice: z.string().describe(
|
|
1039
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1040
|
+
).optional().nullable()
|
|
1041
|
+
}),
|
|
1042
|
+
z.xor([
|
|
1043
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1044
|
+
z.object({
|
|
1045
|
+
colorCode: z.string().describe(
|
|
1046
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1047
|
+
).min(3).max(20)
|
|
1048
|
+
})
|
|
1049
|
+
])
|
|
1050
|
+
)
|
|
1051
|
+
).min(1).max(200).optional()
|
|
1052
|
+
}).describe(
|
|
1053
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1054
|
+
)
|
|
1055
|
+
})
|
|
1056
|
+
])
|
|
1057
|
+
);
|
|
1058
|
+
var GetCustomizationRequest = z.object({
|
|
1059
|
+
customizationId: z.string().describe("Customization ID.").regex(
|
|
1060
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1061
|
+
"Must be a valid GUID"
|
|
1062
|
+
),
|
|
1063
|
+
options: z.object({
|
|
1064
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
1065
|
+
}).optional()
|
|
1066
|
+
});
|
|
1067
|
+
var GetCustomizationResponse = z.intersection(
|
|
1068
|
+
z.object({
|
|
1069
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1070
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1071
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1072
|
+
).optional().nullable(),
|
|
1073
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1074
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1075
|
+
key: z.string().describe(
|
|
1076
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1077
|
+
).min(1).max(50).optional().nullable(),
|
|
1078
|
+
name: z.string().describe(
|
|
1079
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1080
|
+
).min(1).max(50).optional(),
|
|
1081
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1082
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1083
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1084
|
+
).optional(),
|
|
1085
|
+
assignedProductsCount: z.number().int().describe(
|
|
1086
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1087
|
+
).optional().nullable()
|
|
1088
|
+
}),
|
|
1089
|
+
z.xor([
|
|
1090
|
+
z.object({
|
|
1091
|
+
freeTextInput: z.never().optional(),
|
|
1092
|
+
choicesSettings: z.never().optional()
|
|
1093
|
+
}),
|
|
1094
|
+
z.object({
|
|
1095
|
+
choicesSettings: z.never().optional(),
|
|
1096
|
+
freeTextInput: z.object({
|
|
1097
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1098
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1099
|
+
defaultAddedPrice: z.string().describe(
|
|
1100
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1101
|
+
).optional().nullable(),
|
|
1102
|
+
title: z.string().describe("Title to display to customer for their free-text input.").min(1).max(100).optional(),
|
|
1103
|
+
key: z.string().describe(
|
|
1104
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1105
|
+
).min(1).max(150).optional().nullable()
|
|
1106
|
+
}).describe(
|
|
1107
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1108
|
+
)
|
|
1109
|
+
}),
|
|
1110
|
+
z.object({
|
|
1111
|
+
freeTextInput: z.never().optional(),
|
|
1112
|
+
choicesSettings: z.object({
|
|
1113
|
+
choices: z.array(
|
|
1114
|
+
z.intersection(
|
|
1115
|
+
z.object({
|
|
1116
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1117
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1118
|
+
"Must be a valid GUID"
|
|
1119
|
+
).optional(),
|
|
1120
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1121
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1122
|
+
).optional(),
|
|
1123
|
+
key: z.string().describe(
|
|
1124
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1125
|
+
).min(1).max(50).optional().nullable(),
|
|
1126
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1127
|
+
defaultAddedPrice: z.string().describe(
|
|
1128
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1129
|
+
).optional().nullable()
|
|
1130
|
+
}),
|
|
1131
|
+
z.xor([
|
|
1132
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1133
|
+
z.object({
|
|
1134
|
+
colorCode: z.string().describe(
|
|
1135
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1136
|
+
).min(3).max(20)
|
|
1137
|
+
})
|
|
1138
|
+
])
|
|
1139
|
+
)
|
|
1140
|
+
).min(1).max(200).optional()
|
|
1141
|
+
}).describe(
|
|
1142
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1143
|
+
)
|
|
1144
|
+
})
|
|
1145
|
+
])
|
|
1146
|
+
);
|
|
1147
|
+
var UpdateCustomizationRequest = z.object({
|
|
1148
|
+
_id: z.string().describe("Customization ID.").min(1).max(36),
|
|
1149
|
+
customization: z.intersection(
|
|
1150
|
+
z.object({
|
|
1151
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1152
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1153
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1154
|
+
),
|
|
1155
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1156
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1157
|
+
key: z.string().describe(
|
|
1158
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1159
|
+
).min(1).max(50).optional().nullable(),
|
|
1160
|
+
name: z.string().describe(
|
|
1161
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1162
|
+
).min(1).max(50).optional(),
|
|
1163
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).optional(),
|
|
1164
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).optional(),
|
|
1165
|
+
assignedProductsCount: z.number().int().describe(
|
|
1166
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1167
|
+
).optional().nullable()
|
|
1168
|
+
}),
|
|
1169
|
+
z.xor([
|
|
1170
|
+
z.object({
|
|
1171
|
+
freeTextInput: z.never().optional(),
|
|
1172
|
+
choicesSettings: z.never().optional()
|
|
1173
|
+
}),
|
|
1174
|
+
z.object({
|
|
1175
|
+
choicesSettings: z.never().optional(),
|
|
1176
|
+
freeTextInput: z.object({
|
|
1177
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1178
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1179
|
+
defaultAddedPrice: z.string().describe(
|
|
1180
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1181
|
+
).optional().nullable(),
|
|
1182
|
+
title: z.string().describe(
|
|
1183
|
+
"Title to display to customer for their free-text input."
|
|
1184
|
+
).min(1).max(100).optional(),
|
|
1185
|
+
key: z.string().describe(
|
|
1186
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1187
|
+
).min(1).max(150).optional().nullable()
|
|
1188
|
+
}).describe(
|
|
1189
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1190
|
+
)
|
|
1191
|
+
}),
|
|
1192
|
+
z.object({
|
|
1193
|
+
freeTextInput: z.never().optional(),
|
|
1194
|
+
choicesSettings: z.object({
|
|
1195
|
+
choices: z.array(
|
|
1196
|
+
z.intersection(
|
|
1197
|
+
z.object({
|
|
1198
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1199
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1200
|
+
"Must be a valid GUID"
|
|
1201
|
+
),
|
|
1202
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
1203
|
+
key: z.string().describe(
|
|
1204
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1205
|
+
).min(1).max(50).optional().nullable(),
|
|
1206
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1207
|
+
defaultAddedPrice: z.string().describe(
|
|
1208
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1209
|
+
).optional().nullable()
|
|
1210
|
+
}),
|
|
1211
|
+
z.xor([
|
|
1212
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1213
|
+
z.object({
|
|
1214
|
+
colorCode: z.string().describe(
|
|
1215
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1216
|
+
).min(3).max(20)
|
|
1217
|
+
})
|
|
1218
|
+
])
|
|
1219
|
+
)
|
|
1220
|
+
).min(1).max(200).optional()
|
|
1221
|
+
}).describe(
|
|
1222
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1223
|
+
)
|
|
1224
|
+
})
|
|
1225
|
+
])
|
|
1226
|
+
).describe("Customization to update."),
|
|
1227
|
+
options: z.object({
|
|
1228
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
1229
|
+
}).optional()
|
|
1230
|
+
});
|
|
1231
|
+
var UpdateCustomizationResponse = z.intersection(
|
|
1232
|
+
z.object({
|
|
1233
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1234
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1235
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1236
|
+
).optional().nullable(),
|
|
1237
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1238
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1239
|
+
key: z.string().describe(
|
|
1240
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1241
|
+
).min(1).max(50).optional().nullable(),
|
|
1242
|
+
name: z.string().describe(
|
|
1243
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1244
|
+
).min(1).max(50).optional(),
|
|
1245
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1246
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1247
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1248
|
+
).optional(),
|
|
1249
|
+
assignedProductsCount: z.number().int().describe(
|
|
1250
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1251
|
+
).optional().nullable()
|
|
1252
|
+
}),
|
|
1253
|
+
z.xor([
|
|
1254
|
+
z.object({
|
|
1255
|
+
freeTextInput: z.never().optional(),
|
|
1256
|
+
choicesSettings: z.never().optional()
|
|
1257
|
+
}),
|
|
1258
|
+
z.object({
|
|
1259
|
+
choicesSettings: z.never().optional(),
|
|
1260
|
+
freeTextInput: z.object({
|
|
1261
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1262
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1263
|
+
defaultAddedPrice: z.string().describe(
|
|
1264
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1265
|
+
).optional().nullable(),
|
|
1266
|
+
title: z.string().describe("Title to display to customer for their free-text input.").min(1).max(100).optional(),
|
|
1267
|
+
key: z.string().describe(
|
|
1268
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1269
|
+
).min(1).max(150).optional().nullable()
|
|
1270
|
+
}).describe(
|
|
1271
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1272
|
+
)
|
|
1273
|
+
}),
|
|
1274
|
+
z.object({
|
|
1275
|
+
freeTextInput: z.never().optional(),
|
|
1276
|
+
choicesSettings: z.object({
|
|
1277
|
+
choices: z.array(
|
|
1278
|
+
z.intersection(
|
|
1279
|
+
z.object({
|
|
1280
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1281
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1282
|
+
"Must be a valid GUID"
|
|
1283
|
+
).optional(),
|
|
1284
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1285
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1286
|
+
).optional(),
|
|
1287
|
+
key: z.string().describe(
|
|
1288
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1289
|
+
).min(1).max(50).optional().nullable(),
|
|
1290
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1291
|
+
defaultAddedPrice: z.string().describe(
|
|
1292
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1293
|
+
).optional().nullable()
|
|
1294
|
+
}),
|
|
1295
|
+
z.xor([
|
|
1296
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1297
|
+
z.object({
|
|
1298
|
+
colorCode: z.string().describe(
|
|
1299
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1300
|
+
).min(3).max(20)
|
|
1301
|
+
})
|
|
1302
|
+
])
|
|
1303
|
+
)
|
|
1304
|
+
).min(1).max(200).optional()
|
|
1305
|
+
}).describe(
|
|
1306
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1307
|
+
)
|
|
1308
|
+
})
|
|
1309
|
+
])
|
|
1310
|
+
);
|
|
1311
|
+
var DeleteCustomizationRequest = z.object({
|
|
1312
|
+
customizationId: z.string().describe("Customization ID.").regex(
|
|
1313
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1314
|
+
"Must be a valid GUID"
|
|
1315
|
+
)
|
|
1316
|
+
});
|
|
1317
|
+
var DeleteCustomizationResponse = z.object({});
|
|
1318
|
+
var QueryCustomizationsRequest = z.object({
|
|
1319
|
+
query: z.object({
|
|
1320
|
+
filter: z.object({
|
|
1321
|
+
_id: z.object({
|
|
1322
|
+
$eq: z.string(),
|
|
1323
|
+
$exists: z.boolean(),
|
|
1324
|
+
$gt: z.string(),
|
|
1325
|
+
$gte: z.string(),
|
|
1326
|
+
$hasAll: z.array(z.string()),
|
|
1327
|
+
$hasSome: z.array(z.string()),
|
|
1328
|
+
$in: z.array(z.string()),
|
|
1329
|
+
$lt: z.string(),
|
|
1330
|
+
$lte: z.string(),
|
|
1331
|
+
$ne: z.string(),
|
|
1332
|
+
$nin: z.array(z.string()),
|
|
1333
|
+
$startsWith: z.string()
|
|
1334
|
+
}).partial().strict().optional(),
|
|
1335
|
+
_createdDate: z.object({
|
|
1336
|
+
$eq: z.string(),
|
|
1337
|
+
$exists: z.boolean(),
|
|
1338
|
+
$gt: z.string(),
|
|
1339
|
+
$gte: z.string(),
|
|
1340
|
+
$hasAll: z.array(z.string()),
|
|
1341
|
+
$hasSome: z.array(z.string()),
|
|
1342
|
+
$in: z.array(z.string()),
|
|
1343
|
+
$lt: z.string(),
|
|
1344
|
+
$lte: z.string(),
|
|
1345
|
+
$ne: z.string(),
|
|
1346
|
+
$nin: z.array(z.string()),
|
|
1347
|
+
$startsWith: z.string()
|
|
1348
|
+
}).partial().strict().optional(),
|
|
1349
|
+
_updatedDate: z.object({
|
|
1350
|
+
$eq: z.string(),
|
|
1351
|
+
$exists: z.boolean(),
|
|
1352
|
+
$gt: z.string(),
|
|
1353
|
+
$gte: z.string(),
|
|
1354
|
+
$hasAll: z.array(z.string()),
|
|
1355
|
+
$hasSome: z.array(z.string()),
|
|
1356
|
+
$in: z.array(z.string()),
|
|
1357
|
+
$lt: z.string(),
|
|
1358
|
+
$lte: z.string(),
|
|
1359
|
+
$ne: z.string(),
|
|
1360
|
+
$nin: z.array(z.string()),
|
|
1361
|
+
$startsWith: z.string()
|
|
1362
|
+
}).partial().strict().optional(),
|
|
1363
|
+
name: z.object({
|
|
1364
|
+
$eq: z.string(),
|
|
1365
|
+
$exists: z.boolean(),
|
|
1366
|
+
$gt: z.string(),
|
|
1367
|
+
$gte: z.string(),
|
|
1368
|
+
$hasAll: z.array(z.string()),
|
|
1369
|
+
$hasSome: z.array(z.string()),
|
|
1370
|
+
$in: z.array(z.string()),
|
|
1371
|
+
$lt: z.string(),
|
|
1372
|
+
$lte: z.string(),
|
|
1373
|
+
$ne: z.string(),
|
|
1374
|
+
$nin: z.array(z.string()),
|
|
1375
|
+
$startsWith: z.string()
|
|
1376
|
+
}).partial().strict().optional(),
|
|
1377
|
+
customizationType: z.object({
|
|
1378
|
+
$eq: z.string(),
|
|
1379
|
+
$exists: z.boolean(),
|
|
1380
|
+
$gt: z.string(),
|
|
1381
|
+
$gte: z.string(),
|
|
1382
|
+
$hasAll: z.array(z.string()),
|
|
1383
|
+
$hasSome: z.array(z.string()),
|
|
1384
|
+
$in: z.array(z.string()),
|
|
1385
|
+
$lt: z.string(),
|
|
1386
|
+
$lte: z.string(),
|
|
1387
|
+
$ne: z.string(),
|
|
1388
|
+
$nin: z.array(z.string()),
|
|
1389
|
+
$startsWith: z.string()
|
|
1390
|
+
}).partial().strict().optional(),
|
|
1391
|
+
customizationRenderType: z.object({
|
|
1392
|
+
$eq: z.string(),
|
|
1393
|
+
$exists: z.boolean(),
|
|
1394
|
+
$gt: z.string(),
|
|
1395
|
+
$gte: z.string(),
|
|
1396
|
+
$hasAll: z.array(z.string()),
|
|
1397
|
+
$hasSome: z.array(z.string()),
|
|
1398
|
+
$in: z.array(z.string()),
|
|
1399
|
+
$lt: z.string(),
|
|
1400
|
+
$lte: z.string(),
|
|
1401
|
+
$ne: z.string(),
|
|
1402
|
+
$nin: z.array(z.string()),
|
|
1403
|
+
$startsWith: z.string()
|
|
1404
|
+
}).partial().strict().optional(),
|
|
1405
|
+
$and: z.array(z.any()).optional(),
|
|
1406
|
+
$or: z.array(z.any()).optional(),
|
|
1407
|
+
$not: z.any().optional()
|
|
1408
|
+
}).strict().optional(),
|
|
1409
|
+
sort: z.array(
|
|
1410
|
+
z.object({
|
|
1411
|
+
fieldName: z.enum(["_id", "_createdDate", "_updatedDate", "name"]).optional(),
|
|
1412
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
1413
|
+
})
|
|
1414
|
+
).optional()
|
|
1415
|
+
}).catchall(z.any()).describe("Query options."),
|
|
1416
|
+
options: z.object({
|
|
1417
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
1418
|
+
}).optional()
|
|
1419
|
+
});
|
|
1420
|
+
var QueryCustomizationsResponse = z.object({
|
|
1421
|
+
customizations: z.array(
|
|
1422
|
+
z.intersection(
|
|
1423
|
+
z.object({
|
|
1424
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1425
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1426
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1427
|
+
).optional().nullable(),
|
|
1428
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1429
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1430
|
+
key: z.string().describe(
|
|
1431
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1432
|
+
).min(1).max(50).optional().nullable(),
|
|
1433
|
+
name: z.string().describe(
|
|
1434
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1435
|
+
).min(1).max(50).optional(),
|
|
1436
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1437
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1438
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1439
|
+
).optional(),
|
|
1440
|
+
assignedProductsCount: z.number().int().describe(
|
|
1441
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1442
|
+
).optional().nullable()
|
|
1443
|
+
}),
|
|
1444
|
+
z.xor([
|
|
1445
|
+
z.object({
|
|
1446
|
+
freeTextInput: z.never().optional(),
|
|
1447
|
+
choicesSettings: z.never().optional()
|
|
1448
|
+
}),
|
|
1449
|
+
z.object({
|
|
1450
|
+
choicesSettings: z.never().optional(),
|
|
1451
|
+
freeTextInput: z.object({
|
|
1452
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1453
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1454
|
+
defaultAddedPrice: z.string().describe(
|
|
1455
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1456
|
+
).optional().nullable(),
|
|
1457
|
+
title: z.string().describe(
|
|
1458
|
+
"Title to display to customer for their free-text input."
|
|
1459
|
+
).min(1).max(100).optional(),
|
|
1460
|
+
key: z.string().describe(
|
|
1461
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1462
|
+
).min(1).max(150).optional().nullable()
|
|
1463
|
+
}).describe(
|
|
1464
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1465
|
+
)
|
|
1466
|
+
}),
|
|
1467
|
+
z.object({
|
|
1468
|
+
freeTextInput: z.never().optional(),
|
|
1469
|
+
choicesSettings: z.object({
|
|
1470
|
+
choices: z.array(
|
|
1471
|
+
z.intersection(
|
|
1472
|
+
z.object({
|
|
1473
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1474
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1475
|
+
"Must be a valid GUID"
|
|
1476
|
+
).optional(),
|
|
1477
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1478
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1479
|
+
).optional(),
|
|
1480
|
+
key: z.string().describe(
|
|
1481
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1482
|
+
).min(1).max(50).optional().nullable(),
|
|
1483
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1484
|
+
defaultAddedPrice: z.string().describe(
|
|
1485
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1486
|
+
).optional().nullable()
|
|
1487
|
+
}),
|
|
1488
|
+
z.xor([
|
|
1489
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1490
|
+
z.object({
|
|
1491
|
+
colorCode: z.string().describe(
|
|
1492
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1493
|
+
).min(3).max(20)
|
|
1494
|
+
})
|
|
1495
|
+
])
|
|
1496
|
+
)
|
|
1497
|
+
).min(1).max(200).optional()
|
|
1498
|
+
}).describe(
|
|
1499
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1500
|
+
)
|
|
1501
|
+
})
|
|
1502
|
+
])
|
|
1503
|
+
)
|
|
1504
|
+
).min(1).max(200).optional(),
|
|
1505
|
+
pagingMetadata: z.object({
|
|
1506
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1507
|
+
cursors: z.object({
|
|
1508
|
+
next: z.string().describe(
|
|
1509
|
+
"Cursor string pointing to the next page in the list of results."
|
|
1510
|
+
).max(16e3).optional().nullable(),
|
|
1511
|
+
prev: z.string().describe(
|
|
1512
|
+
"Cursor pointing to the previous page in the list of results."
|
|
1513
|
+
).max(16e3).optional().nullable()
|
|
1514
|
+
}).describe(
|
|
1515
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
1516
|
+
).optional(),
|
|
1517
|
+
hasNext: z.boolean().describe(
|
|
1518
|
+
"Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
|
|
1519
|
+
).optional().nullable()
|
|
1520
|
+
}).describe("Details on the paged set of results returned.").optional()
|
|
1521
|
+
});
|
|
1522
|
+
var BulkCreateCustomizationsRequest = z.object({
|
|
1523
|
+
customizations: z.array(
|
|
1524
|
+
z.intersection(
|
|
1525
|
+
z.object({
|
|
1526
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1527
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1528
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1529
|
+
).optional().nullable(),
|
|
1530
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1531
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1532
|
+
key: z.string().describe(
|
|
1533
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1534
|
+
).min(1).max(50).optional().nullable(),
|
|
1535
|
+
name: z.string().describe(
|
|
1536
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1537
|
+
).min(1).max(50).optional(),
|
|
1538
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).optional(),
|
|
1539
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).optional(),
|
|
1540
|
+
assignedProductsCount: z.number().int().describe(
|
|
1541
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1542
|
+
).optional().nullable()
|
|
1543
|
+
}),
|
|
1544
|
+
z.xor([
|
|
1545
|
+
z.object({
|
|
1546
|
+
freeTextInput: z.never().optional(),
|
|
1547
|
+
choicesSettings: z.never().optional()
|
|
1548
|
+
}),
|
|
1549
|
+
z.object({
|
|
1550
|
+
choicesSettings: z.never().optional(),
|
|
1551
|
+
freeTextInput: z.object({
|
|
1552
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1553
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1554
|
+
defaultAddedPrice: z.string().describe(
|
|
1555
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1556
|
+
).optional().nullable(),
|
|
1557
|
+
title: z.string().describe(
|
|
1558
|
+
"Title to display to customer for their free-text input."
|
|
1559
|
+
).min(1).max(100).optional(),
|
|
1560
|
+
key: z.string().describe(
|
|
1561
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1562
|
+
).min(1).max(150).optional().nullable()
|
|
1563
|
+
}).describe(
|
|
1564
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1565
|
+
)
|
|
1566
|
+
}),
|
|
1567
|
+
z.object({
|
|
1568
|
+
freeTextInput: z.never().optional(),
|
|
1569
|
+
choicesSettings: z.object({
|
|
1570
|
+
choices: z.array(
|
|
1571
|
+
z.intersection(
|
|
1572
|
+
z.object({
|
|
1573
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1574
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1575
|
+
"Must be a valid GUID"
|
|
1576
|
+
).optional(),
|
|
1577
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
1578
|
+
key: z.string().describe(
|
|
1579
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1580
|
+
).min(1).max(50).optional().nullable(),
|
|
1581
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1582
|
+
defaultAddedPrice: z.string().describe(
|
|
1583
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1584
|
+
).optional().nullable()
|
|
1585
|
+
}),
|
|
1586
|
+
z.xor([
|
|
1587
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1588
|
+
z.object({
|
|
1589
|
+
colorCode: z.string().describe(
|
|
1590
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1591
|
+
).min(3).max(20)
|
|
1592
|
+
})
|
|
1593
|
+
])
|
|
1594
|
+
)
|
|
1595
|
+
).min(1).max(200).optional()
|
|
1596
|
+
}).describe(
|
|
1597
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1598
|
+
)
|
|
1599
|
+
})
|
|
1600
|
+
])
|
|
1601
|
+
)
|
|
1602
|
+
).min(1).max(100),
|
|
1603
|
+
options: z.object({
|
|
1604
|
+
returnEntity: z.boolean().describe(
|
|
1605
|
+
"Whether to return the full customization entities in the response.\n\nDefault: `false`"
|
|
1606
|
+
).optional()
|
|
1607
|
+
}).optional()
|
|
1608
|
+
});
|
|
1609
|
+
var BulkCreateCustomizationsResponse = z.object({
|
|
1610
|
+
results: z.array(
|
|
1611
|
+
z.object({
|
|
1612
|
+
itemMetadata: z.object({
|
|
1613
|
+
_id: z.string().describe(
|
|
1614
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
1615
|
+
).min(1).max(36).optional().nullable(),
|
|
1616
|
+
originalIndex: z.number().int().describe(
|
|
1617
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
1618
|
+
).optional(),
|
|
1619
|
+
success: z.boolean().describe(
|
|
1620
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
1621
|
+
).optional(),
|
|
1622
|
+
error: z.object({
|
|
1623
|
+
code: z.string().describe("Error code.").optional(),
|
|
1624
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
1625
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
1626
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
1627
|
+
}).describe("Bulk action metadata for customization.").optional(),
|
|
1628
|
+
customization: z.intersection(
|
|
1629
|
+
z.object({
|
|
1630
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1631
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1632
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1633
|
+
).optional().nullable(),
|
|
1634
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1635
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1636
|
+
key: z.string().describe(
|
|
1637
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1638
|
+
).min(1).max(50).optional().nullable(),
|
|
1639
|
+
name: z.string().describe(
|
|
1640
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1641
|
+
).min(1).max(50).optional(),
|
|
1642
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1643
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1644
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1645
|
+
).optional(),
|
|
1646
|
+
assignedProductsCount: z.number().int().describe(
|
|
1647
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1648
|
+
).optional().nullable()
|
|
1649
|
+
}),
|
|
1650
|
+
z.xor([
|
|
1651
|
+
z.object({
|
|
1652
|
+
freeTextInput: z.never().optional(),
|
|
1653
|
+
choicesSettings: z.never().optional()
|
|
1654
|
+
}),
|
|
1655
|
+
z.object({
|
|
1656
|
+
choicesSettings: z.never().optional(),
|
|
1657
|
+
freeTextInput: z.object({
|
|
1658
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1659
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1660
|
+
defaultAddedPrice: z.string().describe(
|
|
1661
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1662
|
+
).optional().nullable(),
|
|
1663
|
+
title: z.string().describe(
|
|
1664
|
+
"Title to display to customer for their free-text input."
|
|
1665
|
+
).min(1).max(100).optional(),
|
|
1666
|
+
key: z.string().describe(
|
|
1667
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1668
|
+
).min(1).max(150).optional().nullable()
|
|
1669
|
+
}).describe(
|
|
1670
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1671
|
+
)
|
|
1672
|
+
}),
|
|
1673
|
+
z.object({
|
|
1674
|
+
freeTextInput: z.never().optional(),
|
|
1675
|
+
choicesSettings: z.object({
|
|
1676
|
+
choices: z.array(
|
|
1677
|
+
z.intersection(
|
|
1678
|
+
z.object({
|
|
1679
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1680
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1681
|
+
"Must be a valid GUID"
|
|
1682
|
+
).optional(),
|
|
1683
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1684
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1685
|
+
).optional(),
|
|
1686
|
+
key: z.string().describe(
|
|
1687
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1688
|
+
).min(1).max(50).optional().nullable(),
|
|
1689
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1690
|
+
defaultAddedPrice: z.string().describe(
|
|
1691
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1692
|
+
).optional().nullable()
|
|
1693
|
+
}),
|
|
1694
|
+
z.xor([
|
|
1695
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1696
|
+
z.object({
|
|
1697
|
+
colorCode: z.string().describe(
|
|
1698
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1699
|
+
).min(3).max(20)
|
|
1700
|
+
})
|
|
1701
|
+
])
|
|
1702
|
+
)
|
|
1703
|
+
).min(1).max(200).optional()
|
|
1704
|
+
}).describe(
|
|
1705
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1706
|
+
)
|
|
1707
|
+
})
|
|
1708
|
+
])
|
|
1709
|
+
).describe(
|
|
1710
|
+
"Full customization entity.\n\nReturned only if `returnEntity: true` is passed in the request."
|
|
1711
|
+
).optional()
|
|
1712
|
+
})
|
|
1713
|
+
).min(1).max(100).optional(),
|
|
1714
|
+
bulkActionMetadata: z.object({
|
|
1715
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
1716
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
1717
|
+
undetailedFailures: z.number().int().describe(
|
|
1718
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
1719
|
+
).optional()
|
|
1720
|
+
}).describe("Bulk action metadata.").optional()
|
|
1721
|
+
});
|
|
1722
|
+
var AddCustomizationChoicesRequest = z.object({
|
|
1723
|
+
customizationId: z.string().describe("Customization ID.").regex(
|
|
1724
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1725
|
+
"Must be a valid GUID"
|
|
1726
|
+
),
|
|
1727
|
+
choices: z.array(
|
|
1728
|
+
z.intersection(
|
|
1729
|
+
z.object({
|
|
1730
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1731
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1732
|
+
"Must be a valid GUID"
|
|
1733
|
+
).optional(),
|
|
1734
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
1735
|
+
key: z.string().describe(
|
|
1736
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1737
|
+
).min(1).max(50).optional().nullable(),
|
|
1738
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1739
|
+
defaultAddedPrice: z.string().describe(
|
|
1740
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1741
|
+
).optional().nullable()
|
|
1742
|
+
}),
|
|
1743
|
+
z.xor([
|
|
1744
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1745
|
+
z.object({
|
|
1746
|
+
colorCode: z.string().describe(
|
|
1747
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1748
|
+
).min(3).max(20)
|
|
1749
|
+
})
|
|
1750
|
+
])
|
|
1751
|
+
)
|
|
1752
|
+
).min(1).max(100),
|
|
1753
|
+
options: z.object({
|
|
1754
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
1755
|
+
}).optional()
|
|
1756
|
+
});
|
|
1757
|
+
var AddCustomizationChoicesResponse = z.object({
|
|
1758
|
+
customization: z.intersection(
|
|
1759
|
+
z.object({
|
|
1760
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1761
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1762
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1763
|
+
).optional().nullable(),
|
|
1764
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1765
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1766
|
+
key: z.string().describe(
|
|
1767
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1768
|
+
).min(1).max(50).optional().nullable(),
|
|
1769
|
+
name: z.string().describe(
|
|
1770
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1771
|
+
).min(1).max(50).optional(),
|
|
1772
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1773
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1774
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1775
|
+
).optional(),
|
|
1776
|
+
assignedProductsCount: z.number().int().describe(
|
|
1777
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1778
|
+
).optional().nullable()
|
|
1779
|
+
}),
|
|
1780
|
+
z.xor([
|
|
1781
|
+
z.object({
|
|
1782
|
+
freeTextInput: z.never().optional(),
|
|
1783
|
+
choicesSettings: z.never().optional()
|
|
1784
|
+
}),
|
|
1785
|
+
z.object({
|
|
1786
|
+
choicesSettings: z.never().optional(),
|
|
1787
|
+
freeTextInput: z.object({
|
|
1788
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1789
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1790
|
+
defaultAddedPrice: z.string().describe(
|
|
1791
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1792
|
+
).optional().nullable(),
|
|
1793
|
+
title: z.string().describe(
|
|
1794
|
+
"Title to display to customer for their free-text input."
|
|
1795
|
+
).min(1).max(100).optional(),
|
|
1796
|
+
key: z.string().describe(
|
|
1797
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1798
|
+
).min(1).max(150).optional().nullable()
|
|
1799
|
+
}).describe(
|
|
1800
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1801
|
+
)
|
|
1802
|
+
}),
|
|
1803
|
+
z.object({
|
|
1804
|
+
freeTextInput: z.never().optional(),
|
|
1805
|
+
choicesSettings: z.object({
|
|
1806
|
+
choices: z.array(
|
|
1807
|
+
z.intersection(
|
|
1808
|
+
z.object({
|
|
1809
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1810
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1811
|
+
"Must be a valid GUID"
|
|
1812
|
+
).optional(),
|
|
1813
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1814
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1815
|
+
).optional(),
|
|
1816
|
+
key: z.string().describe(
|
|
1817
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1818
|
+
).min(1).max(50).optional().nullable(),
|
|
1819
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1820
|
+
defaultAddedPrice: z.string().describe(
|
|
1821
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1822
|
+
).optional().nullable()
|
|
1823
|
+
}),
|
|
1824
|
+
z.xor([
|
|
1825
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1826
|
+
z.object({
|
|
1827
|
+
colorCode: z.string().describe(
|
|
1828
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1829
|
+
).min(3).max(20)
|
|
1830
|
+
})
|
|
1831
|
+
])
|
|
1832
|
+
)
|
|
1833
|
+
).min(1).max(200).optional()
|
|
1834
|
+
}).describe(
|
|
1835
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1836
|
+
)
|
|
1837
|
+
})
|
|
1838
|
+
])
|
|
1839
|
+
).describe("Updated customization.").optional()
|
|
1840
|
+
});
|
|
1841
|
+
var SetCustomizationChoicesRequest = z.object({
|
|
1842
|
+
customizationId: z.string().describe("Customization ID.").regex(
|
|
1843
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1844
|
+
"Must be a valid GUID"
|
|
1845
|
+
),
|
|
1846
|
+
choices: z.array(
|
|
1847
|
+
z.intersection(
|
|
1848
|
+
z.object({
|
|
1849
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1850
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1851
|
+
"Must be a valid GUID"
|
|
1852
|
+
).optional(),
|
|
1853
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
1854
|
+
key: z.string().describe(
|
|
1855
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1856
|
+
).min(1).max(50).optional().nullable(),
|
|
1857
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1858
|
+
defaultAddedPrice: z.string().describe(
|
|
1859
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1860
|
+
).optional().nullable()
|
|
1861
|
+
}),
|
|
1862
|
+
z.xor([
|
|
1863
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1864
|
+
z.object({
|
|
1865
|
+
colorCode: z.string().describe(
|
|
1866
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1867
|
+
).min(3).max(20)
|
|
1868
|
+
})
|
|
1869
|
+
])
|
|
1870
|
+
)
|
|
1871
|
+
).min(1).max(200),
|
|
1872
|
+
options: z.object({
|
|
1873
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
1874
|
+
}).optional()
|
|
1875
|
+
});
|
|
1876
|
+
var SetCustomizationChoicesResponse = z.object({
|
|
1877
|
+
customization: z.intersection(
|
|
1878
|
+
z.object({
|
|
1879
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1880
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1881
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1882
|
+
).optional().nullable(),
|
|
1883
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1884
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1885
|
+
key: z.string().describe(
|
|
1886
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1887
|
+
).min(1).max(50).optional().nullable(),
|
|
1888
|
+
name: z.string().describe(
|
|
1889
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1890
|
+
).min(1).max(50).optional(),
|
|
1891
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1892
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1893
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1894
|
+
).optional(),
|
|
1895
|
+
assignedProductsCount: z.number().int().describe(
|
|
1896
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1897
|
+
).optional().nullable()
|
|
1898
|
+
}),
|
|
1899
|
+
z.xor([
|
|
1900
|
+
z.object({
|
|
1901
|
+
freeTextInput: z.never().optional(),
|
|
1902
|
+
choicesSettings: z.never().optional()
|
|
1903
|
+
}),
|
|
1904
|
+
z.object({
|
|
1905
|
+
choicesSettings: z.never().optional(),
|
|
1906
|
+
freeTextInput: z.object({
|
|
1907
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
1908
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
1909
|
+
defaultAddedPrice: z.string().describe(
|
|
1910
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
1911
|
+
).optional().nullable(),
|
|
1912
|
+
title: z.string().describe(
|
|
1913
|
+
"Title to display to customer for their free-text input."
|
|
1914
|
+
).min(1).max(100).optional(),
|
|
1915
|
+
key: z.string().describe(
|
|
1916
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1917
|
+
).min(1).max(150).optional().nullable()
|
|
1918
|
+
}).describe(
|
|
1919
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
1920
|
+
)
|
|
1921
|
+
}),
|
|
1922
|
+
z.object({
|
|
1923
|
+
freeTextInput: z.never().optional(),
|
|
1924
|
+
choicesSettings: z.object({
|
|
1925
|
+
choices: z.array(
|
|
1926
|
+
z.intersection(
|
|
1927
|
+
z.object({
|
|
1928
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
1929
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1930
|
+
"Must be a valid GUID"
|
|
1931
|
+
).optional(),
|
|
1932
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
1933
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
1934
|
+
).optional(),
|
|
1935
|
+
key: z.string().describe(
|
|
1936
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1937
|
+
).min(1).max(50).optional().nullable(),
|
|
1938
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
1939
|
+
defaultAddedPrice: z.string().describe(
|
|
1940
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
1941
|
+
).optional().nullable()
|
|
1942
|
+
}),
|
|
1943
|
+
z.xor([
|
|
1944
|
+
z.object({ colorCode: z.never().optional() }),
|
|
1945
|
+
z.object({
|
|
1946
|
+
colorCode: z.string().describe(
|
|
1947
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
1948
|
+
).min(3).max(20)
|
|
1949
|
+
})
|
|
1950
|
+
])
|
|
1951
|
+
)
|
|
1952
|
+
).min(1).max(200).optional()
|
|
1953
|
+
}).describe(
|
|
1954
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
1955
|
+
)
|
|
1956
|
+
})
|
|
1957
|
+
])
|
|
1958
|
+
).describe("Updated customization.").optional()
|
|
1959
|
+
});
|
|
1960
|
+
var RemoveCustomizationChoicesRequest = z.object({
|
|
1961
|
+
customizationId: z.string().describe("Customization ID.").regex(
|
|
1962
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1963
|
+
"Must be a valid GUID"
|
|
1964
|
+
),
|
|
1965
|
+
choiceIds: z.array(z.string()).min(1).max(100),
|
|
1966
|
+
options: z.object({
|
|
1967
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe("Customization revision.").optional(),
|
|
1968
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
1969
|
+
}).optional()
|
|
1970
|
+
});
|
|
1971
|
+
var RemoveCustomizationChoicesResponse = z.object({
|
|
1972
|
+
customization: z.intersection(
|
|
1973
|
+
z.object({
|
|
1974
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
1975
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1976
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
1977
|
+
).optional().nullable(),
|
|
1978
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
1979
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
1980
|
+
key: z.string().describe(
|
|
1981
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
1982
|
+
).min(1).max(50).optional().nullable(),
|
|
1983
|
+
name: z.string().describe(
|
|
1984
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
1985
|
+
).min(1).max(50).optional(),
|
|
1986
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
1987
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
1988
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
1989
|
+
).optional(),
|
|
1990
|
+
assignedProductsCount: z.number().int().describe(
|
|
1991
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
1992
|
+
).optional().nullable()
|
|
1993
|
+
}),
|
|
1994
|
+
z.xor([
|
|
1995
|
+
z.object({
|
|
1996
|
+
freeTextInput: z.never().optional(),
|
|
1997
|
+
choicesSettings: z.never().optional()
|
|
1998
|
+
}),
|
|
1999
|
+
z.object({
|
|
2000
|
+
choicesSettings: z.never().optional(),
|
|
2001
|
+
freeTextInput: z.object({
|
|
2002
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
2003
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
2004
|
+
defaultAddedPrice: z.string().describe(
|
|
2005
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
2006
|
+
).optional().nullable(),
|
|
2007
|
+
title: z.string().describe(
|
|
2008
|
+
"Title to display to customer for their free-text input."
|
|
2009
|
+
).min(1).max(100).optional(),
|
|
2010
|
+
key: z.string().describe(
|
|
2011
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2012
|
+
).min(1).max(150).optional().nullable()
|
|
2013
|
+
}).describe(
|
|
2014
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
2015
|
+
)
|
|
2016
|
+
}),
|
|
2017
|
+
z.object({
|
|
2018
|
+
freeTextInput: z.never().optional(),
|
|
2019
|
+
choicesSettings: z.object({
|
|
2020
|
+
choices: z.array(
|
|
2021
|
+
z.intersection(
|
|
2022
|
+
z.object({
|
|
2023
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
2024
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
2025
|
+
"Must be a valid GUID"
|
|
2026
|
+
).optional(),
|
|
2027
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
2028
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
2029
|
+
).optional(),
|
|
2030
|
+
key: z.string().describe(
|
|
2031
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2032
|
+
).min(1).max(50).optional().nullable(),
|
|
2033
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
2034
|
+
defaultAddedPrice: z.string().describe(
|
|
2035
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
2036
|
+
).optional().nullable()
|
|
2037
|
+
}),
|
|
2038
|
+
z.xor([
|
|
2039
|
+
z.object({ colorCode: z.never().optional() }),
|
|
2040
|
+
z.object({
|
|
2041
|
+
colorCode: z.string().describe(
|
|
2042
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
2043
|
+
).min(3).max(20)
|
|
2044
|
+
})
|
|
2045
|
+
])
|
|
2046
|
+
)
|
|
2047
|
+
).min(1).max(200).optional()
|
|
2048
|
+
}).describe(
|
|
2049
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
2050
|
+
)
|
|
2051
|
+
})
|
|
2052
|
+
])
|
|
2053
|
+
).describe("Updated customization.").optional()
|
|
2054
|
+
});
|
|
2055
|
+
var BulkAddCustomizationChoicesRequest = z.object({
|
|
2056
|
+
customizationsChoices: z.array(
|
|
2057
|
+
z.object({
|
|
2058
|
+
customizationId: z.string().describe("Customization ID.").min(1).max(36),
|
|
2059
|
+
choices: z.array(
|
|
2060
|
+
z.intersection(
|
|
2061
|
+
z.object({
|
|
2062
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
2063
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
2064
|
+
"Must be a valid GUID"
|
|
2065
|
+
).optional(),
|
|
2066
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
2067
|
+
key: z.string().describe(
|
|
2068
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2069
|
+
).min(1).max(50).optional().nullable(),
|
|
2070
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
2071
|
+
defaultAddedPrice: z.string().describe(
|
|
2072
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
2073
|
+
).optional().nullable()
|
|
2074
|
+
}),
|
|
2075
|
+
z.xor([
|
|
2076
|
+
z.object({ colorCode: z.never().optional() }),
|
|
2077
|
+
z.object({
|
|
2078
|
+
colorCode: z.string().describe(
|
|
2079
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
2080
|
+
).min(3).max(20)
|
|
2081
|
+
})
|
|
2082
|
+
])
|
|
2083
|
+
)
|
|
2084
|
+
).min(1).max(100)
|
|
2085
|
+
})
|
|
2086
|
+
).min(1).max(100),
|
|
2087
|
+
options: z.object({
|
|
2088
|
+
returnEntity: z.boolean().describe(
|
|
2089
|
+
"Whether to return the full customization entities in the response.\n\nDefault: `false`"
|
|
2090
|
+
).optional(),
|
|
2091
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
2092
|
+
}).optional()
|
|
2093
|
+
});
|
|
2094
|
+
var BulkAddCustomizationChoicesResponse = z.object({
|
|
2095
|
+
results: z.array(
|
|
2096
|
+
z.object({
|
|
2097
|
+
itemMetadata: z.object({
|
|
2098
|
+
_id: z.string().describe(
|
|
2099
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
2100
|
+
).min(1).max(36).optional().nullable(),
|
|
2101
|
+
originalIndex: z.number().int().describe(
|
|
2102
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
2103
|
+
).optional(),
|
|
2104
|
+
success: z.boolean().describe(
|
|
2105
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
2106
|
+
).optional(),
|
|
2107
|
+
error: z.object({
|
|
2108
|
+
code: z.string().describe("Error code.").optional(),
|
|
2109
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
2110
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
2111
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
2112
|
+
}).describe("Bulk action metadata for customization.").optional(),
|
|
2113
|
+
customization: z.intersection(
|
|
2114
|
+
z.object({
|
|
2115
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
2116
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
2117
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
2118
|
+
).optional().nullable(),
|
|
2119
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
2120
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
2121
|
+
key: z.string().describe(
|
|
2122
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2123
|
+
).min(1).max(50).optional().nullable(),
|
|
2124
|
+
name: z.string().describe(
|
|
2125
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
2126
|
+
).min(1).max(50).optional(),
|
|
2127
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
2128
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
2129
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
2130
|
+
).optional(),
|
|
2131
|
+
assignedProductsCount: z.number().int().describe(
|
|
2132
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
2133
|
+
).optional().nullable()
|
|
2134
|
+
}),
|
|
2135
|
+
z.xor([
|
|
2136
|
+
z.object({
|
|
2137
|
+
freeTextInput: z.never().optional(),
|
|
2138
|
+
choicesSettings: z.never().optional()
|
|
2139
|
+
}),
|
|
2140
|
+
z.object({
|
|
2141
|
+
choicesSettings: z.never().optional(),
|
|
2142
|
+
freeTextInput: z.object({
|
|
2143
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
2144
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
2145
|
+
defaultAddedPrice: z.string().describe(
|
|
2146
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
2147
|
+
).optional().nullable(),
|
|
2148
|
+
title: z.string().describe(
|
|
2149
|
+
"Title to display to customer for their free-text input."
|
|
2150
|
+
).min(1).max(100).optional(),
|
|
2151
|
+
key: z.string().describe(
|
|
2152
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2153
|
+
).min(1).max(150).optional().nullable()
|
|
2154
|
+
}).describe(
|
|
2155
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
2156
|
+
)
|
|
2157
|
+
}),
|
|
2158
|
+
z.object({
|
|
2159
|
+
freeTextInput: z.never().optional(),
|
|
2160
|
+
choicesSettings: z.object({
|
|
2161
|
+
choices: z.array(
|
|
2162
|
+
z.intersection(
|
|
2163
|
+
z.object({
|
|
2164
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
2165
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
2166
|
+
"Must be a valid GUID"
|
|
2167
|
+
).optional(),
|
|
2168
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
2169
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
2170
|
+
).optional(),
|
|
2171
|
+
key: z.string().describe(
|
|
2172
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2173
|
+
).min(1).max(50).optional().nullable(),
|
|
2174
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
2175
|
+
defaultAddedPrice: z.string().describe(
|
|
2176
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
2177
|
+
).optional().nullable()
|
|
2178
|
+
}),
|
|
2179
|
+
z.xor([
|
|
2180
|
+
z.object({ colorCode: z.never().optional() }),
|
|
2181
|
+
z.object({
|
|
2182
|
+
colorCode: z.string().describe(
|
|
2183
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
2184
|
+
).min(3).max(20)
|
|
2185
|
+
})
|
|
2186
|
+
])
|
|
2187
|
+
)
|
|
2188
|
+
).min(1).max(200).optional()
|
|
2189
|
+
}).describe(
|
|
2190
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
2191
|
+
)
|
|
2192
|
+
})
|
|
2193
|
+
])
|
|
2194
|
+
).describe(
|
|
2195
|
+
"Full customization entity.\n\nReturned only if `returnEntity: true` is passed in the request."
|
|
2196
|
+
).optional()
|
|
2197
|
+
})
|
|
2198
|
+
).min(1).max(100).optional(),
|
|
2199
|
+
bulkActionMetadata: z.object({
|
|
2200
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
2201
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
2202
|
+
undetailedFailures: z.number().int().describe(
|
|
2203
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
2204
|
+
).optional()
|
|
2205
|
+
}).describe("Bulk action metadata.").optional()
|
|
2206
|
+
});
|
|
2207
|
+
var BulkUpdateCustomizationsRequest = z.object({
|
|
2208
|
+
customizations: z.array(
|
|
2209
|
+
z.object({
|
|
2210
|
+
customization: z.intersection(
|
|
2211
|
+
z.object({
|
|
2212
|
+
_id: z.string().describe("Customization ID.").min(1).max(36),
|
|
2213
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
2214
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
2215
|
+
),
|
|
2216
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
2217
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
2218
|
+
key: z.string().describe(
|
|
2219
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2220
|
+
).min(1).max(50).optional().nullable(),
|
|
2221
|
+
name: z.string().describe(
|
|
2222
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
2223
|
+
).min(1).max(50),
|
|
2224
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).optional(),
|
|
2225
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).optional(),
|
|
2226
|
+
assignedProductsCount: z.number().int().describe(
|
|
2227
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
2228
|
+
).optional().nullable()
|
|
2229
|
+
}),
|
|
2230
|
+
z.xor([
|
|
2231
|
+
z.object({
|
|
2232
|
+
freeTextInput: z.never().optional(),
|
|
2233
|
+
choicesSettings: z.never().optional()
|
|
2234
|
+
}),
|
|
2235
|
+
z.object({
|
|
2236
|
+
choicesSettings: z.never().optional(),
|
|
2237
|
+
freeTextInput: z.object({
|
|
2238
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
2239
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
2240
|
+
defaultAddedPrice: z.string().describe(
|
|
2241
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
2242
|
+
).optional().nullable(),
|
|
2243
|
+
title: z.string().describe(
|
|
2244
|
+
"Title to display to customer for their free-text input."
|
|
2245
|
+
).min(1).max(100).optional(),
|
|
2246
|
+
key: z.string().describe(
|
|
2247
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2248
|
+
).min(1).max(150).optional().nullable()
|
|
2249
|
+
}).describe(
|
|
2250
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
2251
|
+
)
|
|
2252
|
+
}),
|
|
2253
|
+
z.object({
|
|
2254
|
+
freeTextInput: z.never().optional(),
|
|
2255
|
+
choicesSettings: z.object({
|
|
2256
|
+
choices: z.array(
|
|
2257
|
+
z.intersection(
|
|
2258
|
+
z.object({
|
|
2259
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
2260
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
2261
|
+
"Must be a valid GUID"
|
|
2262
|
+
).optional(),
|
|
2263
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).optional(),
|
|
2264
|
+
key: z.string().describe(
|
|
2265
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2266
|
+
).min(1).max(50).optional().nullable(),
|
|
2267
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
2268
|
+
defaultAddedPrice: z.string().describe(
|
|
2269
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
2270
|
+
).optional().nullable()
|
|
2271
|
+
}),
|
|
2272
|
+
z.xor([
|
|
2273
|
+
z.object({ colorCode: z.never().optional() }),
|
|
2274
|
+
z.object({
|
|
2275
|
+
colorCode: z.string().describe(
|
|
2276
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
2277
|
+
).min(3).max(20)
|
|
2278
|
+
})
|
|
2279
|
+
])
|
|
2280
|
+
)
|
|
2281
|
+
).min(1).max(200).optional()
|
|
2282
|
+
}).describe(
|
|
2283
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
2284
|
+
)
|
|
2285
|
+
})
|
|
2286
|
+
])
|
|
2287
|
+
).describe("Customization to update.").optional()
|
|
2288
|
+
})
|
|
2289
|
+
).min(1).max(100),
|
|
2290
|
+
options: z.object({
|
|
2291
|
+
returnEntity: z.boolean().describe(
|
|
2292
|
+
"Whether to return the full customization entities in the response.\n\nDefault: `false`"
|
|
2293
|
+
).optional(),
|
|
2294
|
+
fields: z.array(z.enum(["ASSIGNED_PRODUCTS_COUNT"])).max(100).optional()
|
|
2295
|
+
}).optional()
|
|
2296
|
+
});
|
|
2297
|
+
var BulkUpdateCustomizationsResponse = z.object({
|
|
2298
|
+
results: z.array(
|
|
2299
|
+
z.object({
|
|
2300
|
+
itemMetadata: z.object({
|
|
2301
|
+
_id: z.string().describe(
|
|
2302
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
2303
|
+
).min(1).max(36).optional().nullable(),
|
|
2304
|
+
originalIndex: z.number().int().describe(
|
|
2305
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
2306
|
+
).optional(),
|
|
2307
|
+
success: z.boolean().describe(
|
|
2308
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
2309
|
+
).optional(),
|
|
2310
|
+
error: z.object({
|
|
2311
|
+
code: z.string().describe("Error code.").optional(),
|
|
2312
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
2313
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
2314
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
2315
|
+
}).describe("Bulk action metadata for customization.").optional(),
|
|
2316
|
+
customization: z.intersection(
|
|
2317
|
+
z.object({
|
|
2318
|
+
_id: z.string().describe("Customization ID.").min(1).max(36).optional().nullable(),
|
|
2319
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
2320
|
+
"Revision number, which increments by 1 each time the customization is updated.\nTo prevent conflicting changes,\nthe current revision must be passed when updating the customization.\n\nIgnored when creating a customization."
|
|
2321
|
+
).optional().nullable(),
|
|
2322
|
+
_createdDate: z.date().describe("Date and time the customization was created.").optional().nullable(),
|
|
2323
|
+
_updatedDate: z.date().describe("Date and time the customization was updated.").optional().nullable(),
|
|
2324
|
+
key: z.string().describe(
|
|
2325
|
+
"A read-only identifier generated from the customization name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2326
|
+
).min(1).max(50).optional().nullable(),
|
|
2327
|
+
name: z.string().describe(
|
|
2328
|
+
'Customization name for options (for example, `"color"`, `"size"`) and modifiers (for example, `"greeting card"`).'
|
|
2329
|
+
).min(1).max(50).optional(),
|
|
2330
|
+
customizationType: z.enum(["PRODUCT_OPTION", "MODIFIER"]).describe("Customization type.").optional(),
|
|
2331
|
+
customizationRenderType: z.enum(["FREE_TEXT", "TEXT_CHOICES", "SWATCH_CHOICES"]).describe(
|
|
2332
|
+
"Customization render type.\n\nDefines how the customization will be displayed in the storefront."
|
|
2333
|
+
).optional(),
|
|
2334
|
+
assignedProductsCount: z.number().int().describe(
|
|
2335
|
+
'Number of products this customization is assigned to.\n> **Note:** Returned only when you pass `"ASSIGNED_PRODUCTS_COUNT"` to the `fields` array in Customizations API requests.'
|
|
2336
|
+
).optional().nullable()
|
|
2337
|
+
}),
|
|
2338
|
+
z.xor([
|
|
2339
|
+
z.object({
|
|
2340
|
+
freeTextInput: z.never().optional(),
|
|
2341
|
+
choicesSettings: z.never().optional()
|
|
2342
|
+
}),
|
|
2343
|
+
z.object({
|
|
2344
|
+
choicesSettings: z.never().optional(),
|
|
2345
|
+
freeTextInput: z.object({
|
|
2346
|
+
minCharCount: z.number().int().describe("Minimum text character length.").optional(),
|
|
2347
|
+
maxCharCount: z.number().int().describe("Maximum text character length.").max(500).optional(),
|
|
2348
|
+
defaultAddedPrice: z.string().describe(
|
|
2349
|
+
"Default amount added to a product's price when this choice is assigned to a modifier."
|
|
2350
|
+
).optional().nullable(),
|
|
2351
|
+
title: z.string().describe(
|
|
2352
|
+
"Title to display to customer for their free-text input."
|
|
2353
|
+
).min(1).max(100).optional(),
|
|
2354
|
+
key: z.string().describe(
|
|
2355
|
+
"A read-only identifier generated from the title.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2356
|
+
).min(1).max(150).optional().nullable()
|
|
2357
|
+
}).describe(
|
|
2358
|
+
"Free text input settings.\n\n> **Note:** To be passed along with `customizationRenderType: FREE_TEXT`."
|
|
2359
|
+
)
|
|
2360
|
+
}),
|
|
2361
|
+
z.object({
|
|
2362
|
+
freeTextInput: z.never().optional(),
|
|
2363
|
+
choicesSettings: z.object({
|
|
2364
|
+
choices: z.array(
|
|
2365
|
+
z.intersection(
|
|
2366
|
+
z.object({
|
|
2367
|
+
_id: z.string().describe("Choice ID.").regex(
|
|
2368
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
2369
|
+
"Must be a valid GUID"
|
|
2370
|
+
).optional(),
|
|
2371
|
+
choiceType: z.enum(["CHOICE_TEXT", "ONE_COLOR"]).describe(
|
|
2372
|
+
"Choice type.\n\n> **Notes:**\n> + For `customizationRenderType: SWATCH_CHOICES`, the supported `choiceType` value is: `ONE_COLOR`.\n> + For a `customizationRenderType` of `TEXT_CHOICES`, the supported `choiceType` value is: `CHOICE_TEXT`."
|
|
2373
|
+
).optional(),
|
|
2374
|
+
key: z.string().describe(
|
|
2375
|
+
"A read-only identifier generated from the choice name.\n\nUse `key` in the `catalogReference.options` object when [integrating Catalog V3 with eCommerce APIs](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/e-commerce-integration)."
|
|
2376
|
+
).min(1).max(50).optional().nullable(),
|
|
2377
|
+
name: z.string().describe("Choice name.").min(1).max(50).optional(),
|
|
2378
|
+
defaultAddedPrice: z.string().describe(
|
|
2379
|
+
"Default amount added to a product's price when this customization is assigned to a modifier."
|
|
2380
|
+
).optional().nullable()
|
|
2381
|
+
}),
|
|
2382
|
+
z.xor([
|
|
2383
|
+
z.object({ colorCode: z.never().optional() }),
|
|
2384
|
+
z.object({
|
|
2385
|
+
colorCode: z.string().describe(
|
|
2386
|
+
"Color code in HEX format, [as described by MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/hex-color)."
|
|
2387
|
+
).min(3).max(20)
|
|
2388
|
+
})
|
|
2389
|
+
])
|
|
2390
|
+
)
|
|
2391
|
+
).min(1).max(200).optional()
|
|
2392
|
+
}).describe(
|
|
2393
|
+
"Choices settings.\n\n> **Note:** Must be passed along with `customizationRenderType` of `SWATCH_CHOICES` and `TEXT_CHOICES`."
|
|
2394
|
+
)
|
|
2395
|
+
})
|
|
2396
|
+
])
|
|
2397
|
+
).describe(
|
|
2398
|
+
"Full customization entity.\n\nReturned only if `returnEntity: true` is passed in the request."
|
|
2399
|
+
).optional()
|
|
2400
|
+
})
|
|
2401
|
+
).min(1).max(100).optional(),
|
|
2402
|
+
bulkActionMetadata: z.object({
|
|
2403
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
2404
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
2405
|
+
undetailedFailures: z.number().int().describe(
|
|
2406
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
2407
|
+
).optional()
|
|
2408
|
+
}).describe("Bulk action metadata.").optional()
|
|
2409
|
+
});
|
|
2410
|
+
|
|
2411
|
+
// src/stores-catalog-v3-customization-customizations-v-3.universal.ts
|
|
885
2412
|
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
886
2413
|
var CustomizationType = /* @__PURE__ */ ((CustomizationType2) => {
|
|
887
2414
|
CustomizationType2["PRODUCT_OPTION"] = "PRODUCT_OPTION";
|
|
@@ -908,6 +2435,7 @@ var ChoiceSortStrategy = /* @__PURE__ */ ((ChoiceSortStrategy2) => {
|
|
|
908
2435
|
})(ChoiceSortStrategy || {});
|
|
909
2436
|
var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
|
|
910
2437
|
RequestedFields2["ASSIGNED_PRODUCTS_COUNT"] = "ASSIGNED_PRODUCTS_COUNT";
|
|
2438
|
+
RequestedFields2["CHOICE_DISPLAY_IMAGE"] = "CHOICE_DISPLAY_IMAGE";
|
|
911
2439
|
return RequestedFields2;
|
|
912
2440
|
})(RequestedFields || {});
|
|
913
2441
|
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
@@ -924,7 +2452,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
924
2452
|
return WebhookIdentityType2;
|
|
925
2453
|
})(WebhookIdentityType || {});
|
|
926
2454
|
async function createCustomization2(customization) {
|
|
927
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
2455
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
2456
|
+
if (validateRequestSchema) {
|
|
2457
|
+
CreateCustomizationRequest.parse({ customization });
|
|
2458
|
+
}
|
|
928
2459
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
929
2460
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ customization }),
|
|
930
2461
|
[
|
|
@@ -968,7 +2499,10 @@ async function createCustomization2(customization) {
|
|
|
968
2499
|
}
|
|
969
2500
|
}
|
|
970
2501
|
async function getCustomization2(customizationId, options) {
|
|
971
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
2502
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
2503
|
+
if (validateRequestSchema) {
|
|
2504
|
+
GetCustomizationRequest.parse({ customizationId, options });
|
|
2505
|
+
}
|
|
972
2506
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
973
2507
|
customizationId,
|
|
974
2508
|
fields: options?.fields
|
|
@@ -1007,7 +2541,10 @@ async function getCustomization2(customizationId, options) {
|
|
|
1007
2541
|
}
|
|
1008
2542
|
}
|
|
1009
2543
|
async function updateCustomization2(_id, customization, options) {
|
|
1010
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
2544
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[3];
|
|
2545
|
+
if (validateRequestSchema) {
|
|
2546
|
+
UpdateCustomizationRequest.parse({ _id, customization, options });
|
|
2547
|
+
}
|
|
1011
2548
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
1012
2549
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1013
2550
|
customization: { ...customization, id: _id },
|
|
@@ -1057,7 +2594,10 @@ async function updateCustomization2(_id, customization, options) {
|
|
|
1057
2594
|
}
|
|
1058
2595
|
}
|
|
1059
2596
|
async function deleteCustomization2(customizationId) {
|
|
1060
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
2597
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
2598
|
+
if (validateRequestSchema) {
|
|
2599
|
+
DeleteCustomizationRequest.parse({ customizationId });
|
|
2600
|
+
}
|
|
1061
2601
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1062
2602
|
customizationId
|
|
1063
2603
|
});
|
|
@@ -1138,7 +2678,10 @@ function queryCustomizations2(options) {
|
|
|
1138
2678
|
});
|
|
1139
2679
|
}
|
|
1140
2680
|
async function typedQueryCustomizations(query, options) {
|
|
1141
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
2681
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
2682
|
+
if (validateRequestSchema) {
|
|
2683
|
+
QueryCustomizationsRequest.parse({ query, options });
|
|
2684
|
+
}
|
|
1142
2685
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1143
2686
|
query,
|
|
1144
2687
|
...options
|
|
@@ -1179,7 +2722,10 @@ var utils = {
|
|
|
1179
2722
|
}
|
|
1180
2723
|
};
|
|
1181
2724
|
async function bulkCreateCustomizations2(customizations, options) {
|
|
1182
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
2725
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
2726
|
+
if (validateRequestSchema) {
|
|
2727
|
+
BulkCreateCustomizationsRequest.parse({ customizations, options });
|
|
2728
|
+
}
|
|
1183
2729
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
1184
2730
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1185
2731
|
customizations,
|
|
@@ -1231,7 +2777,14 @@ async function bulkCreateCustomizations2(customizations, options) {
|
|
|
1231
2777
|
}
|
|
1232
2778
|
}
|
|
1233
2779
|
async function addCustomizationChoices2(customizationId, choices, options) {
|
|
1234
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
2780
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[3];
|
|
2781
|
+
if (validateRequestSchema) {
|
|
2782
|
+
AddCustomizationChoicesRequest.parse({
|
|
2783
|
+
customizationId,
|
|
2784
|
+
choices,
|
|
2785
|
+
options
|
|
2786
|
+
});
|
|
2787
|
+
}
|
|
1235
2788
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
1236
2789
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1237
2790
|
customizationId,
|
|
@@ -1280,7 +2833,14 @@ async function addCustomizationChoices2(customizationId, choices, options) {
|
|
|
1280
2833
|
}
|
|
1281
2834
|
}
|
|
1282
2835
|
async function setCustomizationChoices2(customizationId, choices, options) {
|
|
1283
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
2836
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[3];
|
|
2837
|
+
if (validateRequestSchema) {
|
|
2838
|
+
SetCustomizationChoicesRequest.parse({
|
|
2839
|
+
customizationId,
|
|
2840
|
+
choices,
|
|
2841
|
+
options
|
|
2842
|
+
});
|
|
2843
|
+
}
|
|
1284
2844
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
1285
2845
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1286
2846
|
customizationId,
|
|
@@ -1329,7 +2889,14 @@ async function setCustomizationChoices2(customizationId, choices, options) {
|
|
|
1329
2889
|
}
|
|
1330
2890
|
}
|
|
1331
2891
|
async function removeCustomizationChoices2(customizationId, choiceIds, options) {
|
|
1332
|
-
const { httpClient, sideEffects } = arguments[3];
|
|
2892
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[3];
|
|
2893
|
+
if (validateRequestSchema) {
|
|
2894
|
+
RemoveCustomizationChoicesRequest.parse({
|
|
2895
|
+
customizationId,
|
|
2896
|
+
choiceIds,
|
|
2897
|
+
options
|
|
2898
|
+
});
|
|
2899
|
+
}
|
|
1333
2900
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1334
2901
|
customizationId,
|
|
1335
2902
|
choiceIds,
|
|
@@ -1475,7 +3042,13 @@ async function reorderCustomizationChoices2(customizationId, revision, options)
|
|
|
1475
3042
|
}
|
|
1476
3043
|
}
|
|
1477
3044
|
async function bulkAddCustomizationChoices2(customizationsChoices, options) {
|
|
1478
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
3045
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
3046
|
+
if (validateRequestSchema) {
|
|
3047
|
+
BulkAddCustomizationChoicesRequest.parse({
|
|
3048
|
+
customizationsChoices,
|
|
3049
|
+
options
|
|
3050
|
+
});
|
|
3051
|
+
}
|
|
1479
3052
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
1480
3053
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1481
3054
|
customizationsChoices,
|
|
@@ -1531,7 +3104,10 @@ async function bulkAddCustomizationChoices2(customizationsChoices, options) {
|
|
|
1531
3104
|
}
|
|
1532
3105
|
}
|
|
1533
3106
|
async function bulkUpdateCustomizations2(customizations, options) {
|
|
1534
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
3107
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
3108
|
+
if (validateRequestSchema) {
|
|
3109
|
+
BulkUpdateCustomizationsRequest.parse({ customizations, options });
|
|
3110
|
+
}
|
|
1535
3111
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
1536
3112
|
(0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1537
3113
|
customizations,
|