@wix/auto_sdk_ecom_current-cart-v-2 1.0.8 → 1.0.9
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 +114 -99
- 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 +100 -97
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +114 -99
- 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 +100 -97
- 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 +132 -121
- 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 +100 -97
- 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 +132 -121
- 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 +100 -97
- package/build/internal/es/meta.mjs +18 -18
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/index.d.mts
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.
|
|
@@ -842,6 +845,16 @@ interface ItemModifier {
|
|
|
842
845
|
/** The price of the modifier. */
|
|
843
846
|
price?: MultiCurrencyPrice;
|
|
844
847
|
}
|
|
848
|
+
/**
|
|
849
|
+
* Currently, only automatic discounts are applied to line items.
|
|
850
|
+
* In the future, coupon discounts will be supported as well.
|
|
851
|
+
*/
|
|
852
|
+
interface ItemDiscount {
|
|
853
|
+
/** The display name of the discount. */
|
|
854
|
+
name?: TranslatableString;
|
|
855
|
+
/** The amount discounted from the item's sale price (per unit). */
|
|
856
|
+
amountOff?: MultiCurrencyPrice;
|
|
857
|
+
}
|
|
845
858
|
interface Scope {
|
|
846
859
|
/** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
|
|
847
860
|
namespace?: string;
|
|
@@ -854,95 +867,19 @@ interface Group {
|
|
|
854
867
|
/** Item ID (when the coupon scope is limited to just one item). */
|
|
855
868
|
entityId?: string | null;
|
|
856
869
|
}
|
|
857
|
-
interface
|
|
870
|
+
interface Coupon {
|
|
858
871
|
/**
|
|
859
|
-
*
|
|
872
|
+
* ID of the coupon in the Cart.
|
|
860
873
|
* @format GUID
|
|
861
874
|
*/
|
|
862
875
|
_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
|
-
/**
|
|
876
|
-
* The current status of the discount.
|
|
877
|
-
* TODO: remodel.
|
|
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
876
|
/**
|
|
892
|
-
* Coupon code
|
|
893
|
-
*
|
|
877
|
+
* Coupon code.
|
|
878
|
+
* @minLength 1
|
|
894
879
|
* @maxLength 50
|
|
895
880
|
*/
|
|
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"
|
|
881
|
+
code?: string;
|
|
943
882
|
}
|
|
944
|
-
/** @enumType */
|
|
945
|
-
type DiscountStatusWithLiterals = DiscountStatus | 'UNKNOWN_DISCOUNT_STATUS' | 'ACTIVE' | 'EXPIRED' | 'DELETED' | 'MAX_USAGE_REACHED';
|
|
946
883
|
interface CartSource {
|
|
947
884
|
/**
|
|
948
885
|
* Sales channel that created the Cart.
|
|
@@ -1443,6 +1380,84 @@ interface CustomField {
|
|
|
1443
1380
|
*/
|
|
1444
1381
|
translatedTitle?: string | null;
|
|
1445
1382
|
}
|
|
1383
|
+
interface LegacyFields {
|
|
1384
|
+
/**
|
|
1385
|
+
* The applied discounts of the Cart.
|
|
1386
|
+
* Discounts that are no longer applied are not included in this list.
|
|
1387
|
+
* @maxSize 100
|
|
1388
|
+
*/
|
|
1389
|
+
appliedDiscounts?: Discount[];
|
|
1390
|
+
/** The coupon discount amount. */
|
|
1391
|
+
couponDiscount?: MultiCurrencyPrice;
|
|
1392
|
+
/** The sum of all line items after applying all discounts. */
|
|
1393
|
+
subtotalAfterCouponDiscount?: MultiCurrencyPrice;
|
|
1394
|
+
}
|
|
1395
|
+
interface Discount {
|
|
1396
|
+
/** The display name of the discount. */
|
|
1397
|
+
name?: TranslatableString;
|
|
1398
|
+
/** The source of the discount, indicating how it was applied. */
|
|
1399
|
+
source?: DiscountSource;
|
|
1400
|
+
/** The component in the Cart that the discount applies to. */
|
|
1401
|
+
scope?: DiscountScopeWithLiterals;
|
|
1402
|
+
/**
|
|
1403
|
+
* List of benefits provided by the discount.
|
|
1404
|
+
* @minSize 1
|
|
1405
|
+
* @maxSize 100
|
|
1406
|
+
*/
|
|
1407
|
+
benefits?: DiscountBenefit[];
|
|
1408
|
+
/**
|
|
1409
|
+
* Number of subscription cycles this discount applies to.
|
|
1410
|
+
* If unset, the discount applies to all billing cycles.
|
|
1411
|
+
* @min 1
|
|
1412
|
+
* @max 1000
|
|
1413
|
+
*/
|
|
1414
|
+
subscriptionCycles?: number | null;
|
|
1415
|
+
}
|
|
1416
|
+
interface DiscountSource {
|
|
1417
|
+
/** The type of the discount source. */
|
|
1418
|
+
sourceType?: DiscountSourceTypeWithLiterals;
|
|
1419
|
+
/**
|
|
1420
|
+
* Coupon code that triggered the discount.
|
|
1421
|
+
* Relevant for coupon discounts only.
|
|
1422
|
+
* @maxLength 50
|
|
1423
|
+
*/
|
|
1424
|
+
couponCode?: string | null;
|
|
1425
|
+
}
|
|
1426
|
+
declare enum DiscountSourceType {
|
|
1427
|
+
UNKNOWN_DISCOUNT_SOURCE_TYPE = "UNKNOWN_DISCOUNT_SOURCE_TYPE",
|
|
1428
|
+
/** The discount was applied automatically by a rule. */
|
|
1429
|
+
AUTOMATIC_RULE = "AUTOMATIC_RULE",
|
|
1430
|
+
/** The discount was applied by a coupon code. */
|
|
1431
|
+
COUPON = "COUPON"
|
|
1432
|
+
}
|
|
1433
|
+
/** @enumType */
|
|
1434
|
+
type DiscountSourceTypeWithLiterals = DiscountSourceType | 'UNKNOWN_DISCOUNT_SOURCE_TYPE' | 'AUTOMATIC_RULE' | 'COUPON';
|
|
1435
|
+
declare enum DiscountScope {
|
|
1436
|
+
UNKNOWN_DISCOUNT_SCOPE = "UNKNOWN_DISCOUNT_SCOPE",
|
|
1437
|
+
/** The discount applies to the cart's subtotal. */
|
|
1438
|
+
CART_SUBTOTAL = "CART_SUBTOTAL",
|
|
1439
|
+
/** The discount applies to a specific line item. */
|
|
1440
|
+
LINE_ITEM = "LINE_ITEM",
|
|
1441
|
+
/** The discount applies to the delivery price. */
|
|
1442
|
+
DELIVERY = "DELIVERY"
|
|
1443
|
+
}
|
|
1444
|
+
/** @enumType */
|
|
1445
|
+
type DiscountScopeWithLiterals = DiscountScope | 'UNKNOWN_DISCOUNT_SCOPE' | 'CART_SUBTOTAL' | 'LINE_ITEM' | 'DELIVERY';
|
|
1446
|
+
interface DiscountBenefit extends DiscountBenefitValueOneOf {
|
|
1447
|
+
/** A specific monetary value deducted from the total cost. */
|
|
1448
|
+
amountOff?: MultiCurrencyPrice;
|
|
1449
|
+
/**
|
|
1450
|
+
* The ID of line item that the discount applies to.
|
|
1451
|
+
* Relevant for item-level discounts only.
|
|
1452
|
+
* @format GUID
|
|
1453
|
+
*/
|
|
1454
|
+
lineItemId?: string | null;
|
|
1455
|
+
}
|
|
1456
|
+
/** @oneof */
|
|
1457
|
+
interface DiscountBenefitValueOneOf {
|
|
1458
|
+
/** A specific monetary value deducted from the total cost. */
|
|
1459
|
+
amountOff?: MultiCurrencyPrice;
|
|
1460
|
+
}
|
|
1446
1461
|
interface CartSummary {
|
|
1447
1462
|
/**
|
|
1448
1463
|
* The Cart ID.
|
|
@@ -2286,7 +2301,7 @@ interface UpdateLineItemsInCurrentCartResponse {
|
|
|
2286
2301
|
/** Updated Cart. */
|
|
2287
2302
|
cart?: Cart;
|
|
2288
2303
|
}
|
|
2289
|
-
interface
|
|
2304
|
+
interface AddCouponToCurrentCartRequest {
|
|
2290
2305
|
/**
|
|
2291
2306
|
* Coupon to apply.
|
|
2292
2307
|
*
|
|
@@ -2296,18 +2311,18 @@ interface AddDiscountToCurrentCartRequest {
|
|
|
2296
2311
|
*/
|
|
2297
2312
|
couponCode: string;
|
|
2298
2313
|
}
|
|
2299
|
-
interface
|
|
2314
|
+
interface AddCouponToCurrentCartResponse {
|
|
2300
2315
|
/** Updated Cart. */
|
|
2301
2316
|
cart?: Cart;
|
|
2302
2317
|
}
|
|
2303
|
-
interface
|
|
2318
|
+
interface RemoveCouponFromCurrentCartRequest {
|
|
2304
2319
|
/**
|
|
2305
|
-
*
|
|
2320
|
+
* Coupon ID.
|
|
2306
2321
|
* @format GUID
|
|
2307
2322
|
*/
|
|
2308
|
-
|
|
2323
|
+
couponId: string;
|
|
2309
2324
|
}
|
|
2310
|
-
interface
|
|
2325
|
+
interface RemoveCouponFromCurrentCartResponse {
|
|
2311
2326
|
/** Updated Cart. */
|
|
2312
2327
|
cart?: Cart;
|
|
2313
2328
|
}
|
|
@@ -2711,7 +2726,7 @@ interface UpdateLineItemsResponse {
|
|
|
2711
2726
|
/** Updated Cart. */
|
|
2712
2727
|
cart?: Cart;
|
|
2713
2728
|
}
|
|
2714
|
-
interface
|
|
2729
|
+
interface AddCouponRequest {
|
|
2715
2730
|
/**
|
|
2716
2731
|
* Cart ID.
|
|
2717
2732
|
* @format GUID
|
|
@@ -2726,11 +2741,11 @@ interface AddDiscountRequest {
|
|
|
2726
2741
|
*/
|
|
2727
2742
|
couponCode?: string;
|
|
2728
2743
|
}
|
|
2729
|
-
interface
|
|
2744
|
+
interface AddCouponResponse {
|
|
2730
2745
|
/** Updated Cart. */
|
|
2731
2746
|
cart?: Cart;
|
|
2732
2747
|
}
|
|
2733
|
-
interface
|
|
2748
|
+
interface RemoveCouponRequest {
|
|
2734
2749
|
/**
|
|
2735
2750
|
* Cart ID.
|
|
2736
2751
|
* @format GUID
|
|
@@ -2740,9 +2755,9 @@ interface RemoveDiscountRequest {
|
|
|
2740
2755
|
* Discount ID.
|
|
2741
2756
|
* @format GUID
|
|
2742
2757
|
*/
|
|
2743
|
-
|
|
2758
|
+
couponId?: string;
|
|
2744
2759
|
}
|
|
2745
|
-
interface
|
|
2760
|
+
interface RemoveCouponResponse {
|
|
2746
2761
|
/** Updated Cart. */
|
|
2747
2762
|
cart?: Cart;
|
|
2748
2763
|
}
|
|
@@ -2881,4 +2896,4 @@ interface UpdateLineItemsInCurrentCartOptions {
|
|
|
2881
2896
|
lineItems?: LineItemUpdate[];
|
|
2882
2897
|
}
|
|
2883
2898
|
|
|
2884
|
-
export { type ActionEvent, type
|
|
2899
|
+
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/es/index.mjs
CHANGED
|
@@ -625,15 +625,15 @@ function updateLineItemsInCurrentCart(payload) {
|
|
|
625
625
|
}
|
|
626
626
|
return __updateLineItemsInCurrentCart;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
629
|
-
function
|
|
628
|
+
function addCouponToCurrentCart(payload) {
|
|
629
|
+
function __addCouponToCurrentCart({ host }) {
|
|
630
630
|
const metadata = {
|
|
631
631
|
entityFqdn: "wix.ecom.v2.cart",
|
|
632
632
|
method: "POST",
|
|
633
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
633
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.AddCouponToCurrentCart",
|
|
634
634
|
packageName: PACKAGE_NAME,
|
|
635
635
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
636
|
-
protoPath: "/v2/carts/current/add-
|
|
636
|
+
protoPath: "/v2/carts/current/add-coupon",
|
|
637
637
|
data: payload,
|
|
638
638
|
host
|
|
639
639
|
}),
|
|
@@ -673,17 +673,17 @@ function addDiscountToCurrentCart(payload) {
|
|
|
673
673
|
};
|
|
674
674
|
return metadata;
|
|
675
675
|
}
|
|
676
|
-
return
|
|
676
|
+
return __addCouponToCurrentCart;
|
|
677
677
|
}
|
|
678
|
-
function
|
|
679
|
-
function
|
|
678
|
+
function removeCouponFromCurrentCart(payload) {
|
|
679
|
+
function __removeCouponFromCurrentCart({ host }) {
|
|
680
680
|
const metadata = {
|
|
681
681
|
entityFqdn: "wix.ecom.v2.cart",
|
|
682
682
|
method: "POST",
|
|
683
|
-
methodFqn: "wix.ecom.cart.v2.CurrentCartService.
|
|
683
|
+
methodFqn: "wix.ecom.cart.v2.CurrentCartService.RemoveCouponFromCurrentCart",
|
|
684
684
|
packageName: PACKAGE_NAME,
|
|
685
685
|
url: resolveWixEcomCartV2CurrentCartServiceUrl({
|
|
686
|
-
protoPath: "/v2/carts/current/remove-
|
|
686
|
+
protoPath: "/v2/carts/current/remove-coupon",
|
|
687
687
|
data: payload,
|
|
688
688
|
host
|
|
689
689
|
}),
|
|
@@ -723,7 +723,7 @@ function removeDiscountFromCurrentCart(payload) {
|
|
|
723
723
|
};
|
|
724
724
|
return metadata;
|
|
725
725
|
}
|
|
726
|
-
return
|
|
726
|
+
return __removeCouponFromCurrentCart;
|
|
727
727
|
}
|
|
728
728
|
function addGiftCardToCurrentCart(payload) {
|
|
729
729
|
function __addGiftCardToCurrentCart({ host }) {
|
|
@@ -889,27 +889,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
|
889
889
|
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
890
890
|
return ItemStatus2;
|
|
891
891
|
})(ItemStatus || {});
|
|
892
|
-
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
893
|
-
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
894
|
-
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
895
|
-
DiscountSourceType2["COUPON"] = "COUPON";
|
|
896
|
-
return DiscountSourceType2;
|
|
897
|
-
})(DiscountSourceType || {});
|
|
898
|
-
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
899
|
-
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
900
|
-
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
901
|
-
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
902
|
-
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
903
|
-
return DiscountScope2;
|
|
904
|
-
})(DiscountScope || {});
|
|
905
|
-
var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
|
|
906
|
-
DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
|
|
907
|
-
DiscountStatus2["ACTIVE"] = "ACTIVE";
|
|
908
|
-
DiscountStatus2["EXPIRED"] = "EXPIRED";
|
|
909
|
-
DiscountStatus2["DELETED"] = "DELETED";
|
|
910
|
-
DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
|
|
911
|
-
return DiscountStatus2;
|
|
912
|
-
})(DiscountStatus || {});
|
|
913
892
|
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
914
893
|
ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
915
894
|
ChannelType2["WEB"] = "WEB";
|
|
@@ -942,6 +921,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
942
921
|
WeightUnit2["LB"] = "LB";
|
|
943
922
|
return WeightUnit2;
|
|
944
923
|
})(WeightUnit || {});
|
|
924
|
+
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
925
|
+
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
926
|
+
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
927
|
+
DiscountSourceType2["COUPON"] = "COUPON";
|
|
928
|
+
return DiscountSourceType2;
|
|
929
|
+
})(DiscountSourceType || {});
|
|
930
|
+
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
931
|
+
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
932
|
+
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
933
|
+
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
934
|
+
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
935
|
+
return DiscountScope2;
|
|
936
|
+
})(DiscountScope || {});
|
|
945
937
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
946
938
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
947
939
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1478,12 +1470,12 @@ async function updateLineItemsInCurrentCart2(options) {
|
|
|
1478
1470
|
throw transformedError;
|
|
1479
1471
|
}
|
|
1480
1472
|
}
|
|
1481
|
-
async function
|
|
1473
|
+
async function addCouponToCurrentCart2(couponCode) {
|
|
1482
1474
|
const { httpClient, sideEffects } = arguments[1];
|
|
1483
1475
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1484
1476
|
couponCode
|
|
1485
1477
|
});
|
|
1486
|
-
const reqOpts =
|
|
1478
|
+
const reqOpts = addCouponToCurrentCart(payload);
|
|
1487
1479
|
sideEffects?.onSiteCall?.();
|
|
1488
1480
|
try {
|
|
1489
1481
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1524,12 +1516,10 @@ async function addDiscountToCurrentCart2(couponCode) {
|
|
|
1524
1516
|
throw transformedError;
|
|
1525
1517
|
}
|
|
1526
1518
|
}
|
|
1527
|
-
async function
|
|
1519
|
+
async function removeCouponFromCurrentCart2(couponId) {
|
|
1528
1520
|
const { httpClient, sideEffects } = arguments[1];
|
|
1529
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
1530
|
-
|
|
1531
|
-
});
|
|
1532
|
-
const reqOpts = removeDiscountFromCurrentCart(payload);
|
|
1521
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ couponId });
|
|
1522
|
+
const reqOpts = removeCouponFromCurrentCart(payload);
|
|
1533
1523
|
sideEffects?.onSiteCall?.();
|
|
1534
1524
|
try {
|
|
1535
1525
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1561,10 +1551,10 @@ async function removeDiscountFromCurrentCart2(discountId) {
|
|
|
1561
1551
|
err,
|
|
1562
1552
|
{
|
|
1563
1553
|
spreadPathsToArguments: {},
|
|
1564
|
-
explicitPathsToArguments: {
|
|
1554
|
+
explicitPathsToArguments: { couponId: "$[0]" },
|
|
1565
1555
|
singleArgumentUnchanged: false
|
|
1566
1556
|
},
|
|
1567
|
-
["
|
|
1557
|
+
["couponId"]
|
|
1568
1558
|
);
|
|
1569
1559
|
sideEffects?.onError?.(err);
|
|
1570
1560
|
throw transformedError;
|
|
@@ -1725,16 +1715,16 @@ function updateLineItemsInCurrentCart3(httpClient) {
|
|
|
1725
1715
|
{ httpClient }
|
|
1726
1716
|
);
|
|
1727
1717
|
}
|
|
1728
|
-
function
|
|
1729
|
-
return (couponCode) =>
|
|
1718
|
+
function addCouponToCurrentCart3(httpClient) {
|
|
1719
|
+
return (couponCode) => addCouponToCurrentCart2(
|
|
1730
1720
|
couponCode,
|
|
1731
1721
|
// @ts-ignore
|
|
1732
1722
|
{ httpClient }
|
|
1733
1723
|
);
|
|
1734
1724
|
}
|
|
1735
|
-
function
|
|
1736
|
-
return (
|
|
1737
|
-
|
|
1725
|
+
function removeCouponFromCurrentCart3(httpClient) {
|
|
1726
|
+
return (couponId) => removeCouponFromCurrentCart2(
|
|
1727
|
+
couponId,
|
|
1738
1728
|
// @ts-ignore
|
|
1739
1729
|
{ httpClient }
|
|
1740
1730
|
);
|
|
@@ -1765,8 +1755,8 @@ var calculateCurrentCart4 = /* @__PURE__ */ createRESTModule(calculateCurrentCar
|
|
|
1765
1755
|
var addLineItemsToCurrentCart4 = /* @__PURE__ */ createRESTModule(addLineItemsToCurrentCart3);
|
|
1766
1756
|
var removeLineItemsFromCurrentCart4 = /* @__PURE__ */ createRESTModule(removeLineItemsFromCurrentCart3);
|
|
1767
1757
|
var updateLineItemsInCurrentCart4 = /* @__PURE__ */ createRESTModule(updateLineItemsInCurrentCart3);
|
|
1768
|
-
var
|
|
1769
|
-
var
|
|
1758
|
+
var addCouponToCurrentCart4 = /* @__PURE__ */ createRESTModule(addCouponToCurrentCart3);
|
|
1759
|
+
var removeCouponFromCurrentCart4 = /* @__PURE__ */ createRESTModule(removeCouponFromCurrentCart3);
|
|
1770
1760
|
var addGiftCardToCurrentCart4 = /* @__PURE__ */ createRESTModule(addGiftCardToCurrentCart3);
|
|
1771
1761
|
var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ createRESTModule(removeGiftCardFromCurrentCart3);
|
|
1772
1762
|
export {
|
|
@@ -1775,7 +1765,6 @@ export {
|
|
|
1775
1765
|
DescriptionLineType,
|
|
1776
1766
|
DiscountScope,
|
|
1777
1767
|
DiscountSourceType,
|
|
1778
|
-
DiscountStatus,
|
|
1779
1768
|
ErrorCode,
|
|
1780
1769
|
FileType,
|
|
1781
1770
|
ItemStatus,
|
|
@@ -1792,7 +1781,7 @@ export {
|
|
|
1792
1781
|
VatType,
|
|
1793
1782
|
WebhookIdentityType,
|
|
1794
1783
|
WeightUnit,
|
|
1795
|
-
|
|
1784
|
+
addCouponToCurrentCart4 as addCouponToCurrentCart,
|
|
1796
1785
|
addGiftCardToCurrentCart4 as addGiftCardToCurrentCart,
|
|
1797
1786
|
addLineItemsToCurrentCart4 as addLineItemsToCurrentCart,
|
|
1798
1787
|
calculateCurrentCart4 as calculateCurrentCart,
|
|
@@ -1800,7 +1789,7 @@ export {
|
|
|
1800
1789
|
deleteCurrentCart4 as deleteCurrentCart,
|
|
1801
1790
|
getCurrentCart4 as getCurrentCart,
|
|
1802
1791
|
refreshCurrentCart4 as refreshCurrentCart,
|
|
1803
|
-
|
|
1792
|
+
removeCouponFromCurrentCart4 as removeCouponFromCurrentCart,
|
|
1804
1793
|
removeGiftCardFromCurrentCart4 as removeGiftCardFromCurrentCart,
|
|
1805
1794
|
removeLineItemsFromCurrentCart4 as removeLineItemsFromCurrentCart,
|
|
1806
1795
|
updateCurrentCart4 as updateCurrentCart,
|