@wix/auto_sdk_ecom_cart-v-2 1.0.49 → 1.0.51
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 +53 -21
- package/build/cjs/index.js +147 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +978 -79
- package/build/cjs/index.typings.js +138 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +915 -62
- package/build/cjs/meta.js +106 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +53 -21
- package/build/es/index.mjs +143 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +978 -79
- package/build/es/index.typings.mjs +134 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +915 -62
- package/build/es/meta.mjs +102 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +53 -21
- package/build/internal/cjs/index.js +147 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +978 -79
- package/build/internal/cjs/index.typings.js +138 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +915 -62
- package/build/internal/cjs/meta.js +106 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +53 -21
- package/build/internal/es/index.mjs +143 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +978 -79
- package/build/internal/es/index.typings.mjs +134 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +915 -62
- package/build/internal/es/meta.mjs +102 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -30,6 +30,8 @@ __export(index_typings_exports, {
|
|
|
30
30
|
DiscountType: () => DiscountType,
|
|
31
31
|
FallbackReason: () => FallbackReason,
|
|
32
32
|
FileType: () => FileType,
|
|
33
|
+
InvalidCouponReason: () => InvalidCouponReason,
|
|
34
|
+
InvalidGiftCardReason: () => InvalidGiftCardReason,
|
|
33
35
|
ItemStatus: () => ItemStatus,
|
|
34
36
|
ItemTypePreset: () => ItemTypePreset,
|
|
35
37
|
JurisdictionType: () => JurisdictionType,
|
|
@@ -38,6 +40,7 @@ __export(index_typings_exports, {
|
|
|
38
40
|
NameInOther: () => NameInOther,
|
|
39
41
|
PaymentOptionType: () => PaymentOptionType,
|
|
40
42
|
PickupMethod: () => PickupMethod,
|
|
43
|
+
PlatformFeeChargeType: () => PlatformFeeChargeType,
|
|
41
44
|
RateType: () => RateType,
|
|
42
45
|
RuleType: () => RuleType,
|
|
43
46
|
Severity: () => Severity,
|
|
@@ -65,6 +68,7 @@ __export(index_typings_exports, {
|
|
|
65
68
|
removeLineItems: () => removeLineItems2,
|
|
66
69
|
setDeliveryMethod: () => setDeliveryMethod2,
|
|
67
70
|
updateCart: () => updateCart2,
|
|
71
|
+
updateFormSubmissions: () => updateFormSubmissions2,
|
|
68
72
|
updateLineItems: () => updateLineItems2
|
|
69
73
|
});
|
|
70
74
|
module.exports = __toCommonJS(index_typings_exports);
|
|
@@ -1108,6 +1112,59 @@ function handleAsyncCheckoutCompletion(payload) {
|
|
|
1108
1112
|
}
|
|
1109
1113
|
return __handleAsyncCheckoutCompletion;
|
|
1110
1114
|
}
|
|
1115
|
+
function updateFormSubmissions(payload) {
|
|
1116
|
+
function __updateFormSubmissions({ host }) {
|
|
1117
|
+
const metadata = {
|
|
1118
|
+
entityFqdn: "wix.ecom.v2.cart",
|
|
1119
|
+
method: "POST",
|
|
1120
|
+
methodFqn: "wix.ecom.cart.v2.CartService.UpdateFormSubmissions",
|
|
1121
|
+
packageName: PACKAGE_NAME,
|
|
1122
|
+
migrationOptions: {
|
|
1123
|
+
optInTransformResponse: true
|
|
1124
|
+
},
|
|
1125
|
+
url: resolveWixEcomCartV2CartServiceUrl({
|
|
1126
|
+
protoPath: "/v2/carts/{cartId}/update-forms-submission",
|
|
1127
|
+
data: payload,
|
|
1128
|
+
host
|
|
1129
|
+
}),
|
|
1130
|
+
data: payload,
|
|
1131
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
1132
|
+
{
|
|
1133
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
1134
|
+
paths: [
|
|
1135
|
+
{ path: "cart.createdDate" },
|
|
1136
|
+
{ path: "cart.updatedDate" },
|
|
1137
|
+
{
|
|
1138
|
+
path: "cart.lineItems.source.catalogOverrideFields.image.urlExpirationDate"
|
|
1139
|
+
},
|
|
1140
|
+
{ path: "cart.lineItems.attributes.image.urlExpirationDate" },
|
|
1141
|
+
{
|
|
1142
|
+
path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
|
|
1146
|
+
}
|
|
1147
|
+
]
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
transformFn: import_float2.transformRESTFloatToSDKFloat,
|
|
1151
|
+
paths: [
|
|
1152
|
+
{
|
|
1153
|
+
path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
|
|
1154
|
+
},
|
|
1155
|
+
{ path: "cart.lineItems.attributes.physicalProperties.weight" },
|
|
1156
|
+
{ path: "cart.deliveryInfo.address.geocode.latitude" },
|
|
1157
|
+
{ path: "cart.deliveryInfo.address.geocode.longitude" },
|
|
1158
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.latitude" },
|
|
1159
|
+
{ path: "cart.paymentInfo.billingAddress.geocode.longitude" }
|
|
1160
|
+
]
|
|
1161
|
+
}
|
|
1162
|
+
])
|
|
1163
|
+
};
|
|
1164
|
+
return metadata;
|
|
1165
|
+
}
|
|
1166
|
+
return __updateFormSubmissions;
|
|
1167
|
+
}
|
|
1111
1168
|
|
|
1112
1169
|
// src/ecom-v2-cart-cart-v-2.universal.ts
|
|
1113
1170
|
var import_address = require("@wix/sdk-runtime/transformations/address");
|
|
@@ -1259,6 +1316,26 @@ var SuggestedFix = /* @__PURE__ */ ((SuggestedFix2) => {
|
|
|
1259
1316
|
SuggestedFix2["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
|
|
1260
1317
|
return SuggestedFix2;
|
|
1261
1318
|
})(SuggestedFix || {});
|
|
1319
|
+
var InvalidCouponReason = /* @__PURE__ */ ((InvalidCouponReason2) => {
|
|
1320
|
+
InvalidCouponReason2["UNKNOWN_INVALID_COUPON_REASON"] = "UNKNOWN_INVALID_COUPON_REASON";
|
|
1321
|
+
InvalidCouponReason2["EXPIRED"] = "EXPIRED";
|
|
1322
|
+
InvalidCouponReason2["DISABLED"] = "DISABLED";
|
|
1323
|
+
InvalidCouponReason2["INACTIVE"] = "INACTIVE";
|
|
1324
|
+
InvalidCouponReason2["MAX_USAGE_EXCEEDED"] = "MAX_USAGE_EXCEEDED";
|
|
1325
|
+
InvalidCouponReason2["MAX_USAGE_PER_CUSTOMER_EXCEEDED"] = "MAX_USAGE_PER_CUSTOMER_EXCEEDED";
|
|
1326
|
+
InvalidCouponReason2["NOT_APPLICABLE_TO_SUBSCRIPTIONS"] = "NOT_APPLICABLE_TO_SUBSCRIPTIONS";
|
|
1327
|
+
InvalidCouponReason2["NOT_APPLICABLE_TO_SELECTED_LINE_ITEMS"] = "NOT_APPLICABLE_TO_SELECTED_LINE_ITEMS";
|
|
1328
|
+
InvalidCouponReason2["MIN_LINE_ITEM_QUANTITY_NOT_REACHED"] = "MIN_LINE_ITEM_QUANTITY_NOT_REACHED";
|
|
1329
|
+
InvalidCouponReason2["MIN_SUBTOTAL_NOT_REACHED"] = "MIN_SUBTOTAL_NOT_REACHED";
|
|
1330
|
+
return InvalidCouponReason2;
|
|
1331
|
+
})(InvalidCouponReason || {});
|
|
1332
|
+
var InvalidGiftCardReason = /* @__PURE__ */ ((InvalidGiftCardReason2) => {
|
|
1333
|
+
InvalidGiftCardReason2["UNKNOWN_INVALID_GIFT_CARD_REASON"] = "UNKNOWN_INVALID_GIFT_CARD_REASON";
|
|
1334
|
+
InvalidGiftCardReason2["EXPIRED"] = "EXPIRED";
|
|
1335
|
+
InvalidGiftCardReason2["DISABLED"] = "DISABLED";
|
|
1336
|
+
InvalidGiftCardReason2["EMPTY_BALANCE"] = "EMPTY_BALANCE";
|
|
1337
|
+
return InvalidGiftCardReason2;
|
|
1338
|
+
})(InvalidGiftCardReason || {});
|
|
1262
1339
|
var ValidationsConfig = /* @__PURE__ */ ((ValidationsConfig2) => {
|
|
1263
1340
|
ValidationsConfig2["UNKNOWN_VALIDATIONS_CONFIG"] = "UNKNOWN_VALIDATIONS_CONFIG";
|
|
1264
1341
|
ValidationsConfig2["SKIP_VALIDATIONS"] = "SKIP_VALIDATIONS";
|
|
@@ -1330,8 +1407,15 @@ var AdditionalFeeSource = /* @__PURE__ */ ((AdditionalFeeSource2) => {
|
|
|
1330
1407
|
AdditionalFeeSource2["ITEM"] = "ITEM";
|
|
1331
1408
|
AdditionalFeeSource2["MANUAL"] = "MANUAL";
|
|
1332
1409
|
AdditionalFeeSource2["SHIPPING"] = "SHIPPING";
|
|
1410
|
+
AdditionalFeeSource2["PLATFORM_FEE"] = "PLATFORM_FEE";
|
|
1333
1411
|
return AdditionalFeeSource2;
|
|
1334
1412
|
})(AdditionalFeeSource || {});
|
|
1413
|
+
var PlatformFeeChargeType = /* @__PURE__ */ ((PlatformFeeChargeType2) => {
|
|
1414
|
+
PlatformFeeChargeType2["UNKNOWN_CHARGE_TYPE"] = "UNKNOWN_CHARGE_TYPE";
|
|
1415
|
+
PlatformFeeChargeType2["PASS_ON"] = "PASS_ON";
|
|
1416
|
+
PlatformFeeChargeType2["ABSORBED"] = "ABSORBED";
|
|
1417
|
+
return PlatformFeeChargeType2;
|
|
1418
|
+
})(PlatformFeeChargeType || {});
|
|
1335
1419
|
async function createCart2(options) {
|
|
1336
1420
|
const { httpClient, sideEffects } = arguments[1];
|
|
1337
1421
|
const payload = (0, import_transform_paths2.transformPaths)(
|
|
@@ -2182,6 +2266,56 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
2182
2266
|
throw transformedError;
|
|
2183
2267
|
}
|
|
2184
2268
|
}
|
|
2269
|
+
async function updateFormSubmissions2(cartId, options) {
|
|
2270
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
2271
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
2272
|
+
cartId,
|
|
2273
|
+
formSubmissions: options?.formSubmissions
|
|
2274
|
+
});
|
|
2275
|
+
const reqOpts = updateFormSubmissions(payload);
|
|
2276
|
+
sideEffects?.onSiteCall?.();
|
|
2277
|
+
try {
|
|
2278
|
+
const result = await httpClient.request(reqOpts);
|
|
2279
|
+
sideEffects?.onSuccess?.(result);
|
|
2280
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
2281
|
+
(0, import_transform_paths2.transformPaths)(result.data, [
|
|
2282
|
+
{
|
|
2283
|
+
transformFn: import_image2.transformRESTImageToSDKImage,
|
|
2284
|
+
paths: [
|
|
2285
|
+
{ path: "cart.lineItems.source.catalogOverrideFields.image" },
|
|
2286
|
+
{ path: "cart.lineItems.attributes.image" }
|
|
2287
|
+
]
|
|
2288
|
+
},
|
|
2289
|
+
{
|
|
2290
|
+
transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
|
|
2291
|
+
paths: [{ path: "cart.lineItems.attributes.url" }]
|
|
2292
|
+
},
|
|
2293
|
+
{
|
|
2294
|
+
transformFn: import_address2.transformRESTAddressToSDKAddress,
|
|
2295
|
+
paths: [
|
|
2296
|
+
{ path: "cart.deliveryInfo.address" },
|
|
2297
|
+
{ path: "cart.paymentInfo.billingAddress" }
|
|
2298
|
+
]
|
|
2299
|
+
}
|
|
2300
|
+
])
|
|
2301
|
+
);
|
|
2302
|
+
} catch (err) {
|
|
2303
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
2304
|
+
err,
|
|
2305
|
+
{
|
|
2306
|
+
spreadPathsToArguments: {},
|
|
2307
|
+
explicitPathsToArguments: {
|
|
2308
|
+
cartId: "$[0]",
|
|
2309
|
+
formSubmissions: "$[1].formSubmissions"
|
|
2310
|
+
},
|
|
2311
|
+
singleArgumentUnchanged: false
|
|
2312
|
+
},
|
|
2313
|
+
["cartId", "options"]
|
|
2314
|
+
);
|
|
2315
|
+
sideEffects?.onError?.(err);
|
|
2316
|
+
throw transformedError;
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2185
2319
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2186
2320
|
0 && (module.exports = {
|
|
2187
2321
|
AdditionalFeeSource,
|
|
@@ -2194,6 +2328,8 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
2194
2328
|
DiscountType,
|
|
2195
2329
|
FallbackReason,
|
|
2196
2330
|
FileType,
|
|
2331
|
+
InvalidCouponReason,
|
|
2332
|
+
InvalidGiftCardReason,
|
|
2197
2333
|
ItemStatus,
|
|
2198
2334
|
ItemTypePreset,
|
|
2199
2335
|
JurisdictionType,
|
|
@@ -2202,6 +2338,7 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
2202
2338
|
NameInOther,
|
|
2203
2339
|
PaymentOptionType,
|
|
2204
2340
|
PickupMethod,
|
|
2341
|
+
PlatformFeeChargeType,
|
|
2205
2342
|
RateType,
|
|
2206
2343
|
RuleType,
|
|
2207
2344
|
Severity,
|
|
@@ -2229,6 +2366,7 @@ async function handleAsyncCheckoutCompletion2(token) {
|
|
|
2229
2366
|
removeLineItems,
|
|
2230
2367
|
setDeliveryMethod,
|
|
2231
2368
|
updateCart,
|
|
2369
|
+
updateFormSubmissions,
|
|
2232
2370
|
updateLineItems
|
|
2233
2371
|
});
|
|
2234
2372
|
//# sourceMappingURL=index.typings.js.map
|