@wix/auto_sdk_ecom_current-cart-v-2 1.0.8 → 1.0.10
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 +119 -101
- package/build/cjs/index.js +41 -53
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +34 -46
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +105 -99
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +119 -101
- package/build/es/index.mjs +39 -50
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +32 -43
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +105 -99
- package/build/es/meta.mjs +18 -18
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +24 -28
- package/build/internal/cjs/index.js +41 -53
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +137 -123
- package/build/internal/cjs/index.typings.js +34 -46
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +105 -99
- package/build/internal/cjs/meta.js +20 -20
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +24 -28
- package/build/internal/es/index.mjs +39 -50
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +137 -123
- package/build/internal/es/index.typings.mjs +32 -43
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +105 -99
- package/build/internal/es/meta.mjs +18 -18
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -37,13 +37,11 @@ interface Cart {
|
|
|
37
37
|
*/
|
|
38
38
|
note?: string | null;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @maxSize 100
|
|
44
|
-
* @readonly
|
|
40
|
+
* List of coupons added to the Cart.
|
|
41
|
+
* Currently, only one coupon code is supported.
|
|
42
|
+
* @maxSize 1
|
|
45
43
|
*/
|
|
46
|
-
|
|
44
|
+
coupons?: Coupon[];
|
|
47
45
|
/** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
|
|
48
46
|
source?: CartSource;
|
|
49
47
|
/** Information about the site from which the Cart's line items were added. */
|
|
@@ -138,6 +136,11 @@ interface V2LineItem {
|
|
|
138
136
|
* @maxSize 25
|
|
139
137
|
*/
|
|
140
138
|
modifierGroups?: ModifierGroup[];
|
|
139
|
+
/**
|
|
140
|
+
* List of discounts applied to this line item.
|
|
141
|
+
* @maxSize 100
|
|
142
|
+
*/
|
|
143
|
+
discounts?: ItemDiscount[];
|
|
141
144
|
/**
|
|
142
145
|
* Whether the line item is a custom line item.
|
|
143
146
|
* Custom line items don't trigger the Catalog service plugin.
|
|
@@ -742,6 +745,11 @@ interface SelectedMembership {
|
|
|
742
745
|
* @format GUID
|
|
743
746
|
*/
|
|
744
747
|
appId?: string;
|
|
748
|
+
/**
|
|
749
|
+
* Name of the selected membership.
|
|
750
|
+
* @readonly
|
|
751
|
+
*/
|
|
752
|
+
name?: TranslatableString;
|
|
745
753
|
}
|
|
746
754
|
declare enum ItemStatus {
|
|
747
755
|
UNKNOWN_ITEM_STATUS = "UNKNOWN_ITEM_STATUS",
|
|
@@ -842,6 +850,16 @@ interface ItemModifier {
|
|
|
842
850
|
/** The price of the modifier. */
|
|
843
851
|
price?: MultiCurrencyPrice;
|
|
844
852
|
}
|
|
853
|
+
/**
|
|
854
|
+
* Currently, only automatic discounts are applied to line items.
|
|
855
|
+
* In the future, coupon discounts will be supported as well.
|
|
856
|
+
*/
|
|
857
|
+
interface ItemDiscount {
|
|
858
|
+
/** The display name of the discount. */
|
|
859
|
+
name?: TranslatableString;
|
|
860
|
+
/** The amount discounted from the item's sale price (per unit). */
|
|
861
|
+
amountOff?: MultiCurrencyPrice;
|
|
862
|
+
}
|
|
845
863
|
interface Scope {
|
|
846
864
|
/** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
|
|
847
865
|
namespace?: string;
|
|
@@ -854,95 +872,19 @@ interface Group {
|
|
|
854
872
|
/** Item ID (when the coupon scope is limited to just one item). */
|
|
855
873
|
entityId?: string | null;
|
|
856
874
|
}
|
|
857
|
-
interface
|
|
875
|
+
interface Coupon {
|
|
858
876
|
/**
|
|
859
|
-
*
|
|
877
|
+
* ID of the coupon in the Cart.
|
|
860
878
|
* @format GUID
|
|
861
879
|
*/
|
|
862
880
|
_id?: string;
|
|
863
|
-
/** The display name of the discount. */
|
|
864
|
-
name?: TranslatableString;
|
|
865
|
-
/** The source of the discount, indicating how it was applied. */
|
|
866
|
-
source?: DiscountSource;
|
|
867
|
-
/** The component in the Cart that the discount applies to. */
|
|
868
|
-
scope?: DiscountScopeWithLiterals;
|
|
869
|
-
/**
|
|
870
|
-
* List of benefits provided by the discount.
|
|
871
|
-
* @minSize 1
|
|
872
|
-
* @maxSize 100
|
|
873
|
-
*/
|
|
874
|
-
benefits?: DiscountBenefit[];
|
|
875
881
|
/**
|
|
876
|
-
*
|
|
877
|
-
*
|
|
878
|
-
*/
|
|
879
|
-
status?: DiscountStatusWithLiterals;
|
|
880
|
-
/**
|
|
881
|
-
* Number of subscription cycles this discount applies to.
|
|
882
|
-
* If unset, the discount applies to all billing cycles.
|
|
883
|
-
* @min 1
|
|
884
|
-
* @max 1000
|
|
885
|
-
*/
|
|
886
|
-
subscriptionCycles?: number | null;
|
|
887
|
-
}
|
|
888
|
-
interface DiscountSource {
|
|
889
|
-
/** The type of the discount source. */
|
|
890
|
-
sourceType?: DiscountSourceTypeWithLiterals;
|
|
891
|
-
/**
|
|
892
|
-
* Coupon code that triggered the discount.
|
|
893
|
-
* Relevant for coupon discounts only.
|
|
882
|
+
* Coupon code.
|
|
883
|
+
* @minLength 1
|
|
894
884
|
* @maxLength 50
|
|
895
885
|
*/
|
|
896
|
-
|
|
897
|
-
}
|
|
898
|
-
declare enum DiscountSourceType {
|
|
899
|
-
UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
|
|
900
|
-
/** The discount was applied automatically by a rule. */
|
|
901
|
-
AUTOMATIC_RULE = "AUTOMATIC_RULE",
|
|
902
|
-
/** The discount was applied by a coupon code. */
|
|
903
|
-
COUPON = "COUPON"
|
|
904
|
-
}
|
|
905
|
-
/** @enumType */
|
|
906
|
-
type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
|
|
907
|
-
declare enum DiscountScope {
|
|
908
|
-
UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
|
|
909
|
-
/** The discount applies to the cart's subtotal. */
|
|
910
|
-
CART_SUBTOTAL = "CART_SUBTOTAL",
|
|
911
|
-
/** The discount applies to a specific line item. */
|
|
912
|
-
LINE_ITEM = "LINE_ITEM",
|
|
913
|
-
/** The discount applies to the delivery price. */
|
|
914
|
-
DELIVERY = "DELIVERY"
|
|
915
|
-
}
|
|
916
|
-
/** @enumType */
|
|
917
|
-
type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
|
|
918
|
-
interface DiscountBenefit extends DiscountBenefitValueOneOf {
|
|
919
|
-
/** A specific monetary value deducted from the total cost. */
|
|
920
|
-
amountOff?: MultiCurrencyPrice;
|
|
921
|
-
/**
|
|
922
|
-
* The ID of line item that the discount applies to.
|
|
923
|
-
* Relevant for item-level discounts only.
|
|
924
|
-
* @format GUID
|
|
925
|
-
*/
|
|
926
|
-
lineItemId?: string | null;
|
|
927
|
-
}
|
|
928
|
-
/** @oneof */
|
|
929
|
-
interface DiscountBenefitValueOneOf {
|
|
930
|
-
/** A specific monetary value deducted from the total cost. */
|
|
931
|
-
amountOff?: MultiCurrencyPrice;
|
|
932
|
-
}
|
|
933
|
-
declare enum DiscountStatus {
|
|
934
|
-
UNKNOWN_DISCOUNT_STATUS = "UNKNOWN_DISCOUNT_STATUS",
|
|
935
|
-
/** The discount is active and valid. */
|
|
936
|
-
ACTIVE = "ACTIVE",
|
|
937
|
-
/** The discount has expired. */
|
|
938
|
-
EXPIRED = "EXPIRED",
|
|
939
|
-
/** The discount was deleted from the system. */
|
|
940
|
-
DELETED = "DELETED",
|
|
941
|
-
/** The discount reached the maximum number of uses. */
|
|
942
|
-
MAX_USAGE_REACHED = "MAX_USAGE_REACHED"
|
|
886
|
+
code?: string;
|
|
943
887
|
}
|
|
944
|
-
/** @enumType */
|
|
945
|
-
type DiscountStatusWithLiterals = DiscountStatus | 'UNKNOWN_DISCOUNT_STATUS' | 'ACTIVE' | 'EXPIRED' | 'DELETED' | 'MAX_USAGE_REACHED';
|
|
946
888
|
interface CartSource {
|
|
947
889
|
/**
|
|
948
890
|
* Sales channel that created the Cart.
|
|
@@ -1443,6 +1385,84 @@ interface CustomField {
|
|
|
1443
1385
|
*/
|
|
1444
1386
|
translatedTitle?: string | null;
|
|
1445
1387
|
}
|
|
1388
|
+
interface LegacyFields {
|
|
1389
|
+
/**
|
|
1390
|
+
* The applied discounts of the Cart.
|
|
1391
|
+
* Discounts that are no longer applied are not included in this list.
|
|
1392
|
+
* @maxSize 100
|
|
1393
|
+
*/
|
|
1394
|
+
appliedDiscounts?: Discount[];
|
|
1395
|
+
/** The coupon discount amount. */
|
|
1396
|
+
couponDiscount?: MultiCurrencyPrice;
|
|
1397
|
+
/** The sum of all line items after applying all discounts. */
|
|
1398
|
+
subtotalAfterCouponDiscount?: MultiCurrencyPrice;
|
|
1399
|
+
}
|
|
1400
|
+
interface Discount {
|
|
1401
|
+
/** The display name of the discount. */
|
|
1402
|
+
name?: TranslatableString;
|
|
1403
|
+
/** The source of the discount, indicating how it was applied. */
|
|
1404
|
+
source?: DiscountSource;
|
|
1405
|
+
/** The component in the Cart that the discount applies to. */
|
|
1406
|
+
scope?: DiscountScopeWithLiterals;
|
|
1407
|
+
/**
|
|
1408
|
+
* List of benefits provided by the discount.
|
|
1409
|
+
* @minSize 1
|
|
1410
|
+
* @maxSize 100
|
|
1411
|
+
*/
|
|
1412
|
+
benefits?: DiscountBenefit[];
|
|
1413
|
+
/**
|
|
1414
|
+
* Number of subscription cycles this discount applies to.
|
|
1415
|
+
* If unset, the discount applies to all billing cycles.
|
|
1416
|
+
* @min 1
|
|
1417
|
+
* @max 1000
|
|
1418
|
+
*/
|
|
1419
|
+
subscriptionCycles?: number | null;
|
|
1420
|
+
}
|
|
1421
|
+
interface DiscountSource {
|
|
1422
|
+
/** The type of the discount source. */
|
|
1423
|
+
sourceType?: DiscountSourceTypeWithLiterals;
|
|
1424
|
+
/**
|
|
1425
|
+
* Coupon code that triggered the discount.
|
|
1426
|
+
* Relevant for coupon discounts only.
|
|
1427
|
+
* @maxLength 50
|
|
1428
|
+
*/
|
|
1429
|
+
couponCode?: string | null;
|
|
1430
|
+
}
|
|
1431
|
+
declare enum DiscountSourceType {
|
|
1432
|
+
UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
|
|
1433
|
+
/** The discount was applied automatically by a rule. */
|
|
1434
|
+
AUTOMATIC_RULE = "AUTOMATIC_RULE",
|
|
1435
|
+
/** The discount was applied by a coupon code. */
|
|
1436
|
+
COUPON = "COUPON"
|
|
1437
|
+
}
|
|
1438
|
+
/** @enumType */
|
|
1439
|
+
type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
|
|
1440
|
+
declare enum DiscountScope {
|
|
1441
|
+
UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
|
|
1442
|
+
/** The discount applies to the cart's subtotal. */
|
|
1443
|
+
CART_SUBTOTAL = "CART_SUBTOTAL",
|
|
1444
|
+
/** The discount applies to a specific line item. */
|
|
1445
|
+
LINE_ITEM = "LINE_ITEM",
|
|
1446
|
+
/** The discount applies to the delivery price. */
|
|
1447
|
+
DELIVERY = "DELIVERY"
|
|
1448
|
+
}
|
|
1449
|
+
/** @enumType */
|
|
1450
|
+
type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
|
|
1451
|
+
interface DiscountBenefit extends DiscountBenefitValueOneOf {
|
|
1452
|
+
/** A specific monetary value deducted from the total cost. */
|
|
1453
|
+
amountOff?: MultiCurrencyPrice;
|
|
1454
|
+
/**
|
|
1455
|
+
* The ID of line item that the discount applies to.
|
|
1456
|
+
* Relevant for item-level discounts only.
|
|
1457
|
+
* @format GUID
|
|
1458
|
+
*/
|
|
1459
|
+
lineItemId?: string | null;
|
|
1460
|
+
}
|
|
1461
|
+
/** @oneof */
|
|
1462
|
+
interface DiscountBenefitValueOneOf {
|
|
1463
|
+
/** A specific monetary value deducted from the total cost. */
|
|
1464
|
+
amountOff?: MultiCurrencyPrice;
|
|
1465
|
+
}
|
|
1446
1466
|
interface CartSummary {
|
|
1447
1467
|
/**
|
|
1448
1468
|
* The Cart ID.
|
|
@@ -1711,8 +1731,6 @@ interface Membership {
|
|
|
1711
1731
|
* @maxLength 100
|
|
1712
1732
|
*/
|
|
1713
1733
|
lineItemIds?: string[];
|
|
1714
|
-
/** The name of this membership. */
|
|
1715
|
-
name?: TranslatableString;
|
|
1716
1734
|
}
|
|
1717
1735
|
interface SubscriptionCharges {
|
|
1718
1736
|
/**
|
|
@@ -2286,7 +2304,7 @@ interface UpdateLineItemsInCurrentCartResponse {
|
|
|
2286
2304
|
/** Updated Cart. */
|
|
2287
2305
|
cart?: Cart;
|
|
2288
2306
|
}
|
|
2289
|
-
interface
|
|
2307
|
+
interface AddCouponToCurrentCartRequest {
|
|
2290
2308
|
/**
|
|
2291
2309
|
* Coupon to apply.
|
|
2292
2310
|
*
|
|
@@ -2296,18 +2314,18 @@ interface AddDiscountToCurrentCartRequest {
|
|
|
2296
2314
|
*/
|
|
2297
2315
|
couponCode: string;
|
|
2298
2316
|
}
|
|
2299
|
-
interface
|
|
2317
|
+
interface AddCouponToCurrentCartResponse {
|
|
2300
2318
|
/** Updated Cart. */
|
|
2301
2319
|
cart?: Cart;
|
|
2302
2320
|
}
|
|
2303
|
-
interface
|
|
2321
|
+
interface RemoveCouponFromCurrentCartRequest {
|
|
2304
2322
|
/**
|
|
2305
|
-
*
|
|
2323
|
+
* Coupon ID.
|
|
2306
2324
|
* @format GUID
|
|
2307
2325
|
*/
|
|
2308
|
-
|
|
2326
|
+
couponId: string;
|
|
2309
2327
|
}
|
|
2310
|
-
interface
|
|
2328
|
+
interface RemoveCouponFromCurrentCartResponse {
|
|
2311
2329
|
/** Updated Cart. */
|
|
2312
2330
|
cart?: Cart;
|
|
2313
2331
|
}
|
|
@@ -2711,7 +2729,7 @@ interface UpdateLineItemsResponse {
|
|
|
2711
2729
|
/** Updated Cart. */
|
|
2712
2730
|
cart?: Cart;
|
|
2713
2731
|
}
|
|
2714
|
-
interface
|
|
2732
|
+
interface AddCouponRequest {
|
|
2715
2733
|
/**
|
|
2716
2734
|
* Cart ID.
|
|
2717
2735
|
* @format GUID
|
|
@@ -2726,11 +2744,11 @@ interface AddDiscountRequest {
|
|
|
2726
2744
|
*/
|
|
2727
2745
|
couponCode?: string;
|
|
2728
2746
|
}
|
|
2729
|
-
interface
|
|
2747
|
+
interface AddCouponResponse {
|
|
2730
2748
|
/** Updated Cart. */
|
|
2731
2749
|
cart?: Cart;
|
|
2732
2750
|
}
|
|
2733
|
-
interface
|
|
2751
|
+
interface RemoveCouponRequest {
|
|
2734
2752
|
/**
|
|
2735
2753
|
* Cart ID.
|
|
2736
2754
|
* @format GUID
|
|
@@ -2740,9 +2758,9 @@ interface RemoveDiscountRequest {
|
|
|
2740
2758
|
* Discount ID.
|
|
2741
2759
|
* @format GUID
|
|
2742
2760
|
*/
|
|
2743
|
-
|
|
2761
|
+
couponId?: string;
|
|
2744
2762
|
}
|
|
2745
|
-
interface
|
|
2763
|
+
interface RemoveCouponResponse {
|
|
2746
2764
|
/** Updated Cart. */
|
|
2747
2765
|
cart?: Cart;
|
|
2748
2766
|
}
|
|
@@ -2881,4 +2899,4 @@ interface UpdateLineItemsInCurrentCartOptions {
|
|
|
2881
2899
|
lineItems?: LineItemUpdate[];
|
|
2882
2900
|
}
|
|
2883
2901
|
|
|
2884
|
-
export { type ActionEvent, type
|
|
2902
|
+
export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, 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 Charge, type Color, type Coupon, 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, 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 ItemDiscount, 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 LegacyFields, type LineItem, type LineItemSummary, type LineItemTax, type LineItemUpdate, type MarkCartAsCompletedRequest, type MarkCartAsCompletedResponse, type Membership, 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 RemoveCouponFromCurrentCartRequest, type RemoveCouponFromCurrentCartResponse, type RemoveCouponRequest, type RemoveCouponResponse, 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, type SubscriptionCharges, 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 ValidationError, ValidationsConfig, type ValidationsConfigWithLiterals, type VatId, VatType, type VatTypeWithLiterals, type Violation, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeightUnit, type WeightUnitWithLiterals };
|
package/build/cjs/index.js
CHANGED
|
@@ -25,7 +25,6 @@ __export(index_exports, {
|
|
|
25
25
|
DescriptionLineType: () => DescriptionLineType,
|
|
26
26
|
DiscountScope: () => DiscountScope,
|
|
27
27
|
DiscountSourceType: () => DiscountSourceType,
|
|
28
|
-
DiscountStatus: () => DiscountStatus,
|
|
29
28
|
ErrorCode: () => ErrorCode,
|
|
30
29
|
FileType: () => FileType,
|
|
31
30
|
ItemStatus: () => ItemStatus,
|
|
@@ -42,7 +41,7 @@ __export(index_exports, {
|
|
|
42
41
|
VatType: () => VatType,
|
|
43
42
|
WebhookIdentityType: () => WebhookIdentityType,
|
|
44
43
|
WeightUnit: () => WeightUnit,
|
|
45
|
-
|
|
44
|
+
addCouponToCurrentCart: () => addCouponToCurrentCart4,
|
|
46
45
|
addGiftCardToCurrentCart: () => addGiftCardToCurrentCart4,
|
|
47
46
|
addLineItemsToCurrentCart: () => addLineItemsToCurrentCart4,
|
|
48
47
|
calculateCurrentCart: () => calculateCurrentCart4,
|
|
@@ -50,7 +49,7 @@ __export(index_exports, {
|
|
|
50
49
|
deleteCurrentCart: () => deleteCurrentCart4,
|
|
51
50
|
getCurrentCart: () => getCurrentCart4,
|
|
52
51
|
refreshCurrentCart: () => refreshCurrentCart4,
|
|
53
|
-
|
|
52
|
+
removeCouponFromCurrentCart: () => removeCouponFromCurrentCart4,
|
|
54
53
|
removeGiftCardFromCurrentCart: () => removeGiftCardFromCurrentCart4,
|
|
55
54
|
removeLineItemsFromCurrentCart: () => removeLineItemsFromCurrentCart4,
|
|
56
55
|
updateCurrentCart: () => updateCurrentCart4,
|
|
@@ -682,15 +681,15 @@ function updateLineItemsInCurrentCart(payload) {
|
|
|
682
681
|
}
|
|
683
682
|
return __updateLineItemsInCurrentCart;
|
|
684
683
|
}
|
|
685
|
-
function
|
|
686
|
-
function
|
|
684
|
+
function addCouponToCurrentCart(payload) {
|
|
685
|
+
function __addCouponToCurrentCart({ host }) {
|
|
687
686
|
const metadata = {
|
|
688
687
|
entityFqdn: "wix.ecom.v2.cart",
|
|
689
688
|
method: "POST",
|
|
690
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
689
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.AddCouponToCurrentCart",
|
|
691
690
|
packageName: PACKAGE_NAME,
|
|
692
691
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
693
|
-
protoPath: "/v2/carts/current/add-
|
|
692
|
+
protoPath: "/v2/carts/current/add-coupon",
|
|
694
693
|
data: payload,
|
|
695
694
|
host
|
|
696
695
|
}),
|
|
@@ -730,17 +729,17 @@ function addDiscountToCurrentCart(payload) {
|
|
|
730
729
|
};
|
|
731
730
|
return metadata;
|
|
732
731
|
}
|
|
733
|
-
return
|
|
732
|
+
return __addCouponToCurrentCart;
|
|
734
733
|
}
|
|
735
|
-
function
|
|
736
|
-
function
|
|
734
|
+
function removeCouponFromCurrentCart(payload) {
|
|
735
|
+
function __removeCouponFromCurrentCart({ host }) {
|
|
737
736
|
const metadata = {
|
|
738
737
|
entityFqdn: "wix.ecom.v2.cart",
|
|
739
738
|
method: "POST",
|
|
740
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
739
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.RemoveCouponFromCurrentCart",
|
|
741
740
|
packageName: PACKAGE_NAME,
|
|
742
741
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
743
|
-
protoPath: "/v2/carts/current/remove-
|
|
742
|
+
protoPath: "/v2/carts/current/remove-coupon",
|
|
744
743
|
data: payload,
|
|
745
744
|
host
|
|
746
745
|
}),
|
|
@@ -780,7 +779,7 @@ function removeDiscountFromCurrentCart(payload) {
|
|
|
780
779
|
};
|
|
781
780
|
return metadata;
|
|
782
781
|
}
|
|
783
|
-
return
|
|
782
|
+
return __removeCouponFromCurrentCart;
|
|
784
783
|
}
|
|
785
784
|
function addGiftCardToCurrentCart(payload) {
|
|
786
785
|
function __addGiftCardToCurrentCart({ host }) {
|
|
@@ -946,27 +945,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
|
946
945
|
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
947
946
|
return ItemStatus2;
|
|
948
947
|
})(ItemStatus || {});
|
|
949
|
-
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
950
|
-
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
951
|
-
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
952
|
-
DiscountSourceType2["COUPON"] = "COUPON";
|
|
953
|
-
return DiscountSourceType2;
|
|
954
|
-
})(DiscountSourceType || {});
|
|
955
|
-
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
956
|
-
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
957
|
-
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
958
|
-
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
959
|
-
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
960
|
-
return DiscountScope2;
|
|
961
|
-
})(DiscountScope || {});
|
|
962
|
-
var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
|
|
963
|
-
DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
|
|
964
|
-
DiscountStatus2["ACTIVE"] = "ACTIVE";
|
|
965
|
-
DiscountStatus2["EXPIRED"] = "EXPIRED";
|
|
966
|
-
DiscountStatus2["DELETED"] = "DELETED";
|
|
967
|
-
DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
|
|
968
|
-
return DiscountStatus2;
|
|
969
|
-
})(DiscountStatus || {});
|
|
970
948
|
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
971
949
|
ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
972
950
|
ChannelType2["WEB"] = "WEB";
|
|
@@ -999,6 +977,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
999
977
|
WeightUnit2["LB"] = "LB";
|
|
1000
978
|
return WeightUnit2;
|
|
1001
979
|
})(WeightUnit || {});
|
|
980
|
+
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
981
|
+
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
982
|
+
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
983
|
+
DiscountSourceType2["COUPON"] = "COUPON";
|
|
984
|
+
return DiscountSourceType2;
|
|
985
|
+
})(DiscountSourceType || {});
|
|
986
|
+
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
987
|
+
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
988
|
+
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
989
|
+
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
990
|
+
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
991
|
+
return DiscountScope2;
|
|
992
|
+
})(DiscountScope || {});
|
|
1002
993
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
1003
994
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
1004
995
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1535,12 +1526,12 @@ async function updateLineItemsInCurrentCart2(options) {
|
|
|
1535
1526
|
throw transformedError;
|
|
1536
1527
|
}
|
|
1537
1528
|
}
|
|
1538
|
-
async function
|
|
1529
|
+
async function addCouponToCurrentCart2(couponCode) {
|
|
1539
1530
|
const { httpClient, sideEffects } = arguments[1];
|
|
1540
1531
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1541
1532
|
couponCode
|
|
1542
1533
|
});
|
|
1543
|
-
const reqOpts =
|
|
1534
|
+
const reqOpts = addCouponToCurrentCart(payload);
|
|
1544
1535
|
sideEffects?.onSiteCall?.();
|
|
1545
1536
|
try {
|
|
1546
1537
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1581,12 +1572,10 @@ async function addDiscountToCurrentCart2(couponCode) {
|
|
|
1581
1572
|
throw transformedError;
|
|
1582
1573
|
}
|
|
1583
1574
|
}
|
|
1584
|
-
async function
|
|
1575
|
+
async function removeCouponFromCurrentCart2(couponId) {
|
|
1585
1576
|
const { httpClient, sideEffects } = arguments[1];
|
|
1586
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1587
|
-
|
|
1588
|
-
});
|
|
1589
|
-
const reqOpts = removeDiscountFromCurrentCart(payload);
|
|
1577
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ couponId });
|
|
1578
|
+
const reqOpts = removeCouponFromCurrentCart(payload);
|
|
1590
1579
|
sideEffects?.onSiteCall?.();
|
|
1591
1580
|
try {
|
|
1592
1581
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1618,10 +1607,10 @@ async function removeDiscountFromCurrentCart2(discountId) {
|
|
|
1618
1607
|
err,
|
|
1619
1608
|
{
|
|
1620
1609
|
spreadPathsToArguments: {},
|
|
1621
|
-
explicitPathsToArguments: {
|
|
1610
|
+
explicitPathsToArguments: { couponId: "$[0]" },
|
|
1622
1611
|
singleArgumentUnchanged: false
|
|
1623
1612
|
},
|
|
1624
|
-
["
|
|
1613
|
+
["couponId"]
|
|
1625
1614
|
);
|
|
1626
1615
|
sideEffects?.onError?.(err);
|
|
1627
1616
|
throw transformedError;
|
|
@@ -1782,16 +1771,16 @@ function updateLineItemsInCurrentCart3(httpClient) {
|
|
|
1782
1771
|
{ httpClient }
|
|
1783
1772
|
);
|
|
1784
1773
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return (couponCode) =>
|
|
1774
|
+
function addCouponToCurrentCart3(httpClient) {
|
|
1775
|
+
return (couponCode) => addCouponToCurrentCart2(
|
|
1787
1776
|
couponCode,
|
|
1788
1777
|
// @ts-ignore
|
|
1789
1778
|
{ httpClient }
|
|
1790
1779
|
);
|
|
1791
1780
|
}
|
|
1792
|
-
function
|
|
1793
|
-
return (
|
|
1794
|
-
|
|
1781
|
+
function removeCouponFromCurrentCart3(httpClient) {
|
|
1782
|
+
return (couponId) => removeCouponFromCurrentCart2(
|
|
1783
|
+
couponId,
|
|
1795
1784
|
// @ts-ignore
|
|
1796
1785
|
{ httpClient }
|
|
1797
1786
|
);
|
|
@@ -1822,8 +1811,8 @@ var calculateCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTM
|
|
|
1822
1811
|
var addLineItemsToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addLineItemsToCurrentCart3);
|
|
1823
1812
|
var removeLineItemsFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeLineItemsFromCurrentCart3);
|
|
1824
1813
|
var updateLineItemsInCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateLineItemsInCurrentCart3);
|
|
1825
|
-
var
|
|
1826
|
-
var
|
|
1814
|
+
var addCouponToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addCouponToCurrentCart3);
|
|
1815
|
+
var removeCouponFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeCouponFromCurrentCart3);
|
|
1827
1816
|
var addGiftCardToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addGiftCardToCurrentCart3);
|
|
1828
1817
|
var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeGiftCardFromCurrentCart3);
|
|
1829
1818
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1833,7 +1822,6 @@ var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
1833
1822
|
DescriptionLineType,
|
|
1834
1823
|
DiscountScope,
|
|
1835
1824
|
DiscountSourceType,
|
|
1836
|
-
DiscountStatus,
|
|
1837
1825
|
ErrorCode,
|
|
1838
1826
|
FileType,
|
|
1839
1827
|
ItemStatus,
|
|
@@ -1850,7 +1838,7 @@ var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
1850
1838
|
VatType,
|
|
1851
1839
|
WebhookIdentityType,
|
|
1852
1840
|
WeightUnit,
|
|
1853
|
-
|
|
1841
|
+
addCouponToCurrentCart,
|
|
1854
1842
|
addGiftCardToCurrentCart,
|
|
1855
1843
|
addLineItemsToCurrentCart,
|
|
1856
1844
|
calculateCurrentCart,
|
|
@@ -1858,7 +1846,7 @@ var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
1858
1846
|
deleteCurrentCart,
|
|
1859
1847
|
getCurrentCart,
|
|
1860
1848
|
refreshCurrentCart,
|
|
1861
|
-
|
|
1849
|
+
removeCouponFromCurrentCart,
|
|
1862
1850
|
removeGiftCardFromCurrentCart,
|
|
1863
1851
|
removeLineItemsFromCurrentCart,
|
|
1864
1852
|
updateCurrentCart,
|