@wix/auto_sdk_ecom_current-cart-v-2 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +122 -123
- package/build/cjs/index.js +11 -18
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +11 -18
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +85 -102
- package/build/es/index.d.mts +122 -123
- package/build/es/index.mjs +11 -17
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +11 -17
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +85 -102
- package/build/internal/cjs/index.d.ts +13 -13
- package/build/internal/cjs/index.js +11 -18
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +136 -137
- package/build/internal/cjs/index.typings.js +11 -18
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +85 -102
- package/build/internal/es/index.d.mts +13 -13
- package/build/internal/es/index.mjs +11 -17
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +136 -137
- package/build/internal/es/index.typings.mjs +11 -17
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +85 -102
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -20,11 +20,6 @@ interface Cart {
|
|
|
20
20
|
* @readonly
|
|
21
21
|
*/
|
|
22
22
|
revision?: string | null;
|
|
23
|
-
/**
|
|
24
|
-
* Custom fields.
|
|
25
|
-
* [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
|
|
26
|
-
*/
|
|
27
|
-
extendedFields?: ExtendedFields;
|
|
28
23
|
/**
|
|
29
24
|
* Line items added to the Cart by the customer.
|
|
30
25
|
* This list may include both valid items (in stock) and invalid ones (e.g., out of stock).
|
|
@@ -33,6 +28,14 @@ interface Cart {
|
|
|
33
28
|
* @readonly
|
|
34
29
|
*/
|
|
35
30
|
lineItems?: V2LineItem[];
|
|
31
|
+
/** The sum of all line item final prices. */
|
|
32
|
+
subtotal?: MultiCurrencyPrice;
|
|
33
|
+
/**
|
|
34
|
+
* Optional message left by the customer.
|
|
35
|
+
* Usually intended for the merchant and contain special instructions, requests, or clarifications related to the order.
|
|
36
|
+
* @maxLength 1000
|
|
37
|
+
*/
|
|
38
|
+
note?: string | null;
|
|
36
39
|
/**
|
|
37
40
|
* The discounts of the Cart.
|
|
38
41
|
* Automatic discounts are removed from the Cart entirely when they are no longer valid.
|
|
@@ -44,7 +47,7 @@ interface Cart {
|
|
|
44
47
|
/** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
|
|
45
48
|
source?: CartSource;
|
|
46
49
|
/** Information about the site from which the Cart's line items were added. */
|
|
47
|
-
|
|
50
|
+
businessInfo?: BusinessInfo;
|
|
48
51
|
/** Information about the customer that owns the Cart. */
|
|
49
52
|
customerInfo?: CustomerInfo;
|
|
50
53
|
/** Delivery-related information associated with the Cart. */
|
|
@@ -54,15 +57,24 @@ interface Cart {
|
|
|
54
57
|
/** Payment-related information associated with the Cart. */
|
|
55
58
|
paymentInfo?: PaymentInfo;
|
|
56
59
|
/**
|
|
57
|
-
*
|
|
60
|
+
* Whether the Cart has been placed as an Order.
|
|
61
|
+
* Defaults to `false`.
|
|
58
62
|
* @readonly
|
|
59
63
|
*/
|
|
60
|
-
|
|
64
|
+
orderPlaced?: boolean;
|
|
61
65
|
/**
|
|
62
|
-
* The
|
|
66
|
+
* The ID of the Order created from the Cart.
|
|
67
|
+
* This field is empty until the checkout process is completed.
|
|
68
|
+
* @format GUID
|
|
69
|
+
* @readonly
|
|
70
|
+
*/
|
|
71
|
+
orderId?: string | null;
|
|
72
|
+
/**
|
|
73
|
+
* Persistent ID that correlates between the Cart and the created Order (after the checkout is completed).
|
|
74
|
+
* @format GUID
|
|
63
75
|
* @readonly
|
|
64
76
|
*/
|
|
65
|
-
|
|
77
|
+
purchaseFlowId?: string | null;
|
|
66
78
|
/**
|
|
67
79
|
* Additional Cart settings.
|
|
68
80
|
*
|
|
@@ -71,7 +83,7 @@ interface Cart {
|
|
|
71
83
|
* > * To access and manage custom checkout page content, your app must have the permission scope named "Manage eCommerce - Admin Permissions". Learn more about [permission scopes](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).
|
|
72
84
|
* @immutable
|
|
73
85
|
*/
|
|
74
|
-
|
|
86
|
+
settings?: CartSettings;
|
|
75
87
|
/**
|
|
76
88
|
* Custom checkout URL to redirect the customer to a checkout page.
|
|
77
89
|
* By default, customers are redirected to the standard Wix checkout page.
|
|
@@ -81,29 +93,10 @@ interface Cart {
|
|
|
81
93
|
*/
|
|
82
94
|
customCheckoutUrl?: string | null;
|
|
83
95
|
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* @format GUID
|
|
87
|
-
* @readonly
|
|
88
|
-
*/
|
|
89
|
-
orderId?: string | null;
|
|
90
|
-
/**
|
|
91
|
-
* Persistent ID that correlates between the Cart and the created Order (after the checkout is completed).
|
|
92
|
-
* @format GUID
|
|
93
|
-
* @readonly
|
|
94
|
-
*/
|
|
95
|
-
purchaseFlowId?: string | null;
|
|
96
|
-
}
|
|
97
|
-
interface ExtendedFields {
|
|
98
|
-
/**
|
|
99
|
-
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
100
|
-
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
101
|
-
*
|
|
102
|
-
* You can only access fields for which you have the appropriate permissions.
|
|
103
|
-
*
|
|
104
|
-
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
96
|
+
* Custom fields.
|
|
97
|
+
* [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
|
|
105
98
|
*/
|
|
106
|
-
|
|
99
|
+
extendedFields?: ExtendedFields;
|
|
107
100
|
}
|
|
108
101
|
interface V2LineItem {
|
|
109
102
|
/**
|
|
@@ -146,10 +139,10 @@ interface V2LineItem {
|
|
|
146
139
|
*/
|
|
147
140
|
modifierGroups?: ModifierGroup[];
|
|
148
141
|
/**
|
|
149
|
-
* Whether the item
|
|
150
|
-
*
|
|
142
|
+
* Whether the line item is a custom line item.
|
|
143
|
+
* Custom line items don't trigger the Catalog service plugin.
|
|
151
144
|
*/
|
|
152
|
-
|
|
145
|
+
customLineItem?: boolean;
|
|
153
146
|
}
|
|
154
147
|
interface TranslatableString {
|
|
155
148
|
/**
|
|
@@ -188,7 +181,10 @@ interface ItemQuantityInfo {
|
|
|
188
181
|
requestedQuantity?: number;
|
|
189
182
|
/** The maximum quantity of items available for purchase. */
|
|
190
183
|
availableQuantity?: number | null;
|
|
191
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* Whether the line item quantity is fixed and cannot be changed.
|
|
186
|
+
* Default: `false`.
|
|
187
|
+
*/
|
|
192
188
|
fixedQuantity?: boolean;
|
|
193
189
|
}
|
|
194
190
|
interface ItemPricingInfo {
|
|
@@ -271,11 +267,6 @@ interface ItemPriceBreakdown {
|
|
|
271
267
|
totalDiscount?: MultiCurrencyPrice;
|
|
272
268
|
}
|
|
273
269
|
interface ItemSource {
|
|
274
|
-
/**
|
|
275
|
-
* Whether the line item is a custom line item.
|
|
276
|
-
* Custom line items don't trigger the Catalog service plugin.
|
|
277
|
-
*/
|
|
278
|
-
customLineItem?: boolean;
|
|
279
270
|
/**
|
|
280
271
|
* Catalog and item reference.
|
|
281
272
|
* Holds IDs for the item and the catalog it came from, as well as further optional info.
|
|
@@ -506,6 +497,11 @@ interface ItemAttributes {
|
|
|
506
497
|
subscriptionInfo?: SubscriptionOptionInfo;
|
|
507
498
|
/** Service properties. When relevant, this contains information such as date and number of participants. */
|
|
508
499
|
serviceProperties?: ServiceProperties;
|
|
500
|
+
/**
|
|
501
|
+
* Whether the item can only be purchased by site members.
|
|
502
|
+
* Default: `false`
|
|
503
|
+
*/
|
|
504
|
+
membersOnly?: boolean;
|
|
509
505
|
}
|
|
510
506
|
interface Policy {
|
|
511
507
|
/**
|
|
@@ -750,16 +746,27 @@ interface V2SelectedMembership {
|
|
|
750
746
|
declare enum ItemStatus {
|
|
751
747
|
UNKNOWN_ITEM_STATUS = "UNKNOWN_ITEM_STATUS",
|
|
752
748
|
/** The item is available in the requested quantity. */
|
|
753
|
-
|
|
749
|
+
IN_STOCK = "IN_STOCK",
|
|
754
750
|
/** Only part of the requested quantity is available. */
|
|
755
|
-
|
|
751
|
+
PARTIALLY_IN_STOCK = "PARTIALLY_IN_STOCK",
|
|
756
752
|
/** The item is out of stock. */
|
|
757
753
|
OUT_OF_STOCK = "OUT_OF_STOCK",
|
|
758
754
|
/** The item is no longer exists in the catalog. */
|
|
759
|
-
|
|
755
|
+
REMOVED_FROM_CATALOG = "REMOVED_FROM_CATALOG"
|
|
760
756
|
}
|
|
761
757
|
/** @enumType */
|
|
762
|
-
type ItemStatusWithLiterals = ItemStatus | 'UNKNOWN_ITEM_STATUS' | '
|
|
758
|
+
type ItemStatusWithLiterals = ItemStatus | 'UNKNOWN_ITEM_STATUS' | 'IN_STOCK' | 'PARTIALLY_IN_STOCK' | 'OUT_OF_STOCK' | 'REMOVED_FROM_CATALOG';
|
|
759
|
+
interface ExtendedFields {
|
|
760
|
+
/**
|
|
761
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
762
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
763
|
+
*
|
|
764
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
765
|
+
*
|
|
766
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
767
|
+
*/
|
|
768
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
769
|
+
}
|
|
763
770
|
interface AdditionalFee {
|
|
764
771
|
/**
|
|
765
772
|
* Additional fee's unique code or ID.
|
|
@@ -1084,18 +1091,13 @@ interface CustomContentReference {
|
|
|
1084
1091
|
*/
|
|
1085
1092
|
componentId?: string;
|
|
1086
1093
|
}
|
|
1087
|
-
interface
|
|
1094
|
+
interface BusinessInfo {
|
|
1088
1095
|
/**
|
|
1089
1096
|
* The ID of the business location associated with the cart.
|
|
1090
1097
|
* Learn more about the [Locations API](https://dev.wix.com/docs/rest/business-management/locations/introduction).
|
|
1091
1098
|
* @format GUID
|
|
1092
1099
|
*/
|
|
1093
|
-
|
|
1094
|
-
/**
|
|
1095
|
-
* The business’s unit of weight measurement (e.g., KG, LB).
|
|
1096
|
-
* @readonly
|
|
1097
|
-
*/
|
|
1098
|
-
weightUnit?: WeightUnitWithLiterals;
|
|
1100
|
+
locationId?: string | null;
|
|
1099
1101
|
/**
|
|
1100
1102
|
* The business’s default language, represented as a two-letter ISO 639-1 code.
|
|
1101
1103
|
* @format LANGUAGE
|
|
@@ -1109,16 +1111,6 @@ interface SiteInfo {
|
|
|
1109
1111
|
*/
|
|
1110
1112
|
currencyCode?: string;
|
|
1111
1113
|
}
|
|
1112
|
-
declare enum WeightUnit {
|
|
1113
|
-
/** Weight unit can't be classified due to an error. */
|
|
1114
|
-
UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
|
|
1115
|
-
/** Kilograms. */
|
|
1116
|
-
KG = "KG",
|
|
1117
|
-
/** Pounds. */
|
|
1118
|
-
LB = "LB"
|
|
1119
|
-
}
|
|
1120
|
-
/** @enumType */
|
|
1121
|
-
type WeightUnitWithLiterals = WeightUnit | 'UNSPECIFIED_WEIGHT_UNIT' | 'KG' | 'LB';
|
|
1122
1114
|
interface CustomerInfo extends CustomerInfoIdOneOf {
|
|
1123
1115
|
/**
|
|
1124
1116
|
* Site visitor ID (if site visitor is **not** a member).
|
|
@@ -1166,11 +1158,6 @@ interface CustomerInfo extends CustomerInfoIdOneOf {
|
|
|
1166
1158
|
* @readonly
|
|
1167
1159
|
*/
|
|
1168
1160
|
currencyCode?: string;
|
|
1169
|
-
/**
|
|
1170
|
-
* The [buyer note](https://support.wix.com/en/article/wix-stores-viewing-customer-notes) left by the customer.
|
|
1171
|
-
* @maxLength 1000
|
|
1172
|
-
*/
|
|
1173
|
-
buyerNote?: string | null;
|
|
1174
1161
|
}
|
|
1175
1162
|
/** @oneof */
|
|
1176
1163
|
interface CustomerInfoIdOneOf {
|
|
@@ -1201,6 +1188,11 @@ interface DeliveryInfo {
|
|
|
1201
1188
|
recipient?: FullAddressContactDetails;
|
|
1202
1189
|
/** The selected delivery method by the customer. */
|
|
1203
1190
|
method?: DeliveryMethod;
|
|
1191
|
+
/**
|
|
1192
|
+
* The unit of weight measurement when shipping items (e.g., KG, LB).
|
|
1193
|
+
* @readonly
|
|
1194
|
+
*/
|
|
1195
|
+
weightUnit?: WeightUnitWithLiterals;
|
|
1204
1196
|
}
|
|
1205
1197
|
/** Physical address */
|
|
1206
1198
|
interface Address {
|
|
@@ -1330,6 +1322,16 @@ interface DeliveryMethod {
|
|
|
1330
1322
|
*/
|
|
1331
1323
|
pickup?: boolean;
|
|
1332
1324
|
}
|
|
1325
|
+
declare enum WeightUnit {
|
|
1326
|
+
/** Weight unit can't be classified due to an error. */
|
|
1327
|
+
UNSPECIFIED_WEIGHT_UNIT = "UNSPECIFIED_WEIGHT_UNIT",
|
|
1328
|
+
/** Kilograms. */
|
|
1329
|
+
KG = "KG",
|
|
1330
|
+
/** Pounds. */
|
|
1331
|
+
LB = "LB"
|
|
1332
|
+
}
|
|
1333
|
+
/** @enumType */
|
|
1334
|
+
type WeightUnitWithLiterals = WeightUnit | 'UNSPECIFIED_WEIGHT_UNIT' | 'KG' | 'LB';
|
|
1333
1335
|
interface TaxInfo {
|
|
1334
1336
|
/**
|
|
1335
1337
|
* Indicates whether tax is already included in prices (line items, discounts, delivery, additional fess).
|
|
@@ -1383,23 +1385,7 @@ interface GiftCard {
|
|
|
1383
1385
|
*/
|
|
1384
1386
|
externalId?: string | null;
|
|
1385
1387
|
}
|
|
1386
|
-
interface
|
|
1387
|
-
/** The sum of all line items after applying automatic discounts. */
|
|
1388
|
-
subtotal?: MultiCurrencyPrice;
|
|
1389
|
-
/** The coupon discount amount. Automatic discounts are not included in this amount. */
|
|
1390
|
-
discount?: MultiCurrencyPrice;
|
|
1391
|
-
/** The sum of all line items after applying all discounts. */
|
|
1392
|
-
discountedSubtotal?: MultiCurrencyPrice;
|
|
1393
|
-
}
|
|
1394
|
-
declare enum CartStatus {
|
|
1395
|
-
/** A new Cart. */
|
|
1396
|
-
CREATED = "CREATED",
|
|
1397
|
-
/** The checkout process is completed. */
|
|
1398
|
-
CHECKOUT_COMPLETED = "CHECKOUT_COMPLETED"
|
|
1399
|
-
}
|
|
1400
|
-
/** @enumType */
|
|
1401
|
-
type CartStatusWithLiterals = CartStatus | 'CREATED' | 'CHECKOUT_COMPLETED';
|
|
1402
|
-
interface CustomSettings {
|
|
1388
|
+
interface CartSettings {
|
|
1403
1389
|
/**
|
|
1404
1390
|
* Whether to restrict the option to add or remove a gift card on the checkout page.
|
|
1405
1391
|
* Default: `false`
|
|
@@ -1421,6 +1407,22 @@ interface CustomSettings {
|
|
|
1421
1407
|
*/
|
|
1422
1408
|
manualPaymentDisabled?: boolean;
|
|
1423
1409
|
}
|
|
1410
|
+
interface CustomField {
|
|
1411
|
+
/** Custom field value. */
|
|
1412
|
+
value?: any;
|
|
1413
|
+
/**
|
|
1414
|
+
* Custom field title.
|
|
1415
|
+
* @minLength 1
|
|
1416
|
+
* @maxLength 500
|
|
1417
|
+
*/
|
|
1418
|
+
title?: string;
|
|
1419
|
+
/**
|
|
1420
|
+
* Translated custom field title.
|
|
1421
|
+
* @minLength 1
|
|
1422
|
+
* @maxLength 500
|
|
1423
|
+
*/
|
|
1424
|
+
translatedTitle?: string | null;
|
|
1425
|
+
}
|
|
1424
1426
|
interface CartSummary {
|
|
1425
1427
|
/**
|
|
1426
1428
|
* The Cart ID.
|
|
@@ -1603,7 +1605,7 @@ interface AdditionalFeeTax {
|
|
|
1603
1605
|
interface PriceSummary {
|
|
1604
1606
|
/**
|
|
1605
1607
|
* Total price of all line items after applying item-level discounts.
|
|
1606
|
-
*
|
|
1608
|
+
* Before tax TODO: Change it to include tax if the 'prices_include_tax' flag is true.
|
|
1607
1609
|
*/
|
|
1608
1610
|
subtotal?: MultiCurrencyPrice;
|
|
1609
1611
|
/**
|
|
@@ -1614,20 +1616,17 @@ interface PriceSummary {
|
|
|
1614
1616
|
discount?: MultiCurrencyPrice;
|
|
1615
1617
|
/**
|
|
1616
1618
|
* Final delivery cost for the cart.
|
|
1617
|
-
*
|
|
1619
|
+
* Before tax TODO: Change it to include tax if the 'prices_include_tax' flag is true.
|
|
1618
1620
|
*/
|
|
1619
1621
|
delivery?: MultiCurrencyPrice;
|
|
1620
1622
|
/**
|
|
1621
1623
|
* Total additional fees associated with the cart.
|
|
1622
|
-
*
|
|
1624
|
+
* Before tax TODO: Change it to include tax if the 'prices_include_tax' flag is true.
|
|
1623
1625
|
*/
|
|
1624
1626
|
additionalFees?: MultiCurrencyPrice;
|
|
1625
1627
|
/** Total tax amount calculated across all applicable components (items, discounts, delivery, and fees). */
|
|
1626
1628
|
tax?: MultiCurrencyPrice;
|
|
1627
|
-
/**
|
|
1628
|
-
* Total amount to be paid.
|
|
1629
|
-
* Curenntly, total = subtotal - discount + delivery + additional_fees + tax.
|
|
1630
|
-
*/
|
|
1629
|
+
/** Total amount to be paid. */
|
|
1631
1630
|
total?: MultiCurrencyPrice;
|
|
1632
1631
|
}
|
|
1633
1632
|
interface PaymentSummary {
|
|
@@ -1962,11 +1961,6 @@ interface CustomItemInput {
|
|
|
1962
1961
|
* @maxSize 25
|
|
1963
1962
|
*/
|
|
1964
1963
|
modifierGroups?: ModifierGroup[];
|
|
1965
|
-
/**
|
|
1966
|
-
* Whether the item can only be purchased by site members.
|
|
1967
|
-
* Default: `false`
|
|
1968
|
-
*/
|
|
1969
|
-
membersOnly?: boolean;
|
|
1970
1964
|
}
|
|
1971
1965
|
interface CustomItemQuantityInfo {
|
|
1972
1966
|
/**
|
|
@@ -2047,6 +2041,11 @@ interface CustomItemAttributes {
|
|
|
2047
2041
|
subscriptionInfo?: SubscriptionOptionInfo;
|
|
2048
2042
|
/** Service properties. When relevant, this contains information such as date and number of participants. */
|
|
2049
2043
|
serviceProperties?: ServiceProperties;
|
|
2044
|
+
/**
|
|
2045
|
+
* Whether the item can only be purchased by site members.
|
|
2046
|
+
* Default: `false`
|
|
2047
|
+
*/
|
|
2048
|
+
membersOnly?: boolean;
|
|
2050
2049
|
}
|
|
2051
2050
|
interface CustomItemDeliveryConfig {
|
|
2052
2051
|
/**
|
|
@@ -2192,7 +2191,7 @@ interface UpdateLineItemsInCurrentCartRequest {
|
|
|
2192
2191
|
* @minSize 1
|
|
2193
2192
|
* @maxSize 100
|
|
2194
2193
|
*/
|
|
2195
|
-
|
|
2194
|
+
lineItems?: LineItemUpdate[];
|
|
2196
2195
|
}
|
|
2197
2196
|
interface LineItemUpdate {
|
|
2198
2197
|
/**
|
|
@@ -2201,9 +2200,9 @@ interface LineItemUpdate {
|
|
|
2201
2200
|
*/
|
|
2202
2201
|
lineItemId?: string;
|
|
2203
2202
|
/** Quantity update (optional - if not provided, quantity is not updated) */
|
|
2204
|
-
|
|
2203
|
+
quantity?: QuantityUpdate;
|
|
2205
2204
|
/** Selected membership update (optional - if not provided, membership is not updated) */
|
|
2206
|
-
|
|
2205
|
+
selectedMembership?: SelectedMembershipUpdate;
|
|
2207
2206
|
}
|
|
2208
2207
|
interface QuantityUpdate {
|
|
2209
2208
|
/**
|
|
@@ -2211,7 +2210,7 @@ interface QuantityUpdate {
|
|
|
2211
2210
|
* @min 1
|
|
2212
2211
|
* @max 100000
|
|
2213
2212
|
*/
|
|
2214
|
-
|
|
2213
|
+
newQuantity?: number;
|
|
2215
2214
|
}
|
|
2216
2215
|
interface SelectedMembershipUpdate {
|
|
2217
2216
|
/**
|
|
@@ -2219,7 +2218,7 @@ interface SelectedMembershipUpdate {
|
|
|
2219
2218
|
*
|
|
2220
2219
|
* To just remove current selected membership, and not replace with a new one, pass an empty value here.
|
|
2221
2220
|
*/
|
|
2222
|
-
|
|
2221
|
+
newMembership?: V2SelectedMembership;
|
|
2223
2222
|
}
|
|
2224
2223
|
interface UpdateLineItemsInCurrentCartResponse {
|
|
2225
2224
|
/** Updated Cart. */
|
|
@@ -2529,7 +2528,7 @@ interface GetCheckoutURLResponse {
|
|
|
2529
2528
|
*/
|
|
2530
2529
|
checkoutUrl?: string;
|
|
2531
2530
|
}
|
|
2532
|
-
interface
|
|
2531
|
+
interface PlaceOrderRequest {
|
|
2533
2532
|
/**
|
|
2534
2533
|
* Cart ID.
|
|
2535
2534
|
* @format GUID
|
|
@@ -2571,7 +2570,7 @@ interface RedirectUrls {
|
|
|
2571
2570
|
*/
|
|
2572
2571
|
pendingUrl?: string | null;
|
|
2573
2572
|
}
|
|
2574
|
-
interface
|
|
2573
|
+
interface PlaceOrderResponse {
|
|
2575
2574
|
/**
|
|
2576
2575
|
* The order ID of the created order.
|
|
2577
2576
|
* @format GUID
|
|
@@ -2633,6 +2632,23 @@ interface RemoveLineItemsResponse {
|
|
|
2633
2632
|
/** Updated Cart. */
|
|
2634
2633
|
cart?: Cart;
|
|
2635
2634
|
}
|
|
2635
|
+
interface UpdateLineItemsRequest {
|
|
2636
|
+
/**
|
|
2637
|
+
* Cart ID.
|
|
2638
|
+
* @format GUID
|
|
2639
|
+
*/
|
|
2640
|
+
cartId?: string;
|
|
2641
|
+
/**
|
|
2642
|
+
* Line item updates to apply.
|
|
2643
|
+
* @minSize 1
|
|
2644
|
+
* @maxSize 300
|
|
2645
|
+
*/
|
|
2646
|
+
lineItems?: LineItemUpdate[];
|
|
2647
|
+
}
|
|
2648
|
+
interface UpdateLineItemsResponse {
|
|
2649
|
+
/** Updated Cart. */
|
|
2650
|
+
cart?: Cart;
|
|
2651
|
+
}
|
|
2636
2652
|
interface AddDiscountRequest {
|
|
2637
2653
|
/**
|
|
2638
2654
|
* Cart ID.
|
|
@@ -2702,23 +2718,6 @@ interface RemoveGiftCardResponse {
|
|
|
2702
2718
|
/** Updated Cart. */
|
|
2703
2719
|
cart?: Cart;
|
|
2704
2720
|
}
|
|
2705
|
-
interface UpdateLineItemsRequest {
|
|
2706
|
-
/**
|
|
2707
|
-
* Cart ID.
|
|
2708
|
-
* @format GUID
|
|
2709
|
-
*/
|
|
2710
|
-
cartId?: string;
|
|
2711
|
-
/**
|
|
2712
|
-
* Line item updates to apply.
|
|
2713
|
-
* @minSize 1
|
|
2714
|
-
* @maxSize 100
|
|
2715
|
-
*/
|
|
2716
|
-
lineItemUpdates?: LineItemUpdate[];
|
|
2717
|
-
}
|
|
2718
|
-
interface UpdateLineItemsResponse {
|
|
2719
|
-
/** Updated Cart. */
|
|
2720
|
-
cart?: Cart;
|
|
2721
|
-
}
|
|
2722
2721
|
interface MarkCartAsCompletedRequest {
|
|
2723
2722
|
/**
|
|
2724
2723
|
* Cart ID.
|
|
@@ -2817,7 +2816,7 @@ interface UpdateLineItemsInCurrentCartOptions {
|
|
|
2817
2816
|
* @minSize 1
|
|
2818
2817
|
* @maxSize 100
|
|
2819
2818
|
*/
|
|
2820
|
-
|
|
2819
|
+
lineItems?: LineItemUpdate[];
|
|
2821
2820
|
}
|
|
2822
2821
|
|
|
2823
|
-
export { type ActionEvent, type AddDiscountRequest, type AddDiscountResponse, type AddDiscountToCurrentCartRequest, type AddDiscountToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartOptions, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartOptions, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, CalculationComponent, type CalculationComponentWithLiterals, type CalculationConfig, type CalculationError, type Cart, type
|
|
2822
|
+
export { type ActionEvent, type AddDiscountRequest, type AddDiscountResponse, type AddDiscountToCurrentCartRequest, type AddDiscountToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartOptions, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartRequest, type CalculateCartResponse, type CalculateCurrentCartOptions, type CalculateCurrentCartRequest, type CalculateCurrentCartResponse, CalculationComponent, type CalculationComponentWithLiterals, type CalculationConfig, type CalculationError, type Cart, type CartSettings, type CartSource, type CartSummary, type CatalogItemInput, type CatalogOverrideFields, type CatalogReference, ChannelType, type ChannelTypeWithLiterals, type Color, type CreateCartRequest, type CreateCartResponse, type CreateCurrentCartOptions, type CreateCurrentCartRequest, type CreateCurrentCartResponse, type CreatedBy, type CreatedByIdOneOf, type CustomContentReference, type CustomField, type CustomItemAttributes, type CustomItemDeliveryConfig, type CustomItemInput, type CustomItemPaymentConfig, type CustomItemPricingInfo, type CustomItemQuantityInfo, type CustomItemSource, type CustomItemTaxConfig, type CustomerInfo, type CustomerInfoIdOneOf, type DeleteCartRequest, type DeleteCartResponse, type DeleteCurrentCartRequest, type DeleteCurrentCartResponse, type DeliveryInfo, type DeliveryMethod, type DeliverySummary, type Description, type DescriptionLine, type DescriptionLineDescriptionLineValueOneOf, type DescriptionLineName, DescriptionLineType, type DescriptionLineTypeWithLiterals, type DescriptionLineValueOneOf, type Details, type DetailsKindOneOf, type Discount, type DiscountBenefit, type DiscountBenefitValueOneOf, DiscountScope, type DiscountScopeWithLiterals, type DiscountSource, DiscountSourceType, type DiscountSourceTypeWithLiterals, DiscountStatus, type DiscountStatusWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, ErrorCode, type ErrorCodeWithLiterals, type ExtendedFields, type ExternalReference, type FieldViolation, FileType, type FileTypeWithLiterals, type FreeTrialPeriod, type FullAddressContactDetails, type GetCartRequest, type GetCartResponse, type GetCheckoutURLRequest, type GetCheckoutURLResponse, type GetCurrentCartRequest, type GetCurrentCartResponse, type GiftCard, type GiftCardSummary, type Group, type HandleAsyncCheckoutCompletionRequest, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type ItemAttributes, type ItemDeliveryConfig, type ItemModifier, type ItemPaymentConfig, type ItemPriceBreakdown, type ItemPricingInfo, type ItemQuantityInfo, type ItemSource, ItemStatus, type ItemStatusWithLiterals, type ItemTaxConfig, type ItemType, ItemTypeItemType, type ItemTypeItemTypeDataOneOf, type ItemTypeItemTypeWithLiterals, type LineItem, type LineItemSummary, type LineItemTax, type LineItemUpdate, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type MessageEnvelope, type ModifierGroup, type MultiCurrencyPrice, NameInLineItem, type NameInLineItemWithLiterals, NameInOther, type NameInOtherWithLiterals, type Other, type PaymentInfo, type PaymentOption, PaymentOptionType, type PaymentOptionTypeWithLiterals, type PaymentSummary, type PhysicalProperties, type PlaceOrderRequest, type PlaceOrderResponse, type PlainTextValue, type Policy, type PriceDescription, type PriceSummary, type QuantityUpdate, type RawHttpResponse, type RedirectUrls, type RefreshCartRequest, type RefreshCartResponse, type RefreshCurrentCartRequest, type RefreshCurrentCartResponse, type RemoveDiscountFromCurrentCartRequest, type RemoveDiscountFromCurrentCartResponse, type RemoveDiscountRequest, type RemoveDiscountResponse, type RemoveGiftCardFromCurrentCartRequest, type RemoveGiftCardFromCurrentCartResponse, type RemoveGiftCardRequest, type RemoveGiftCardResponse, type RemoveLineItemsFromCurrentCartRequest, type RemoveLineItemsFromCurrentCartResponse, type RemoveLineItemsRequest, type RemoveLineItemsResponse, type RestoreInfo, RuleType, type RuleTypeWithLiterals, type Scope, type SecuredMedia, type SelectedMembership, type SelectedMembershipUpdate, type ServiceProperties, Severity, type SeverityWithLiterals, type StreetAddress, SubscriptionFrequency, type SubscriptionFrequencyWithLiterals, type SubscriptionOptionInfo, type SubscriptionSettings, SuggestedFix, type SuggestedFixWithLiterals, type SystemError, type Target, type TargetTargetTypeOneOf, type Tax, type TaxDetails, type TaxInfo, type TaxSummary, type TaxableAddress, type TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, type TaxableAddressTypeWithLiterals, type Title, type TranslatableString, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartOptions, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsRequest, type UpdateLineItemsResponse, type V2AdditionalFee, type V2LineItem, type V2SelectedMembership, type ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals };
|
package/build/cjs/index.js
CHANGED
|
@@ -21,7 +21,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
CalculationComponent: () => CalculationComponent,
|
|
24
|
-
CartStatus: () => CartStatus,
|
|
25
24
|
ChannelType: () => ChannelType,
|
|
26
25
|
DescriptionLineType: () => DescriptionLineType,
|
|
27
26
|
DiscountScope: () => DiscountScope,
|
|
@@ -938,10 +937,10 @@ var TaxableAddressType = /* @__PURE__ */ ((TaxableAddressType2) => {
|
|
|
938
937
|
})(TaxableAddressType || {});
|
|
939
938
|
var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
940
939
|
ItemStatus2["UNKNOWN_ITEM_STATUS"] = "UNKNOWN_ITEM_STATUS";
|
|
941
|
-
ItemStatus2["
|
|
942
|
-
ItemStatus2["
|
|
940
|
+
ItemStatus2["IN_STOCK"] = "IN_STOCK";
|
|
941
|
+
ItemStatus2["PARTIALLY_IN_STOCK"] = "PARTIALLY_IN_STOCK";
|
|
943
942
|
ItemStatus2["OUT_OF_STOCK"] = "OUT_OF_STOCK";
|
|
944
|
-
ItemStatus2["
|
|
943
|
+
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
945
944
|
return ItemStatus2;
|
|
946
945
|
})(ItemStatus || {});
|
|
947
946
|
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
@@ -985,23 +984,18 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
|
985
984
|
ChannelType2["PAYPAL_AGENTIC_CHECKOUT"] = "PAYPAL_AGENTIC_CHECKOUT";
|
|
986
985
|
return ChannelType2;
|
|
987
986
|
})(ChannelType || {});
|
|
988
|
-
var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
989
|
-
WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
990
|
-
WeightUnit2["KG"] = "KG";
|
|
991
|
-
WeightUnit2["LB"] = "LB";
|
|
992
|
-
return WeightUnit2;
|
|
993
|
-
})(WeightUnit || {});
|
|
994
987
|
var VatType = /* @__PURE__ */ ((VatType2) => {
|
|
995
988
|
VatType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
996
989
|
VatType2["CPF"] = "CPF";
|
|
997
990
|
VatType2["CNPJ"] = "CNPJ";
|
|
998
991
|
return VatType2;
|
|
999
992
|
})(VatType || {});
|
|
1000
|
-
var
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
993
|
+
var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
994
|
+
WeightUnit2["UNSPECIFIED_WEIGHT_UNIT"] = "UNSPECIFIED_WEIGHT_UNIT";
|
|
995
|
+
WeightUnit2["KG"] = "KG";
|
|
996
|
+
WeightUnit2["LB"] = "LB";
|
|
997
|
+
return WeightUnit2;
|
|
998
|
+
})(WeightUnit || {});
|
|
1005
999
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
1006
1000
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
1007
1001
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1495,7 +1489,7 @@ async function removeLineItemsFromCurrentCart2(lineItemIds) {
|
|
|
1495
1489
|
async function updateLineItemsInCurrentCart2(options) {
|
|
1496
1490
|
const { httpClient, sideEffects } = arguments[1];
|
|
1497
1491
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1498
|
-
|
|
1492
|
+
lineItems: options?.lineItems
|
|
1499
1493
|
});
|
|
1500
1494
|
const reqOpts = updateLineItemsInCurrentCart(payload);
|
|
1501
1495
|
sideEffects?.onSiteCall?.();
|
|
@@ -1529,7 +1523,7 @@ async function updateLineItemsInCurrentCart2(options) {
|
|
|
1529
1523
|
err,
|
|
1530
1524
|
{
|
|
1531
1525
|
spreadPathsToArguments: {},
|
|
1532
|
-
explicitPathsToArguments: {
|
|
1526
|
+
explicitPathsToArguments: { lineItems: "$[0].lineItems" },
|
|
1533
1527
|
singleArgumentUnchanged: false
|
|
1534
1528
|
},
|
|
1535
1529
|
["options"]
|
|
@@ -1832,7 +1826,6 @@ var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
1832
1826
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1833
1827
|
0 && (module.exports = {
|
|
1834
1828
|
CalculationComponent,
|
|
1835
|
-
CartStatus,
|
|
1836
1829
|
ChannelType,
|
|
1837
1830
|
DescriptionLineType,
|
|
1838
1831
|
DiscountScope,
|