@wix/auto_sdk_ecom_cart 1.0.13 → 1.0.14
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/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-BIIZxJYL.d.mts} +504 -269
- package/build/{internal/cjs/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-BIIZxJYL.d.ts} +504 -269
- package/build/index.d.mts +149 -0
- package/build/index.d.ts +149 -0
- package/build/index.js +1938 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +1875 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/{es/src/ecom-v1-cart-cart.types.d.ts → ecom-v1-cart-cart.universal-CJdmyIWv.d.mts} +668 -269
- package/build/{es/src/ecom-v1-cart-cart.types.d.ts → internal/ecom-v1-cart-cart.universal-CJdmyIWv.d.ts} +668 -269
- package/build/internal/index.d.mts +160 -0
- package/build/internal/index.d.ts +160 -0
- package/build/internal/index.js +1938 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +1875 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +2050 -0
- package/build/internal/meta.d.ts +2050 -0
- package/build/internal/meta.js +1027 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +989 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/meta.d.mts +2050 -0
- package/build/meta.d.ts +2050 -0
- package/build/meta.js +1027 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +989 -0
- package/build/meta.mjs.map +1 -0
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/ecom-v1-cart-cart.context.d.ts +0 -29
- package/build/cjs/src/ecom-v1-cart-cart.context.js +0 -59
- package/build/cjs/src/ecom-v1-cart-cart.context.js.map +0 -1
- package/build/cjs/src/ecom-v1-cart-cart.http.d.ts +0 -60
- package/build/cjs/src/ecom-v1-cart-cart.http.js +0 -818
- package/build/cjs/src/ecom-v1-cart-cart.http.js.map +0 -1
- package/build/cjs/src/ecom-v1-cart-cart.meta.d.ts +0 -46
- package/build/cjs/src/ecom-v1-cart-cart.meta.js +0 -256
- package/build/cjs/src/ecom-v1-cart-cart.meta.js.map +0 -1
- package/build/cjs/src/ecom-v1-cart-cart.public.d.ts +0 -129
- package/build/cjs/src/ecom-v1-cart-cart.public.js +0 -227
- package/build/cjs/src/ecom-v1-cart-cart.public.js.map +0 -1
- package/build/cjs/src/ecom-v1-cart-cart.types.js +0 -255
- package/build/cjs/src/ecom-v1-cart-cart.types.js.map +0 -1
- package/build/cjs/src/ecom-v1-cart-cart.universal.d.ts +0 -3263
- package/build/cjs/src/ecom-v1-cart-cart.universal.js +0 -1192
- package/build/cjs/src/ecom-v1-cart-cart.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/ecom-v1-cart-cart.context.d.ts +0 -29
- package/build/es/src/ecom-v1-cart-cart.context.js +0 -31
- package/build/es/src/ecom-v1-cart-cart.context.js.map +0 -1
- package/build/es/src/ecom-v1-cart-cart.http.d.ts +0 -60
- package/build/es/src/ecom-v1-cart-cart.http.js +0 -803
- package/build/es/src/ecom-v1-cart-cart.http.js.map +0 -1
- package/build/es/src/ecom-v1-cart-cart.meta.d.ts +0 -46
- package/build/es/src/ecom-v1-cart-cart.meta.js +0 -218
- package/build/es/src/ecom-v1-cart-cart.meta.js.map +0 -1
- package/build/es/src/ecom-v1-cart-cart.public.d.ts +0 -129
- package/build/es/src/ecom-v1-cart-cart.public.js +0 -187
- package/build/es/src/ecom-v1-cart-cart.public.js.map +0 -1
- package/build/es/src/ecom-v1-cart-cart.types.js +0 -252
- package/build/es/src/ecom-v1-cart-cart.types.js.map +0 -1
- package/build/es/src/ecom-v1-cart-cart.universal.d.ts +0 -3263
- package/build/es/src/ecom-v1-cart-cart.universal.js +0 -1154
- package/build/es/src/ecom-v1-cart-cart.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-cart-cart.context.d.ts +0 -31
- package/build/internal/cjs/src/ecom-v1-cart-cart.context.js +0 -59
- package/build/internal/cjs/src/ecom-v1-cart-cart.context.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-cart-cart.http.d.ts +0 -60
- package/build/internal/cjs/src/ecom-v1-cart-cart.http.js +0 -818
- package/build/internal/cjs/src/ecom-v1-cart-cart.http.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-cart-cart.meta.d.ts +0 -46
- package/build/internal/cjs/src/ecom-v1-cart-cart.meta.js +0 -256
- package/build/internal/cjs/src/ecom-v1-cart-cart.meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-cart-cart.public.d.ts +0 -138
- package/build/internal/cjs/src/ecom-v1-cart-cart.public.js +0 -227
- package/build/internal/cjs/src/ecom-v1-cart-cart.public.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-cart-cart.types.js +0 -255
- package/build/internal/cjs/src/ecom-v1-cart-cart.types.js.map +0 -1
- package/build/internal/cjs/src/ecom-v1-cart-cart.universal.d.ts +0 -3457
- package/build/internal/cjs/src/ecom-v1-cart-cart.universal.js +0 -1192
- package/build/internal/cjs/src/ecom-v1-cart-cart.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/ecom-v1-cart-cart.context.d.ts +0 -31
- package/build/internal/es/src/ecom-v1-cart-cart.context.js +0 -31
- package/build/internal/es/src/ecom-v1-cart-cart.context.js.map +0 -1
- package/build/internal/es/src/ecom-v1-cart-cart.http.d.ts +0 -60
- package/build/internal/es/src/ecom-v1-cart-cart.http.js +0 -803
- package/build/internal/es/src/ecom-v1-cart-cart.http.js.map +0 -1
- package/build/internal/es/src/ecom-v1-cart-cart.meta.d.ts +0 -46
- package/build/internal/es/src/ecom-v1-cart-cart.meta.js +0 -218
- package/build/internal/es/src/ecom-v1-cart-cart.meta.js.map +0 -1
- package/build/internal/es/src/ecom-v1-cart-cart.public.d.ts +0 -138
- package/build/internal/es/src/ecom-v1-cart-cart.public.js +0 -187
- package/build/internal/es/src/ecom-v1-cart-cart.public.js.map +0 -1
- package/build/internal/es/src/ecom-v1-cart-cart.types.js +0 -252
- package/build/internal/es/src/ecom-v1-cart-cart.types.js.map +0 -1
- package/build/internal/es/src/ecom-v1-cart-cart.universal.d.ts +0 -3457
- package/build/internal/es/src/ecom-v1-cart-cart.universal.js +0 -1154
- package/build/internal/es/src/ecom-v1-cart-cart.universal.js.map +0 -1
|
@@ -1,1192 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.removeBusinessLocation = exports.deleteCart = exports.estimateTotals = exports.updateLineItemsQuantity = exports.removeCoupon = exports.createCheckout = exports.removeLineItems = exports.addToCart = exports.getCartByCheckoutId = exports.getCart = exports.updateCart = exports.createCart = exports.WebhookIdentityType = exports.ChannelType = exports.SuggestedFix = exports.NameInLineItem = exports.NameInOther = exports.Severity = exports.AdditionalFeeSource = exports.RuleType = exports.AppliedDiscountDiscountType = exports.ChargeType = exports.PickupMethod = exports.FallbackReason = exports.ManualCalculationReason = exports.RateType = exports.JurisdictionType = exports.VatType = exports.DiscountType = exports.WeightUnit = exports.TaxableAddressType = exports.PaymentOptionType = exports.FileType = exports.SubscriptionFrequency = exports.ItemTypeItemType = exports.ItemAvailabilityStatus = exports.DescriptionLineType = void 0;
|
|
27
|
-
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
28
|
-
const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
29
|
-
const ambassadorWixEcomV1Cart = __importStar(require("./ecom-v1-cart-cart.http.js"));
|
|
30
|
-
const address_1 = require("@wix/sdk-runtime/transformations/address");
|
|
31
|
-
const address_2 = require("@wix/sdk-runtime/transformations/address");
|
|
32
|
-
const image_1 = require("@wix/sdk-runtime/transformations/image");
|
|
33
|
-
const image_2 = require("@wix/sdk-runtime/transformations/image");
|
|
34
|
-
const page_url_v2_1 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
35
|
-
const page_url_v2_2 = require("@wix/sdk-runtime/transformations/page-url-v2");
|
|
36
|
-
const transform_paths_1 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
37
|
-
var DescriptionLineType;
|
|
38
|
-
(function (DescriptionLineType) {
|
|
39
|
-
/** Unrecognized type. */
|
|
40
|
-
DescriptionLineType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
41
|
-
/** Plain text type. */
|
|
42
|
-
DescriptionLineType["PLAIN_TEXT"] = "PLAIN_TEXT";
|
|
43
|
-
/** Color type. */
|
|
44
|
-
DescriptionLineType["COLOR"] = "COLOR";
|
|
45
|
-
})(DescriptionLineType || (exports.DescriptionLineType = DescriptionLineType = {}));
|
|
46
|
-
var ItemAvailabilityStatus;
|
|
47
|
-
(function (ItemAvailabilityStatus) {
|
|
48
|
-
ItemAvailabilityStatus["AVAILABLE"] = "AVAILABLE";
|
|
49
|
-
/** Item does not exist. */
|
|
50
|
-
ItemAvailabilityStatus["NOT_FOUND"] = "NOT_FOUND";
|
|
51
|
-
/** Item is not in stock. */
|
|
52
|
-
ItemAvailabilityStatus["NOT_AVAILABLE"] = "NOT_AVAILABLE";
|
|
53
|
-
/** Available quantity is less than requested. */
|
|
54
|
-
ItemAvailabilityStatus["PARTIALLY_AVAILABLE"] = "PARTIALLY_AVAILABLE";
|
|
55
|
-
})(ItemAvailabilityStatus || (exports.ItemAvailabilityStatus = ItemAvailabilityStatus = {}));
|
|
56
|
-
var ItemTypeItemType;
|
|
57
|
-
(function (ItemTypeItemType) {
|
|
58
|
-
ItemTypeItemType["UNRECOGNISED"] = "UNRECOGNISED";
|
|
59
|
-
ItemTypeItemType["PHYSICAL"] = "PHYSICAL";
|
|
60
|
-
ItemTypeItemType["DIGITAL"] = "DIGITAL";
|
|
61
|
-
ItemTypeItemType["GIFT_CARD"] = "GIFT_CARD";
|
|
62
|
-
ItemTypeItemType["SERVICE"] = "SERVICE";
|
|
63
|
-
})(ItemTypeItemType || (exports.ItemTypeItemType = ItemTypeItemType = {}));
|
|
64
|
-
/** Frequency unit of recurring payment */
|
|
65
|
-
var SubscriptionFrequency;
|
|
66
|
-
(function (SubscriptionFrequency) {
|
|
67
|
-
SubscriptionFrequency["UNDEFINED"] = "UNDEFINED";
|
|
68
|
-
SubscriptionFrequency["DAY"] = "DAY";
|
|
69
|
-
SubscriptionFrequency["WEEK"] = "WEEK";
|
|
70
|
-
SubscriptionFrequency["MONTH"] = "MONTH";
|
|
71
|
-
SubscriptionFrequency["YEAR"] = "YEAR";
|
|
72
|
-
})(SubscriptionFrequency || (exports.SubscriptionFrequency = SubscriptionFrequency = {}));
|
|
73
|
-
var FileType;
|
|
74
|
-
(function (FileType) {
|
|
75
|
-
FileType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
76
|
-
FileType["SECURE_PICTURE"] = "SECURE_PICTURE";
|
|
77
|
-
FileType["SECURE_VIDEO"] = "SECURE_VIDEO";
|
|
78
|
-
FileType["SECURE_DOCUMENT"] = "SECURE_DOCUMENT";
|
|
79
|
-
FileType["SECURE_MUSIC"] = "SECURE_MUSIC";
|
|
80
|
-
FileType["SECURE_ARCHIVE"] = "SECURE_ARCHIVE";
|
|
81
|
-
})(FileType || (exports.FileType = FileType = {}));
|
|
82
|
-
/** Type of selected payment option for catalog item */
|
|
83
|
-
var PaymentOptionType;
|
|
84
|
-
(function (PaymentOptionType) {
|
|
85
|
-
/** The entire payment for this item happens as part of the checkout. */
|
|
86
|
-
PaymentOptionType["FULL_PAYMENT_ONLINE"] = "FULL_PAYMENT_ONLINE";
|
|
87
|
-
/** The entire payment for this item happens after checkout. For example, when using cash, check, or other offline payment methods. */
|
|
88
|
-
PaymentOptionType["FULL_PAYMENT_OFFLINE"] = "FULL_PAYMENT_OFFLINE";
|
|
89
|
-
/** Payment for this item is done by charging a membership. When selected, `price` is `0`. */
|
|
90
|
-
PaymentOptionType["MEMBERSHIP"] = "MEMBERSHIP";
|
|
91
|
-
/** Partial payment to be paid upfront during checkout. The initial amount to be paid for each line item is specified in `depositAmount`. */
|
|
92
|
-
PaymentOptionType["DEPOSIT_ONLINE"] = "DEPOSIT_ONLINE";
|
|
93
|
-
/** Payment for this item can only be done by charging a membership and must be manually redeemed in the dashboard by the site admin. When selected, `price` is `0`. */
|
|
94
|
-
PaymentOptionType["MEMBERSHIP_OFFLINE"] = "MEMBERSHIP_OFFLINE";
|
|
95
|
-
})(PaymentOptionType || (exports.PaymentOptionType = PaymentOptionType = {}));
|
|
96
|
-
var TaxableAddressType;
|
|
97
|
-
(function (TaxableAddressType) {
|
|
98
|
-
TaxableAddressType["UNKNOWN_TAXABLE_ADDRESS"] = "UNKNOWN_TAXABLE_ADDRESS";
|
|
99
|
-
TaxableAddressType["BUSINESS"] = "BUSINESS";
|
|
100
|
-
TaxableAddressType["BILLING"] = "BILLING";
|
|
101
|
-
TaxableAddressType["SHIPPING"] = "SHIPPING";
|
|
102
|
-
})(TaxableAddressType || (exports.TaxableAddressType = TaxableAddressType = {}));
|
|
103
|
-
var WeightUnit;
|
|
104
|
-
(function (WeightUnit) {
|
|
105
|
-
/** Weight unit can't be classified due to an error. */
|
|
106
|
-
WeightUnit["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
107
|
-
/** Kilograms. */
|
|
108
|
-
WeightUnit["KG"] = "KG";
|
|
109
|
-
/** Pounds. */
|
|
110
|
-
WeightUnit["LB"] = "LB";
|
|
111
|
-
})(WeightUnit || (exports.WeightUnit = WeightUnit = {}));
|
|
112
|
-
var DiscountType;
|
|
113
|
-
(function (DiscountType) {
|
|
114
|
-
/** "GLOBAL" - discount applies to entire order. */
|
|
115
|
-
DiscountType["GLOBAL"] = "GLOBAL";
|
|
116
|
-
/** "SPECIFIC-ITEMS" - discount applies to specific items. */
|
|
117
|
-
DiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
|
|
118
|
-
/** "SHIPPING" - discount applies to shipping. For example, free shipping. */
|
|
119
|
-
DiscountType["SHIPPING"] = "SHIPPING";
|
|
120
|
-
})(DiscountType || (exports.DiscountType = DiscountType = {}));
|
|
121
|
-
/** tax info types */
|
|
122
|
-
var VatType;
|
|
123
|
-
(function (VatType) {
|
|
124
|
-
VatType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
125
|
-
/** CPF - for individual tax payers. */
|
|
126
|
-
VatType["CPF"] = "CPF";
|
|
127
|
-
/** CNPJ - for corporations */
|
|
128
|
-
VatType["CNPJ"] = "CNPJ";
|
|
129
|
-
})(VatType || (exports.VatType = VatType = {}));
|
|
130
|
-
/** JurisdictionType represents the type of the jurisdiction in which this tax detail applies (e.g. Country,State,County,City,Special). */
|
|
131
|
-
var JurisdictionType;
|
|
132
|
-
(function (JurisdictionType) {
|
|
133
|
-
JurisdictionType["UNDEFINED"] = "UNDEFINED";
|
|
134
|
-
JurisdictionType["COUNTRY"] = "COUNTRY";
|
|
135
|
-
JurisdictionType["STATE"] = "STATE";
|
|
136
|
-
JurisdictionType["COUNTY"] = "COUNTY";
|
|
137
|
-
JurisdictionType["CITY"] = "CITY";
|
|
138
|
-
JurisdictionType["SPECIAL"] = "SPECIAL";
|
|
139
|
-
})(JurisdictionType || (exports.JurisdictionType = JurisdictionType = {}));
|
|
140
|
-
var RateType;
|
|
141
|
-
(function (RateType) {
|
|
142
|
-
/** no tax being collected for this request due to location of purchase */
|
|
143
|
-
RateType["NO_TAX_COLLECTED"] = "NO_TAX_COLLECTED";
|
|
144
|
-
/** manual rate used for calculation */
|
|
145
|
-
RateType["MANUAL_RATE"] = "MANUAL_RATE";
|
|
146
|
-
/** autotax rate used for calculation */
|
|
147
|
-
RateType["AUTO_RATE"] = "AUTO_RATE";
|
|
148
|
-
/** fallback rate used for calculation */
|
|
149
|
-
RateType["FALLBACK_RATE"] = "FALLBACK_RATE";
|
|
150
|
-
})(RateType || (exports.RateType = RateType = {}));
|
|
151
|
-
var ManualCalculationReason;
|
|
152
|
-
(function (ManualCalculationReason) {
|
|
153
|
-
/** user set calculator in Business Manager to be Manual */
|
|
154
|
-
ManualCalculationReason["GLOBAL_SETTING_TO_MANUAL"] = "GLOBAL_SETTING_TO_MANUAL";
|
|
155
|
-
/** specific region is on manual even though Global setting is Auto-tax */
|
|
156
|
-
ManualCalculationReason["REGION_SETTING_TO_MANUAL"] = "REGION_SETTING_TO_MANUAL";
|
|
157
|
-
})(ManualCalculationReason || (exports.ManualCalculationReason = ManualCalculationReason = {}));
|
|
158
|
-
var FallbackReason;
|
|
159
|
-
(function (FallbackReason) {
|
|
160
|
-
/** auto-tax failed to be calculated */
|
|
161
|
-
FallbackReason["AUTO_TAX_FAILED"] = "AUTO_TAX_FAILED";
|
|
162
|
-
/** auto-tax was temporarily deactivated on a system-level */
|
|
163
|
-
FallbackReason["AUTO_TAX_DEACTIVATED"] = "AUTO_TAX_DEACTIVATED";
|
|
164
|
-
})(FallbackReason || (exports.FallbackReason = FallbackReason = {}));
|
|
165
|
-
var PickupMethod;
|
|
166
|
-
(function (PickupMethod) {
|
|
167
|
-
PickupMethod["UNKNOWN_METHOD"] = "UNKNOWN_METHOD";
|
|
168
|
-
PickupMethod["STORE_PICKUP"] = "STORE_PICKUP";
|
|
169
|
-
PickupMethod["PICKUP_POINT"] = "PICKUP_POINT";
|
|
170
|
-
})(PickupMethod || (exports.PickupMethod = PickupMethod = {}));
|
|
171
|
-
var ChargeType;
|
|
172
|
-
(function (ChargeType) {
|
|
173
|
-
ChargeType["HANDLING_FEE"] = "HANDLING_FEE";
|
|
174
|
-
ChargeType["INSURANCE"] = "INSURANCE";
|
|
175
|
-
})(ChargeType || (exports.ChargeType = ChargeType = {}));
|
|
176
|
-
var AppliedDiscountDiscountType;
|
|
177
|
-
(function (AppliedDiscountDiscountType) {
|
|
178
|
-
AppliedDiscountDiscountType["GLOBAL"] = "GLOBAL";
|
|
179
|
-
AppliedDiscountDiscountType["SPECIFIC_ITEMS"] = "SPECIFIC_ITEMS";
|
|
180
|
-
AppliedDiscountDiscountType["SHIPPING"] = "SHIPPING";
|
|
181
|
-
})(AppliedDiscountDiscountType || (exports.AppliedDiscountDiscountType = AppliedDiscountDiscountType = {}));
|
|
182
|
-
var RuleType;
|
|
183
|
-
(function (RuleType) {
|
|
184
|
-
RuleType["VALIDATION"] = "VALIDATION";
|
|
185
|
-
RuleType["OTHER"] = "OTHER";
|
|
186
|
-
RuleType["MAX"] = "MAX";
|
|
187
|
-
RuleType["MIN"] = "MIN";
|
|
188
|
-
RuleType["MAX_LENGTH"] = "MAX_LENGTH";
|
|
189
|
-
RuleType["MIN_LENGTH"] = "MIN_LENGTH";
|
|
190
|
-
RuleType["MAX_SIZE"] = "MAX_SIZE";
|
|
191
|
-
RuleType["MIN_SIZE"] = "MIN_SIZE";
|
|
192
|
-
RuleType["FORMAT"] = "FORMAT";
|
|
193
|
-
RuleType["DECIMAL_LTE"] = "DECIMAL_LTE";
|
|
194
|
-
RuleType["DECIMAL_GTE"] = "DECIMAL_GTE";
|
|
195
|
-
RuleType["DECIMAL_LT"] = "DECIMAL_LT";
|
|
196
|
-
RuleType["DECIMAL_GT"] = "DECIMAL_GT";
|
|
197
|
-
RuleType["DECIMAL_MAX_SCALE"] = "DECIMAL_MAX_SCALE";
|
|
198
|
-
RuleType["INVALID_ENUM_VALUE"] = "INVALID_ENUM_VALUE";
|
|
199
|
-
RuleType["REQUIRED_FIELD"] = "REQUIRED_FIELD";
|
|
200
|
-
RuleType["FIELD_NOT_ALLOWED"] = "FIELD_NOT_ALLOWED";
|
|
201
|
-
RuleType["ONE_OF_ALIGNMENT"] = "ONE_OF_ALIGNMENT";
|
|
202
|
-
RuleType["EXACT_LENGTH"] = "EXACT_LENGTH";
|
|
203
|
-
RuleType["EXACT_SIZE"] = "EXACT_SIZE";
|
|
204
|
-
RuleType["REQUIRED_ONE_OF_FIELD"] = "REQUIRED_ONE_OF_FIELD";
|
|
205
|
-
})(RuleType || (exports.RuleType = RuleType = {}));
|
|
206
|
-
var AdditionalFeeSource;
|
|
207
|
-
(function (AdditionalFeeSource) {
|
|
208
|
-
AdditionalFeeSource["UNKNOWN_ADDITIONAL_FEE_SOURCE"] = "UNKNOWN_ADDITIONAL_FEE_SOURCE";
|
|
209
|
-
/** The additional fee was added by an additional fee service plugin */
|
|
210
|
-
AdditionalFeeSource["SERVICE_PLUGIN"] = "SERVICE_PLUGIN";
|
|
211
|
-
/** The additional fee was added on the item either via the catalog or on custom line item */
|
|
212
|
-
AdditionalFeeSource["ITEM"] = "ITEM";
|
|
213
|
-
/** The additional fee was added manually on the request */
|
|
214
|
-
AdditionalFeeSource["MANUAL"] = "MANUAL";
|
|
215
|
-
})(AdditionalFeeSource || (exports.AdditionalFeeSource = AdditionalFeeSource = {}));
|
|
216
|
-
var Severity;
|
|
217
|
-
(function (Severity) {
|
|
218
|
-
/** The user is allowed to move forward in the flow. */
|
|
219
|
-
Severity["WARNING"] = "WARNING";
|
|
220
|
-
/**
|
|
221
|
-
* The user is blocked from moving forward in the flow.
|
|
222
|
-
* For example, if callerContext is CART - moving to checkout is blocked. if callerContext is CHECKOUT, placing an order is blocked.
|
|
223
|
-
*/
|
|
224
|
-
Severity["ERROR"] = "ERROR";
|
|
225
|
-
})(Severity || (exports.Severity = Severity = {}));
|
|
226
|
-
/** Available locations on the webpage */
|
|
227
|
-
var NameInOther;
|
|
228
|
-
(function (NameInOther) {
|
|
229
|
-
/** Default location, in case no specific location is specified. */
|
|
230
|
-
NameInOther["OTHER_DEFAULT"] = "OTHER_DEFAULT";
|
|
231
|
-
})(NameInOther || (exports.NameInOther = NameInOther = {}));
|
|
232
|
-
/** Available locations on the line item */
|
|
233
|
-
var NameInLineItem;
|
|
234
|
-
(function (NameInLineItem) {
|
|
235
|
-
/** Default location, in case no specific location is specified. */
|
|
236
|
-
NameInLineItem["LINE_ITEM_DEFAULT"] = "LINE_ITEM_DEFAULT";
|
|
237
|
-
})(NameInLineItem || (exports.NameInLineItem = NameInLineItem = {}));
|
|
238
|
-
var SuggestedFix;
|
|
239
|
-
(function (SuggestedFix) {
|
|
240
|
-
/** No suggested fix is specified. The user should refer to the violation description to resolve the issue. */
|
|
241
|
-
SuggestedFix["UNKNOWN_SUGGESTED_FIX"] = "UNKNOWN_SUGGESTED_FIX";
|
|
242
|
-
/** The line item should be removed from the cart or checkout to resolve the violation. */
|
|
243
|
-
SuggestedFix["REMOVE_LINE_ITEM"] = "REMOVE_LINE_ITEM";
|
|
244
|
-
})(SuggestedFix || (exports.SuggestedFix = SuggestedFix = {}));
|
|
245
|
-
var ChannelType;
|
|
246
|
-
(function (ChannelType) {
|
|
247
|
-
/** Unspecified sales channel. This value is not supported. */
|
|
248
|
-
ChannelType["UNSPECIFIED"] = "UNSPECIFIED";
|
|
249
|
-
/** A web client. */
|
|
250
|
-
ChannelType["WEB"] = "WEB";
|
|
251
|
-
/** [Point of sale solutions](https://support.wix.com/en/wix-mobile-pos-2196395). */
|
|
252
|
-
ChannelType["POS"] = "POS";
|
|
253
|
-
/** [eBay shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-ebay-shop). */
|
|
254
|
-
ChannelType["EBAY"] = "EBAY";
|
|
255
|
-
/** [Amazon shop](https://support.wix.com/en/article/wix-stores-connecting-and-setting-up-an-amazon-shop). */
|
|
256
|
-
ChannelType["AMAZON"] = "AMAZON";
|
|
257
|
-
/** Other sales platform. */
|
|
258
|
-
ChannelType["OTHER_PLATFORM"] = "OTHER_PLATFORM";
|
|
259
|
-
/** [Wix Owner app](https://support.wix.com/article/wix-owner-app-an-overview). */
|
|
260
|
-
ChannelType["WIX_APP_STORE"] = "WIX_APP_STORE";
|
|
261
|
-
/** Wix Invoices app in [your dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Finvoices/settings/general-settings) */
|
|
262
|
-
ChannelType["WIX_INVOICES"] = "WIX_INVOICES";
|
|
263
|
-
/** Wix merchant backoffice. */
|
|
264
|
-
ChannelType["BACKOFFICE_MERCHANT"] = "BACKOFFICE_MERCHANT";
|
|
265
|
-
/** Wish sales channel. */
|
|
266
|
-
ChannelType["WISH"] = "WISH";
|
|
267
|
-
/** [ClassPass sales channel](https://support.wix.com/en/article/wix-bookings-letting-clients-book-your-services-with-classpass). */
|
|
268
|
-
ChannelType["CLASS_PASS"] = "CLASS_PASS";
|
|
269
|
-
/** Global-E sales channel. */
|
|
270
|
-
ChannelType["GLOBAL_E"] = "GLOBAL_E";
|
|
271
|
-
/** [Facebook shop](https://support.wix.com/en/article/wix-stores-changes-to-facebook-shops). */
|
|
272
|
-
ChannelType["FACEBOOK"] = "FACEBOOK";
|
|
273
|
-
/** [Etsy sales channel](https://support.wix.com/en/article/wix-stores-request-adding-etsy-as-a-sales-channel). */
|
|
274
|
-
ChannelType["ETSY"] = "ETSY";
|
|
275
|
-
/** [TikTok sales channel](https://support.wix.com/en/article/wix-stores-request-adding-tiktok-as-a-sales-channel). */
|
|
276
|
-
ChannelType["TIKTOK"] = "TIKTOK";
|
|
277
|
-
/** [Faire marketplace integration](https://support.wix.com/en/article/wix-stores-creating-a-faire-store-using-the-faire-integration-app). */
|
|
278
|
-
ChannelType["FAIRE_COM"] = "FAIRE_COM";
|
|
279
|
-
})(ChannelType || (exports.ChannelType = ChannelType = {}));
|
|
280
|
-
var WebhookIdentityType;
|
|
281
|
-
(function (WebhookIdentityType) {
|
|
282
|
-
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
|
283
|
-
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
284
|
-
WebhookIdentityType["MEMBER"] = "MEMBER";
|
|
285
|
-
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
|
286
|
-
WebhookIdentityType["APP"] = "APP";
|
|
287
|
-
})(WebhookIdentityType || (exports.WebhookIdentityType = WebhookIdentityType = {}));
|
|
288
|
-
/**
|
|
289
|
-
* Creates a cart.
|
|
290
|
-
*
|
|
291
|
-
* > **Note:** When adding catalog line items, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
|
|
292
|
-
* @public
|
|
293
|
-
* @requiredField options.customLineItems.descriptionLines.name
|
|
294
|
-
* @requiredField options.customLineItems.descriptionLines.value
|
|
295
|
-
* @requiredField options.customLineItems.itemType
|
|
296
|
-
* @requiredField options.customLineItems.price
|
|
297
|
-
* @requiredField options.customLineItems.productName
|
|
298
|
-
* @requiredField options.customLineItems.quantity
|
|
299
|
-
* @requiredField options.lineItems.catalogReference
|
|
300
|
-
* @requiredField options.lineItems.quantity
|
|
301
|
-
* @requiredField options.lineItems.selectedMembership._id
|
|
302
|
-
* @requiredField options.lineItems.selectedMembership.appId
|
|
303
|
-
* @param options - Cart creation options.
|
|
304
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
305
|
-
* @permissionId ECOM.ADMIN_MODIFY_CARTS
|
|
306
|
-
* @permissionScope Manage Stores - all permissions
|
|
307
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
308
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
309
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
310
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
311
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
312
|
-
* @permissionScope Picasso private app mega scope
|
|
313
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
314
|
-
* @permissionScope Manage Stores - all permissions
|
|
315
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
316
|
-
* @permissionScope Manage eCommerce - Admin Permissions
|
|
317
|
-
* @permissionScopeId SCOPE.ECOM.MANAGE-ADMIN
|
|
318
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
319
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
320
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
321
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
322
|
-
* @permissionScope Picasso private app mega scope
|
|
323
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
324
|
-
* @applicableIdentity APP
|
|
325
|
-
* @applicableIdentity VISITOR
|
|
326
|
-
* @returns Cart.
|
|
327
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.CreateCart
|
|
328
|
-
*/
|
|
329
|
-
async function createCart(options) {
|
|
330
|
-
// @ts-ignore
|
|
331
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
332
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
333
|
-
cartInfo: options?.cartInfo,
|
|
334
|
-
couponCode: options?.couponCode,
|
|
335
|
-
merchantDiscounts: options?.merchantDiscounts,
|
|
336
|
-
lineItems: options?.lineItems,
|
|
337
|
-
customLineItems: options?.customLineItems,
|
|
338
|
-
}), [
|
|
339
|
-
{
|
|
340
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
341
|
-
paths: [
|
|
342
|
-
{ path: 'cartInfo.lineItems.url' },
|
|
343
|
-
{ path: 'lineItems.url' },
|
|
344
|
-
{ path: 'customLineItems.url' },
|
|
345
|
-
],
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
349
|
-
paths: [
|
|
350
|
-
{ path: 'cartInfo.lineItems.image' },
|
|
351
|
-
{ path: 'cartInfo.lineItems.catalogOverrideFields.image' },
|
|
352
|
-
{ path: 'lineItems.image' },
|
|
353
|
-
{ path: 'lineItems.catalogOverrideFields.image' },
|
|
354
|
-
{ path: 'customLineItems.media' },
|
|
355
|
-
],
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
359
|
-
paths: [{ path: 'cartInfo.contactInfo.address' }],
|
|
360
|
-
},
|
|
361
|
-
]);
|
|
362
|
-
const reqOpts = ambassadorWixEcomV1Cart.createCart(payload);
|
|
363
|
-
sideEffects?.onSiteCall?.();
|
|
364
|
-
try {
|
|
365
|
-
const result = await httpClient.request(reqOpts);
|
|
366
|
-
sideEffects?.onSuccess?.(result);
|
|
367
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
368
|
-
{
|
|
369
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
370
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
374
|
-
paths: [
|
|
375
|
-
{ path: 'cart.lineItems.image' },
|
|
376
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
377
|
-
],
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
381
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
382
|
-
},
|
|
383
|
-
]))?.cart;
|
|
384
|
-
}
|
|
385
|
-
catch (err) {
|
|
386
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
387
|
-
spreadPathsToArguments: {},
|
|
388
|
-
explicitPathsToArguments: {
|
|
389
|
-
cartInfo: '$[0].cartInfo',
|
|
390
|
-
couponCode: '$[0].couponCode',
|
|
391
|
-
merchantDiscounts: '$[0].merchantDiscounts',
|
|
392
|
-
lineItems: '$[0].lineItems',
|
|
393
|
-
customLineItems: '$[0].customLineItems',
|
|
394
|
-
},
|
|
395
|
-
singleArgumentUnchanged: false,
|
|
396
|
-
}, ['options']);
|
|
397
|
-
sideEffects?.onError?.(err);
|
|
398
|
-
throw transformedError;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
exports.createCart = createCart;
|
|
402
|
-
/**
|
|
403
|
-
* Updates a cart's properties.
|
|
404
|
-
*
|
|
405
|
-
* > **Note:** When updating line items, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
|
|
406
|
-
* @public
|
|
407
|
-
* @requiredField _id
|
|
408
|
-
* @requiredField options.customLineItems.descriptionLines.name
|
|
409
|
-
* @requiredField options.customLineItems.descriptionLines.value
|
|
410
|
-
* @requiredField options.customLineItems.itemType
|
|
411
|
-
* @requiredField options.customLineItems.productName
|
|
412
|
-
* @requiredField options.lineItems.catalogReference
|
|
413
|
-
* @param options - Available options to use when updating a cart.
|
|
414
|
-
* @param _id - ID of the cart to be updated.
|
|
415
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
416
|
-
* @permissionId ECOM.ADMIN_MODIFY_CARTS
|
|
417
|
-
* @permissionScope Manage Stores - all permissions
|
|
418
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
419
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
420
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
421
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
422
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
423
|
-
* @permissionScope Picasso private app mega scope
|
|
424
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
425
|
-
* @permissionScope Manage Stores - all permissions
|
|
426
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
427
|
-
* @permissionScope Manage eCommerce - Admin Permissions
|
|
428
|
-
* @permissionScopeId SCOPE.ECOM.MANAGE-ADMIN
|
|
429
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
430
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
431
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
432
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
433
|
-
* @permissionScope Picasso private app mega scope
|
|
434
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
435
|
-
* @applicableIdentity APP
|
|
436
|
-
* @applicableIdentity VISITOR
|
|
437
|
-
* @returns Updated Cart.
|
|
438
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.UpdateCart
|
|
439
|
-
*/
|
|
440
|
-
async function updateCart(_id, options) {
|
|
441
|
-
// @ts-ignore
|
|
442
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
443
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
444
|
-
cartInfo: { ...options?.cartInfo, id: _id },
|
|
445
|
-
couponCode: options?.couponCode,
|
|
446
|
-
merchantDiscounts: options?.merchantDiscounts,
|
|
447
|
-
lineItems: options?.lineItems,
|
|
448
|
-
customLineItems: options?.customLineItems,
|
|
449
|
-
}), [
|
|
450
|
-
{
|
|
451
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
452
|
-
paths: [
|
|
453
|
-
{ path: 'cartInfo.lineItems.url' },
|
|
454
|
-
{ path: 'lineItems.url' },
|
|
455
|
-
{ path: 'customLineItems.url' },
|
|
456
|
-
],
|
|
457
|
-
},
|
|
458
|
-
{
|
|
459
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
460
|
-
paths: [
|
|
461
|
-
{ path: 'cartInfo.lineItems.image' },
|
|
462
|
-
{ path: 'cartInfo.lineItems.catalogOverrideFields.image' },
|
|
463
|
-
{ path: 'lineItems.image' },
|
|
464
|
-
{ path: 'lineItems.catalogOverrideFields.image' },
|
|
465
|
-
{ path: 'customLineItems.media' },
|
|
466
|
-
],
|
|
467
|
-
},
|
|
468
|
-
{
|
|
469
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
470
|
-
paths: [{ path: 'cartInfo.contactInfo.address' }],
|
|
471
|
-
},
|
|
472
|
-
]);
|
|
473
|
-
const reqOpts = ambassadorWixEcomV1Cart.updateCart(payload);
|
|
474
|
-
sideEffects?.onSiteCall?.();
|
|
475
|
-
try {
|
|
476
|
-
const result = await httpClient.request(reqOpts);
|
|
477
|
-
sideEffects?.onSuccess?.(result);
|
|
478
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
479
|
-
{
|
|
480
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
481
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
485
|
-
paths: [
|
|
486
|
-
{ path: 'cart.lineItems.image' },
|
|
487
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
488
|
-
],
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
492
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
493
|
-
},
|
|
494
|
-
]))?.cart;
|
|
495
|
-
}
|
|
496
|
-
catch (err) {
|
|
497
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
498
|
-
spreadPathsToArguments: { cartInfo: '$[1].cartInfo' },
|
|
499
|
-
explicitPathsToArguments: {
|
|
500
|
-
'cartInfo.id': '$[0]',
|
|
501
|
-
couponCode: '$[1].couponCode',
|
|
502
|
-
merchantDiscounts: '$[1].merchantDiscounts',
|
|
503
|
-
lineItems: '$[1].lineItems',
|
|
504
|
-
customLineItems: '$[1].customLineItems',
|
|
505
|
-
},
|
|
506
|
-
singleArgumentUnchanged: false,
|
|
507
|
-
}, ['_id', 'options']);
|
|
508
|
-
sideEffects?.onError?.(err);
|
|
509
|
-
throw transformedError;
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
exports.updateCart = updateCart;
|
|
513
|
-
/**
|
|
514
|
-
* Retrieves a cart.
|
|
515
|
-
* @param _id - Cart ID.
|
|
516
|
-
* @public
|
|
517
|
-
* @requiredField _id
|
|
518
|
-
* @permissionId ECOM.READ_CARTS
|
|
519
|
-
* @permissionScope Manage Stores - all permissions
|
|
520
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
521
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
522
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
523
|
-
* @permissionScope Read Orders
|
|
524
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
525
|
-
* @permissionScope Read Stores - all read permissions
|
|
526
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
527
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
528
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
529
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
530
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
531
|
-
* @permissionScope Picasso private app mega scope
|
|
532
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
533
|
-
* @permissionScope Manage Orders
|
|
534
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
535
|
-
* @applicableIdentity APP
|
|
536
|
-
* @applicableIdentity VISITOR
|
|
537
|
-
* @returns Retrieved cart.
|
|
538
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.GetCart
|
|
539
|
-
*/
|
|
540
|
-
async function getCart(_id) {
|
|
541
|
-
// @ts-ignore
|
|
542
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
543
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
544
|
-
const reqOpts = ambassadorWixEcomV1Cart.getCart(payload);
|
|
545
|
-
sideEffects?.onSiteCall?.();
|
|
546
|
-
try {
|
|
547
|
-
const result = await httpClient.request(reqOpts);
|
|
548
|
-
sideEffects?.onSuccess?.(result);
|
|
549
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
550
|
-
{
|
|
551
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
552
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
556
|
-
paths: [
|
|
557
|
-
{ path: 'cart.lineItems.image' },
|
|
558
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
559
|
-
],
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
563
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
564
|
-
},
|
|
565
|
-
]))?.cart;
|
|
566
|
-
}
|
|
567
|
-
catch (err) {
|
|
568
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
569
|
-
spreadPathsToArguments: {},
|
|
570
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
571
|
-
singleArgumentUnchanged: false,
|
|
572
|
-
}, ['_id']);
|
|
573
|
-
sideEffects?.onError?.(err);
|
|
574
|
-
throw transformedError;
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
exports.getCart = getCart;
|
|
578
|
-
/**
|
|
579
|
-
* Retrieves the cart associated with a specified checkout.
|
|
580
|
-
* @param _id - Checkout ID.
|
|
581
|
-
* @internal
|
|
582
|
-
* @documentationMaturity preview
|
|
583
|
-
* @requiredField _id
|
|
584
|
-
* @permissionId ECOM.READ_CARTS
|
|
585
|
-
* @permissionScope Manage Stores - all permissions
|
|
586
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
587
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
588
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
589
|
-
* @permissionScope Read Orders
|
|
590
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
591
|
-
* @permissionScope Read Stores - all read permissions
|
|
592
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
593
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
594
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
595
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
596
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
597
|
-
* @permissionScope Picasso private app mega scope
|
|
598
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
599
|
-
* @permissionScope Manage Orders
|
|
600
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
601
|
-
* @applicableIdentity APP
|
|
602
|
-
* @applicableIdentity VISITOR
|
|
603
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.GetCartByCheckoutId
|
|
604
|
-
*/
|
|
605
|
-
async function getCartByCheckoutId(_id) {
|
|
606
|
-
// @ts-ignore
|
|
607
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
608
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
609
|
-
const reqOpts = ambassadorWixEcomV1Cart.getCartByCheckoutId(payload);
|
|
610
|
-
sideEffects?.onSiteCall?.();
|
|
611
|
-
try {
|
|
612
|
-
const result = await httpClient.request(reqOpts);
|
|
613
|
-
sideEffects?.onSuccess?.(result);
|
|
614
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
615
|
-
{
|
|
616
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
617
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
621
|
-
paths: [
|
|
622
|
-
{ path: 'cart.lineItems.image' },
|
|
623
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
624
|
-
],
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
628
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
629
|
-
},
|
|
630
|
-
]));
|
|
631
|
-
}
|
|
632
|
-
catch (err) {
|
|
633
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
634
|
-
spreadPathsToArguments: {},
|
|
635
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
636
|
-
singleArgumentUnchanged: false,
|
|
637
|
-
}, ['_id']);
|
|
638
|
-
sideEffects?.onError?.(err);
|
|
639
|
-
throw transformedError;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
exports.getCartByCheckoutId = getCartByCheckoutId;
|
|
643
|
-
/**
|
|
644
|
-
* Adds catalog ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)) line items to a cart.
|
|
645
|
-
*
|
|
646
|
-
* >**Note:** When adding catalog line items to a cart, the `lineItems.catalogReference.appId` and `lineItems.catalogReference.catalogItemId` fields are required.
|
|
647
|
-
* @param _id - Cart ID.
|
|
648
|
-
* @public
|
|
649
|
-
* @requiredField _id
|
|
650
|
-
* @requiredField options.customLineItems.descriptionLines.name
|
|
651
|
-
* @requiredField options.customLineItems.descriptionLines.value
|
|
652
|
-
* @requiredField options.customLineItems.itemType
|
|
653
|
-
* @requiredField options.customLineItems.price
|
|
654
|
-
* @requiredField options.customLineItems.productName
|
|
655
|
-
* @requiredField options.customLineItems.quantity
|
|
656
|
-
* @requiredField options.lineItems.catalogReference
|
|
657
|
-
* @requiredField options.lineItems.selectedMembership._id
|
|
658
|
-
* @requiredField options.lineItems.selectedMembership.appId
|
|
659
|
-
* @param options - Items to be added to cart.
|
|
660
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
661
|
-
* @permissionId ECOM.ADMIN_MODIFY_CARTS
|
|
662
|
-
* @permissionScope Manage Stores - all permissions
|
|
663
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
664
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
665
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
666
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
667
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
668
|
-
* @permissionScope Picasso private app mega scope
|
|
669
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
670
|
-
* @permissionScope Manage Stores - all permissions
|
|
671
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
672
|
-
* @permissionScope Manage eCommerce - Admin Permissions
|
|
673
|
-
* @permissionScopeId SCOPE.ECOM.MANAGE-ADMIN
|
|
674
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
675
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
676
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
677
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
678
|
-
* @permissionScope Picasso private app mega scope
|
|
679
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
680
|
-
* @applicableIdentity APP
|
|
681
|
-
* @applicableIdentity VISITOR
|
|
682
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.AddToCart
|
|
683
|
-
*/
|
|
684
|
-
async function addToCart(_id, options) {
|
|
685
|
-
// @ts-ignore
|
|
686
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
687
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
688
|
-
id: _id,
|
|
689
|
-
lineItems: options?.lineItems,
|
|
690
|
-
customLineItems: options?.customLineItems,
|
|
691
|
-
businessLocationId: options?.businessLocationId,
|
|
692
|
-
}), [
|
|
693
|
-
{
|
|
694
|
-
transformFn: page_url_v2_1.transformSDKPageURLV2ToRESTPageURLV2,
|
|
695
|
-
paths: [{ path: 'lineItems.url' }, { path: 'customLineItems.url' }],
|
|
696
|
-
},
|
|
697
|
-
{
|
|
698
|
-
transformFn: image_1.transformSDKImageToRESTImage,
|
|
699
|
-
paths: [
|
|
700
|
-
{ path: 'lineItems.image' },
|
|
701
|
-
{ path: 'lineItems.catalogOverrideFields.image' },
|
|
702
|
-
{ path: 'customLineItems.media' },
|
|
703
|
-
],
|
|
704
|
-
},
|
|
705
|
-
]);
|
|
706
|
-
const reqOpts = ambassadorWixEcomV1Cart.addToCart(payload);
|
|
707
|
-
sideEffects?.onSiteCall?.();
|
|
708
|
-
try {
|
|
709
|
-
const result = await httpClient.request(reqOpts);
|
|
710
|
-
sideEffects?.onSuccess?.(result);
|
|
711
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
712
|
-
{
|
|
713
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
714
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
715
|
-
},
|
|
716
|
-
{
|
|
717
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
718
|
-
paths: [
|
|
719
|
-
{ path: 'cart.lineItems.image' },
|
|
720
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
721
|
-
],
|
|
722
|
-
},
|
|
723
|
-
{
|
|
724
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
725
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
726
|
-
},
|
|
727
|
-
]));
|
|
728
|
-
}
|
|
729
|
-
catch (err) {
|
|
730
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
731
|
-
spreadPathsToArguments: {},
|
|
732
|
-
explicitPathsToArguments: {
|
|
733
|
-
id: '$[0]',
|
|
734
|
-
lineItems: '$[1].lineItems',
|
|
735
|
-
customLineItems: '$[1].customLineItems',
|
|
736
|
-
businessLocationId: '$[1].businessLocationId',
|
|
737
|
-
},
|
|
738
|
-
singleArgumentUnchanged: false,
|
|
739
|
-
}, ['_id', 'options']);
|
|
740
|
-
sideEffects?.onError?.(err);
|
|
741
|
-
throw transformedError;
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
exports.addToCart = addToCart;
|
|
745
|
-
/**
|
|
746
|
-
* Removes line items from a cart.
|
|
747
|
-
* @public
|
|
748
|
-
* @requiredField _id
|
|
749
|
-
* @requiredField lineItemIds
|
|
750
|
-
* @param lineItemIds - IDs of the line items to remove from the cart.
|
|
751
|
-
* @param _id - ID of the cart to remove line items from.
|
|
752
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
753
|
-
* @permissionScope Manage Stores - all permissions
|
|
754
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
755
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
756
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
757
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
758
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
759
|
-
* @permissionScope Picasso private app mega scope
|
|
760
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
761
|
-
* @applicableIdentity APP
|
|
762
|
-
* @applicableIdentity VISITOR
|
|
763
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.RemoveLineItems
|
|
764
|
-
*/
|
|
765
|
-
async function removeLineItems(_id, lineItemIds) {
|
|
766
|
-
// @ts-ignore
|
|
767
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
768
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
769
|
-
id: _id,
|
|
770
|
-
lineItemIds: lineItemIds,
|
|
771
|
-
});
|
|
772
|
-
const reqOpts = ambassadorWixEcomV1Cart.removeLineItems(payload);
|
|
773
|
-
sideEffects?.onSiteCall?.();
|
|
774
|
-
try {
|
|
775
|
-
const result = await httpClient.request(reqOpts);
|
|
776
|
-
sideEffects?.onSuccess?.(result);
|
|
777
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
778
|
-
{
|
|
779
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
780
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
781
|
-
},
|
|
782
|
-
{
|
|
783
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
784
|
-
paths: [
|
|
785
|
-
{ path: 'cart.lineItems.image' },
|
|
786
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
787
|
-
],
|
|
788
|
-
},
|
|
789
|
-
{
|
|
790
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
791
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
792
|
-
},
|
|
793
|
-
]));
|
|
794
|
-
}
|
|
795
|
-
catch (err) {
|
|
796
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
797
|
-
spreadPathsToArguments: {},
|
|
798
|
-
explicitPathsToArguments: { id: '$[0]', lineItemIds: '$[1]' },
|
|
799
|
-
singleArgumentUnchanged: false,
|
|
800
|
-
}, ['_id', 'lineItemIds']);
|
|
801
|
-
sideEffects?.onError?.(err);
|
|
802
|
-
throw transformedError;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
exports.removeLineItems = removeLineItems;
|
|
806
|
-
/**
|
|
807
|
-
* Creates a checkout from a cart.
|
|
808
|
-
*
|
|
809
|
-
* If a checkout for the specified cart already exists, that checkout is
|
|
810
|
-
* updated with any new information from the cart.
|
|
811
|
-
*
|
|
812
|
-
* > **Note:** `channelType` is a required field.
|
|
813
|
-
* @param _id - Cart ID.
|
|
814
|
-
* @public
|
|
815
|
-
* @requiredField _id
|
|
816
|
-
* @param options - Checkout creation options.
|
|
817
|
-
* @permissionId ECOM.CREATE_CHECKOUT_FROM_CART
|
|
818
|
-
* @permissionScope Manage Stores - all permissions
|
|
819
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
820
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
821
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
822
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
823
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
824
|
-
* @permissionScope Picasso private app mega scope
|
|
825
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
826
|
-
* @permissionScope Manage Orders
|
|
827
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
828
|
-
* @applicableIdentity APP
|
|
829
|
-
* @applicableIdentity VISITOR
|
|
830
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.CreateCheckout
|
|
831
|
-
*/
|
|
832
|
-
async function createCheckout(_id, options) {
|
|
833
|
-
// @ts-ignore
|
|
834
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
835
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
836
|
-
id: _id,
|
|
837
|
-
channelType: options?.channelType,
|
|
838
|
-
shippingAddress: options?.shippingAddress,
|
|
839
|
-
billingAddress: options?.billingAddress,
|
|
840
|
-
selectedShippingOption: options?.selectedShippingOption,
|
|
841
|
-
email: options?.email,
|
|
842
|
-
}), [
|
|
843
|
-
{
|
|
844
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
845
|
-
paths: [{ path: 'shippingAddress' }, { path: 'billingAddress' }],
|
|
846
|
-
},
|
|
847
|
-
]);
|
|
848
|
-
const reqOpts = ambassadorWixEcomV1Cart.createCheckout(payload);
|
|
849
|
-
sideEffects?.onSiteCall?.();
|
|
850
|
-
try {
|
|
851
|
-
const result = await httpClient.request(reqOpts);
|
|
852
|
-
sideEffects?.onSuccess?.(result);
|
|
853
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
854
|
-
}
|
|
855
|
-
catch (err) {
|
|
856
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
857
|
-
spreadPathsToArguments: {},
|
|
858
|
-
explicitPathsToArguments: {
|
|
859
|
-
id: '$[0]',
|
|
860
|
-
channelType: '$[1].channelType',
|
|
861
|
-
shippingAddress: '$[1].shippingAddress',
|
|
862
|
-
billingAddress: '$[1].billingAddress',
|
|
863
|
-
selectedShippingOption: '$[1].selectedShippingOption',
|
|
864
|
-
email: '$[1].email',
|
|
865
|
-
},
|
|
866
|
-
singleArgumentUnchanged: false,
|
|
867
|
-
}, ['_id', 'options']);
|
|
868
|
-
sideEffects?.onError?.(err);
|
|
869
|
-
throw transformedError;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
exports.createCheckout = createCheckout;
|
|
873
|
-
/**
|
|
874
|
-
* Removes the coupon from a cart.
|
|
875
|
-
* @param _id - Cart ID.
|
|
876
|
-
* @public
|
|
877
|
-
* @requiredField _id
|
|
878
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
879
|
-
* @permissionScope Manage Stores - all permissions
|
|
880
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
881
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
882
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
883
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
884
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
885
|
-
* @permissionScope Picasso private app mega scope
|
|
886
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
887
|
-
* @applicableIdentity APP
|
|
888
|
-
* @applicableIdentity VISITOR
|
|
889
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.RemoveCoupon
|
|
890
|
-
*/
|
|
891
|
-
async function removeCoupon(_id) {
|
|
892
|
-
// @ts-ignore
|
|
893
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
894
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
895
|
-
const reqOpts = ambassadorWixEcomV1Cart.removeCoupon(payload);
|
|
896
|
-
sideEffects?.onSiteCall?.();
|
|
897
|
-
try {
|
|
898
|
-
const result = await httpClient.request(reqOpts);
|
|
899
|
-
sideEffects?.onSuccess?.(result);
|
|
900
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
901
|
-
{
|
|
902
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
903
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
907
|
-
paths: [
|
|
908
|
-
{ path: 'cart.lineItems.image' },
|
|
909
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
910
|
-
],
|
|
911
|
-
},
|
|
912
|
-
{
|
|
913
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
914
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
915
|
-
},
|
|
916
|
-
]));
|
|
917
|
-
}
|
|
918
|
-
catch (err) {
|
|
919
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
920
|
-
spreadPathsToArguments: {},
|
|
921
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
922
|
-
singleArgumentUnchanged: false,
|
|
923
|
-
}, ['_id']);
|
|
924
|
-
sideEffects?.onError?.(err);
|
|
925
|
-
throw transformedError;
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
exports.removeCoupon = removeCoupon;
|
|
929
|
-
/**
|
|
930
|
-
* Updates the quantity of one or more line items in a cart.
|
|
931
|
-
*
|
|
932
|
-
* This method is only for updating the quantity of line items.
|
|
933
|
-
* To entirely remove a line item from the cart, use Remove Line Items.
|
|
934
|
-
* To add a new line item to the cart, use Add To Cart.
|
|
935
|
-
*
|
|
936
|
-
* This method checks the amount of stock remaining for this line item.
|
|
937
|
-
* If the specified quantity is greater than the remaining stock,
|
|
938
|
-
* then the quantity returned in the response is the total amount of remaining stock.
|
|
939
|
-
* @param _id - Cart ID.
|
|
940
|
-
* @param lineItems - Line item IDs and their new quantity.
|
|
941
|
-
* @public
|
|
942
|
-
* @requiredField _id
|
|
943
|
-
* @requiredField lineItems
|
|
944
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
945
|
-
* @permissionScope Manage Stores - all permissions
|
|
946
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
947
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
948
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
949
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
950
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
951
|
-
* @permissionScope Picasso private app mega scope
|
|
952
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
953
|
-
* @applicableIdentity APP
|
|
954
|
-
* @applicableIdentity VISITOR
|
|
955
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.UpdateLineItemsQuantity
|
|
956
|
-
*/
|
|
957
|
-
async function updateLineItemsQuantity(_id, lineItems) {
|
|
958
|
-
// @ts-ignore
|
|
959
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
960
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
961
|
-
id: _id,
|
|
962
|
-
lineItems: lineItems,
|
|
963
|
-
});
|
|
964
|
-
const reqOpts = ambassadorWixEcomV1Cart.updateLineItemsQuantity(payload);
|
|
965
|
-
sideEffects?.onSiteCall?.();
|
|
966
|
-
try {
|
|
967
|
-
const result = await httpClient.request(reqOpts);
|
|
968
|
-
sideEffects?.onSuccess?.(result);
|
|
969
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
970
|
-
{
|
|
971
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
972
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
973
|
-
},
|
|
974
|
-
{
|
|
975
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
976
|
-
paths: [
|
|
977
|
-
{ path: 'cart.lineItems.image' },
|
|
978
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
979
|
-
],
|
|
980
|
-
},
|
|
981
|
-
{
|
|
982
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
983
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
984
|
-
},
|
|
985
|
-
]));
|
|
986
|
-
}
|
|
987
|
-
catch (err) {
|
|
988
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
989
|
-
spreadPathsToArguments: {},
|
|
990
|
-
explicitPathsToArguments: { id: '$[0]', lineItems: '$[1]' },
|
|
991
|
-
singleArgumentUnchanged: false,
|
|
992
|
-
}, ['_id', 'lineItems']);
|
|
993
|
-
sideEffects?.onError?.(err);
|
|
994
|
-
throw transformedError;
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
exports.updateLineItemsQuantity = updateLineItemsQuantity;
|
|
998
|
-
/**
|
|
999
|
-
* Estimates the subtotal and total for current site visitor’s cart.
|
|
1000
|
-
*
|
|
1001
|
-
* Totals include tax and are based on the selected carrier service, shipping address, and billing information.
|
|
1002
|
-
*
|
|
1003
|
-
* > **Note:** Not passing any optional parameters will only estimate the cart items price totals.
|
|
1004
|
-
* @param _id - Cart ID.
|
|
1005
|
-
* @public
|
|
1006
|
-
* @requiredField _id
|
|
1007
|
-
* @param options - Total estimation options.
|
|
1008
|
-
* @permissionId ECOM.READ_CARTS
|
|
1009
|
-
* @permissionScope Manage Stores - all permissions
|
|
1010
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1011
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
1012
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
1013
|
-
* @permissionScope Read Orders
|
|
1014
|
-
* @permissionScopeId SCOPE.DC-STORES.READ-ORDERS
|
|
1015
|
-
* @permissionScope Read Stores - all read permissions
|
|
1016
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.READ-STORES
|
|
1017
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1018
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1019
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1020
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1021
|
-
* @permissionScope Picasso private app mega scope
|
|
1022
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1023
|
-
* @permissionScope Manage Orders
|
|
1024
|
-
* @permissionScopeId SCOPE.DC-STORES.MANAGE-ORDERS
|
|
1025
|
-
* @applicableIdentity APP
|
|
1026
|
-
* @applicableIdentity VISITOR
|
|
1027
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.EstimateTotals
|
|
1028
|
-
*/
|
|
1029
|
-
async function estimateTotals(_id, options) {
|
|
1030
|
-
// @ts-ignore
|
|
1031
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1032
|
-
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
1033
|
-
id: _id,
|
|
1034
|
-
selectedShippingOption: options?.selectedShippingOption,
|
|
1035
|
-
shippingAddress: options?.shippingAddress,
|
|
1036
|
-
billingAddress: options?.billingAddress,
|
|
1037
|
-
selectedMemberships: options?.selectedMemberships,
|
|
1038
|
-
calculateTax: options?.calculateTax,
|
|
1039
|
-
calculateShipping: options?.calculateShipping,
|
|
1040
|
-
}), [
|
|
1041
|
-
{
|
|
1042
|
-
transformFn: address_1.transformSDKAddressToRESTAddress,
|
|
1043
|
-
paths: [{ path: 'shippingAddress' }, { path: 'billingAddress' }],
|
|
1044
|
-
},
|
|
1045
|
-
]);
|
|
1046
|
-
const reqOpts = ambassadorWixEcomV1Cart.estimateTotals(payload);
|
|
1047
|
-
sideEffects?.onSiteCall?.();
|
|
1048
|
-
try {
|
|
1049
|
-
const result = await httpClient.request(reqOpts);
|
|
1050
|
-
sideEffects?.onSuccess?.(result);
|
|
1051
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1052
|
-
{
|
|
1053
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1054
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
1055
|
-
},
|
|
1056
|
-
{
|
|
1057
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1058
|
-
paths: [
|
|
1059
|
-
{ path: 'cart.lineItems.image' },
|
|
1060
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
1061
|
-
],
|
|
1062
|
-
},
|
|
1063
|
-
{
|
|
1064
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1065
|
-
paths: [
|
|
1066
|
-
{ path: 'cart.contactInfo.address' },
|
|
1067
|
-
{
|
|
1068
|
-
path: 'shippingInfo.selectedCarrierServiceOption.logistics.pickupDetails.address',
|
|
1069
|
-
},
|
|
1070
|
-
{
|
|
1071
|
-
path: 'shippingInfo.carrierServiceOptions.shippingOptions.logistics.pickupDetails.address',
|
|
1072
|
-
},
|
|
1073
|
-
],
|
|
1074
|
-
},
|
|
1075
|
-
]));
|
|
1076
|
-
}
|
|
1077
|
-
catch (err) {
|
|
1078
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1079
|
-
spreadPathsToArguments: {},
|
|
1080
|
-
explicitPathsToArguments: {
|
|
1081
|
-
id: '$[0]',
|
|
1082
|
-
selectedShippingOption: '$[1].selectedShippingOption',
|
|
1083
|
-
shippingAddress: '$[1].shippingAddress',
|
|
1084
|
-
billingAddress: '$[1].billingAddress',
|
|
1085
|
-
selectedMemberships: '$[1].selectedMemberships',
|
|
1086
|
-
calculateTax: '$[1].calculateTax',
|
|
1087
|
-
calculateShipping: '$[1].calculateShipping',
|
|
1088
|
-
},
|
|
1089
|
-
singleArgumentUnchanged: false,
|
|
1090
|
-
}, ['_id', 'options']);
|
|
1091
|
-
sideEffects?.onError?.(err);
|
|
1092
|
-
throw transformedError;
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
exports.estimateTotals = estimateTotals;
|
|
1096
|
-
/**
|
|
1097
|
-
* Deletes a cart.
|
|
1098
|
-
* @public
|
|
1099
|
-
* @requiredField _id
|
|
1100
|
-
* @param _id - ID of the cart to delete.
|
|
1101
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
1102
|
-
* @permissionScope Manage Stores - all permissions
|
|
1103
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1104
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1105
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1106
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1107
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1108
|
-
* @permissionScope Picasso private app mega scope
|
|
1109
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1110
|
-
* @applicableIdentity APP
|
|
1111
|
-
* @applicableIdentity VISITOR
|
|
1112
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.DeleteCart
|
|
1113
|
-
*/
|
|
1114
|
-
async function deleteCart(_id) {
|
|
1115
|
-
// @ts-ignore
|
|
1116
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1117
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
1118
|
-
const reqOpts = ambassadorWixEcomV1Cart.deleteCart(payload);
|
|
1119
|
-
sideEffects?.onSiteCall?.();
|
|
1120
|
-
try {
|
|
1121
|
-
const result = await httpClient.request(reqOpts);
|
|
1122
|
-
sideEffects?.onSuccess?.(result);
|
|
1123
|
-
}
|
|
1124
|
-
catch (err) {
|
|
1125
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1126
|
-
spreadPathsToArguments: {},
|
|
1127
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1128
|
-
singleArgumentUnchanged: false,
|
|
1129
|
-
}, ['_id']);
|
|
1130
|
-
sideEffects?.onError?.(err);
|
|
1131
|
-
throw transformedError;
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
exports.deleteCart = deleteCart;
|
|
1135
|
-
/**
|
|
1136
|
-
* Removes the location associated with a cart.
|
|
1137
|
-
* @param _id - Cart ID.
|
|
1138
|
-
* @public
|
|
1139
|
-
* @documentationMaturity preview
|
|
1140
|
-
* @requiredField _id
|
|
1141
|
-
* @permissionId ECOM.MODIFY_CARTS
|
|
1142
|
-
* @permissionScope Manage Stores - all permissions
|
|
1143
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
1144
|
-
* @permissionScope Manage Restaurants - all permissions
|
|
1145
|
-
* @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES
|
|
1146
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
1147
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
1148
|
-
* @permissionScope Picasso private app mega scope
|
|
1149
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
1150
|
-
* @applicableIdentity APP
|
|
1151
|
-
* @applicableIdentity VISITOR
|
|
1152
|
-
* @fqn com.wix.ecom.cart.api.v1.CartService.RemoveBusinessLocation
|
|
1153
|
-
*/
|
|
1154
|
-
async function removeBusinessLocation(_id) {
|
|
1155
|
-
// @ts-ignore
|
|
1156
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1157
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ id: _id });
|
|
1158
|
-
const reqOpts = ambassadorWixEcomV1Cart.removeBusinessLocation(payload);
|
|
1159
|
-
sideEffects?.onSiteCall?.();
|
|
1160
|
-
try {
|
|
1161
|
-
const result = await httpClient.request(reqOpts);
|
|
1162
|
-
sideEffects?.onSuccess?.(result);
|
|
1163
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
|
|
1164
|
-
{
|
|
1165
|
-
transformFn: page_url_v2_2.transformRESTPageURLV2ToSDKPageURLV2,
|
|
1166
|
-
paths: [{ path: 'cart.lineItems.url' }],
|
|
1167
|
-
},
|
|
1168
|
-
{
|
|
1169
|
-
transformFn: image_2.transformRESTImageToSDKImage,
|
|
1170
|
-
paths: [
|
|
1171
|
-
{ path: 'cart.lineItems.image' },
|
|
1172
|
-
{ path: 'cart.lineItems.catalogOverrideFields.image' },
|
|
1173
|
-
],
|
|
1174
|
-
},
|
|
1175
|
-
{
|
|
1176
|
-
transformFn: address_2.transformRESTAddressToSDKAddress,
|
|
1177
|
-
paths: [{ path: 'cart.contactInfo.address' }],
|
|
1178
|
-
},
|
|
1179
|
-
]));
|
|
1180
|
-
}
|
|
1181
|
-
catch (err) {
|
|
1182
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
1183
|
-
spreadPathsToArguments: {},
|
|
1184
|
-
explicitPathsToArguments: { id: '$[0]' },
|
|
1185
|
-
singleArgumentUnchanged: false,
|
|
1186
|
-
}, ['_id']);
|
|
1187
|
-
sideEffects?.onError?.(err);
|
|
1188
|
-
throw transformedError;
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
exports.removeBusinessLocation = removeBusinessLocation;
|
|
1192
|
-
//# sourceMappingURL=ecom-v1-cart-cart.universal.js.map
|