@wix/auto_sdk_ecom_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 +123 -107
- package/build/cjs/index.js +41 -51
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +34 -44
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +106 -100
- package/build/cjs/meta.js +20 -20
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +123 -107
- package/build/es/index.mjs +39 -48
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +32 -41
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +106 -100
- 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 -51
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +142 -130
- package/build/internal/cjs/index.typings.js +34 -44
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +106 -100
- 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 -48
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +142 -130
- package/build/internal/es/index.typings.mjs +32 -41
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +106 -100
- 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
|
-
/**
|
|
876
|
-
* The current status of the discount.
|
|
877
|
-
* TODO: remodel.
|
|
878
|
-
*/
|
|
879
|
-
status?: DiscountStatusWithLiterals;
|
|
880
881
|
/**
|
|
881
|
-
*
|
|
882
|
-
*
|
|
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
|
}
|
|
@@ -2889,13 +2907,11 @@ interface UpdateCart {
|
|
|
2889
2907
|
*/
|
|
2890
2908
|
note?: string | null;
|
|
2891
2909
|
/**
|
|
2892
|
-
*
|
|
2893
|
-
*
|
|
2894
|
-
*
|
|
2895
|
-
* @maxSize 100
|
|
2896
|
-
* @readonly
|
|
2910
|
+
* List of coupons added to the Cart.
|
|
2911
|
+
* Currently, only one coupon code is supported.
|
|
2912
|
+
* @maxSize 1
|
|
2897
2913
|
*/
|
|
2898
|
-
|
|
2914
|
+
coupons?: Coupon[];
|
|
2899
2915
|
/** Information about the source of the Cart, detailing the origin or context in which the Cart was created. */
|
|
2900
2916
|
source?: CartSource;
|
|
2901
2917
|
/** Information about the site from which the Cart's line items were added. */
|
|
@@ -3012,4 +3028,4 @@ interface MarkCartAsCompletedOptions {
|
|
|
3012
3028
|
orderId?: string | null;
|
|
3013
3029
|
}
|
|
3014
3030
|
|
|
3015
|
-
export { type ActionEvent, type
|
|
3031
|
+
export { type ActionEvent, type AddCouponRequest, type AddCouponResponse, type AddCouponToCurrentCartRequest, type AddCouponToCurrentCartResponse, type AddGiftCardRequest, type AddGiftCardResponse, type AddGiftCardToCurrentCartRequest, type AddGiftCardToCurrentCartResponse, type AddLineItemsOptions, type AddLineItemsRequest, type AddLineItemsResponse, type AddLineItemsToCurrentCartRequest, type AddLineItemsToCurrentCartResponse, type AdditionalFee, type AdditionalFeeTax, type Address, type AddressLocation, type ApplicationError, type BusinessInfo, type CalculateCartOptions, type CalculateCartRequest, type CalculateCartResponse, 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 CreateCartOptions, type CreateCartRequest, type CreateCartResponse, 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 GetCheckoutUrlOptions, 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 MarkCartAsCompletedOptions, 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 PlaceOrderOptions, 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 UpdateCart, type UpdateCartRequest, type UpdateCartResponse, type UpdateCurrentCartRequest, type UpdateCurrentCartResponse, type UpdateLineItemsInCurrentCartRequest, type UpdateLineItemsInCurrentCartResponse, type UpdateLineItemsOptions, 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
|
+
addCoupon: () => addCoupon4,
|
|
46
45
|
addGiftCard: () => addGiftCard4,
|
|
47
46
|
addLineItems: () => addLineItems4,
|
|
48
47
|
calculateCart: () => calculateCart4,
|
|
@@ -54,7 +53,7 @@ __export(index_exports, {
|
|
|
54
53
|
markCartAsCompleted: () => markCartAsCompleted4,
|
|
55
54
|
placeOrder: () => placeOrder4,
|
|
56
55
|
refreshCart: () => refreshCart4,
|
|
57
|
-
|
|
56
|
+
removeCoupon: () => removeCoupon4,
|
|
58
57
|
removeGiftCard: () => removeGiftCard4,
|
|
59
58
|
removeLineItems: () => removeLineItems4,
|
|
60
59
|
updateCart: () => updateCart4,
|
|
@@ -723,15 +722,15 @@ function updateLineItems(payload) {
|
|
|
723
722
|
}
|
|
724
723
|
return __updateLineItems;
|
|
725
724
|
}
|
|
726
|
-
function
|
|
727
|
-
function
|
|
725
|
+
function addCoupon(payload) {
|
|
726
|
+
function __addCoupon({ host }) {
|
|
728
727
|
const metadata = {
|
|
729
728
|
entityFqdn: "wix.ecom.v2.cart",
|
|
730
729
|
method: "POST",
|
|
731
|
-
methodFqn: "wix.ecom.cart.v2.CartService.
|
|
730
|
+
methodFqn: "wix.ecom.cart.v2.CartService.AddCoupon",
|
|
732
731
|
packageName: PACKAGE_NAME,
|
|
733
732
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
734
|
-
protoPath: "/v2/carts/{cartId}/add-
|
|
733
|
+
protoPath: "/v2/carts/{cartId}/add-coupon",
|
|
735
734
|
data: payload,
|
|
736
735
|
host
|
|
737
736
|
}),
|
|
@@ -771,17 +770,17 @@ function addDiscount(payload) {
|
|
|
771
770
|
};
|
|
772
771
|
return metadata;
|
|
773
772
|
}
|
|
774
|
-
return
|
|
773
|
+
return __addCoupon;
|
|
775
774
|
}
|
|
776
|
-
function
|
|
777
|
-
function
|
|
775
|
+
function removeCoupon(payload) {
|
|
776
|
+
function __removeCoupon({ host }) {
|
|
778
777
|
const metadata = {
|
|
779
778
|
entityFqdn: "wix.ecom.v2.cart",
|
|
780
779
|
method: "POST",
|
|
781
|
-
methodFqn: "wix.ecom.cart.v2.CartService.
|
|
780
|
+
methodFqn: "wix.ecom.cart.v2.CartService.RemoveCoupon",
|
|
782
781
|
packageName: PACKAGE_NAME,
|
|
783
782
|
url: resolveWixEcomCartV2CartServiceUrl({
|
|
784
|
-
protoPath: "/v2/carts/{cartId}/remove-
|
|
783
|
+
protoPath: "/v2/carts/{cartId}/remove-coupon",
|
|
785
784
|
data: payload,
|
|
786
785
|
host
|
|
787
786
|
}),
|
|
@@ -821,7 +820,7 @@ function removeDiscount(payload) {
|
|
|
821
820
|
};
|
|
822
821
|
return metadata;
|
|
823
822
|
}
|
|
824
|
-
return
|
|
823
|
+
return __removeCoupon;
|
|
825
824
|
}
|
|
826
825
|
function addGiftCard(payload) {
|
|
827
826
|
function __addGiftCard({ host }) {
|
|
@@ -1061,27 +1060,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
|
|
|
1061
1060
|
ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
|
|
1062
1061
|
return ItemStatus2;
|
|
1063
1062
|
})(ItemStatus || {});
|
|
1064
|
-
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
1065
|
-
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
1066
|
-
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
1067
|
-
DiscountSourceType2["COUPON"] = "COUPON";
|
|
1068
|
-
return DiscountSourceType2;
|
|
1069
|
-
})(DiscountSourceType || {});
|
|
1070
|
-
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
1071
|
-
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
1072
|
-
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
1073
|
-
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
1074
|
-
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
1075
|
-
return DiscountScope2;
|
|
1076
|
-
})(DiscountScope || {});
|
|
1077
|
-
var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
|
|
1078
|
-
DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
|
|
1079
|
-
DiscountStatus2["ACTIVE"] = "ACTIVE";
|
|
1080
|
-
DiscountStatus2["EXPIRED"] = "EXPIRED";
|
|
1081
|
-
DiscountStatus2["DELETED"] = "DELETED";
|
|
1082
|
-
DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
|
|
1083
|
-
return DiscountStatus2;
|
|
1084
|
-
})(DiscountStatus || {});
|
|
1085
1063
|
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
1086
1064
|
ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
|
|
1087
1065
|
ChannelType2["WEB"] = "WEB";
|
|
@@ -1114,6 +1092,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
|
|
|
1114
1092
|
WeightUnit2["LB"] = "LB";
|
|
1115
1093
|
return WeightUnit2;
|
|
1116
1094
|
})(WeightUnit || {});
|
|
1095
|
+
var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
|
|
1096
|
+
DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
|
|
1097
|
+
DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
|
|
1098
|
+
DiscountSourceType2["COUPON"] = "COUPON";
|
|
1099
|
+
return DiscountSourceType2;
|
|
1100
|
+
})(DiscountSourceType || {});
|
|
1101
|
+
var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
1102
|
+
DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
|
|
1103
|
+
DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
|
|
1104
|
+
DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
|
|
1105
|
+
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
1106
|
+
return DiscountScope2;
|
|
1107
|
+
})(DiscountScope || {});
|
|
1117
1108
|
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
1118
1109
|
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
1119
1110
|
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
@@ -1723,13 +1714,13 @@ async function updateLineItems2(cartId, options) {
|
|
|
1723
1714
|
throw transformedError;
|
|
1724
1715
|
}
|
|
1725
1716
|
}
|
|
1726
|
-
async function
|
|
1717
|
+
async function addCoupon2(cartId, couponCode) {
|
|
1727
1718
|
const { httpClient, sideEffects } = arguments[2];
|
|
1728
1719
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1729
1720
|
cartId,
|
|
1730
1721
|
couponCode
|
|
1731
1722
|
});
|
|
1732
|
-
const reqOpts =
|
|
1723
|
+
const reqOpts = addCoupon(payload);
|
|
1733
1724
|
sideEffects?.onSiteCall?.();
|
|
1734
1725
|
try {
|
|
1735
1726
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1770,13 +1761,13 @@ async function addDiscount2(cartId, couponCode) {
|
|
|
1770
1761
|
throw transformedError;
|
|
1771
1762
|
}
|
|
1772
1763
|
}
|
|
1773
|
-
async function
|
|
1764
|
+
async function removeCoupon2(cartId, couponId) {
|
|
1774
1765
|
const { httpClient, sideEffects } = arguments[2];
|
|
1775
1766
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1776
1767
|
cartId,
|
|
1777
|
-
|
|
1768
|
+
couponId
|
|
1778
1769
|
});
|
|
1779
|
-
const reqOpts =
|
|
1770
|
+
const reqOpts = removeCoupon(payload);
|
|
1780
1771
|
sideEffects?.onSiteCall?.();
|
|
1781
1772
|
try {
|
|
1782
1773
|
const result = await httpClient.request(reqOpts);
|
|
@@ -1808,10 +1799,10 @@ async function removeDiscount2(cartId, discountId) {
|
|
|
1808
1799
|
err,
|
|
1809
1800
|
{
|
|
1810
1801
|
spreadPathsToArguments: {},
|
|
1811
|
-
explicitPathsToArguments: { cartId: "$[0]",
|
|
1802
|
+
explicitPathsToArguments: { cartId: "$[0]", couponId: "$[1]" },
|
|
1812
1803
|
singleArgumentUnchanged: false
|
|
1813
1804
|
},
|
|
1814
|
-
["cartId", "
|
|
1805
|
+
["cartId", "couponId"]
|
|
1815
1806
|
);
|
|
1816
1807
|
sideEffects?.onError?.(err);
|
|
1817
1808
|
throw transformedError;
|
|
@@ -2067,18 +2058,18 @@ function updateLineItems3(httpClient) {
|
|
|
2067
2058
|
{ httpClient }
|
|
2068
2059
|
);
|
|
2069
2060
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return (cartId, couponCode) =>
|
|
2061
|
+
function addCoupon3(httpClient) {
|
|
2062
|
+
return (cartId, couponCode) => addCoupon2(
|
|
2072
2063
|
cartId,
|
|
2073
2064
|
couponCode,
|
|
2074
2065
|
// @ts-ignore
|
|
2075
2066
|
{ httpClient }
|
|
2076
2067
|
);
|
|
2077
2068
|
}
|
|
2078
|
-
function
|
|
2079
|
-
return (cartId,
|
|
2069
|
+
function removeCoupon3(httpClient) {
|
|
2070
|
+
return (cartId, couponId) => removeCoupon2(
|
|
2080
2071
|
cartId,
|
|
2081
|
-
|
|
2072
|
+
couponId,
|
|
2082
2073
|
// @ts-ignore
|
|
2083
2074
|
{ httpClient }
|
|
2084
2075
|
);
|
|
@@ -2128,8 +2119,8 @@ var placeOrder4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(pla
|
|
|
2128
2119
|
var addLineItems4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addLineItems3);
|
|
2129
2120
|
var removeLineItems4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeLineItems3);
|
|
2130
2121
|
var updateLineItems4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateLineItems3);
|
|
2131
|
-
var
|
|
2132
|
-
var
|
|
2122
|
+
var addCoupon4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addCoupon3);
|
|
2123
|
+
var removeCoupon4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeCoupon3);
|
|
2133
2124
|
var addGiftCard4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(addGiftCard3);
|
|
2134
2125
|
var removeGiftCard4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeGiftCard3);
|
|
2135
2126
|
var markCartAsCompleted4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(markCartAsCompleted3);
|
|
@@ -2141,7 +2132,6 @@ var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
2141
2132
|
DescriptionLineType,
|
|
2142
2133
|
DiscountScope,
|
|
2143
2134
|
DiscountSourceType,
|
|
2144
|
-
DiscountStatus,
|
|
2145
2135
|
ErrorCode,
|
|
2146
2136
|
FileType,
|
|
2147
2137
|
ItemStatus,
|
|
@@ -2158,7 +2148,7 @@ var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
2158
2148
|
VatType,
|
|
2159
2149
|
WebhookIdentityType,
|
|
2160
2150
|
WeightUnit,
|
|
2161
|
-
|
|
2151
|
+
addCoupon,
|
|
2162
2152
|
addGiftCard,
|
|
2163
2153
|
addLineItems,
|
|
2164
2154
|
calculateCart,
|
|
@@ -2170,7 +2160,7 @@ var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ (0, import_rest_modules3.cr
|
|
|
2170
2160
|
markCartAsCompleted,
|
|
2171
2161
|
placeOrder,
|
|
2172
2162
|
refreshCart,
|
|
2173
|
-
|
|
2163
|
+
removeCoupon,
|
|
2174
2164
|
removeGiftCard,
|
|
2175
2165
|
removeLineItems,
|
|
2176
2166
|
updateCart,
|