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