@wix/auto_sdk_ecom_cart-v-2 1.0.7 → 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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +120 -105
  2. package/build/cjs/index.js +41 -51
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -1
  5. package/build/cjs/index.typings.js +34 -44
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +103 -98
  8. package/build/cjs/meta.js +20 -20
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +120 -105
  11. package/build/es/index.mjs +39 -48
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +1 -1
  14. package/build/es/index.typings.mjs +32 -41
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +103 -98
  17. package/build/es/meta.mjs +18 -18
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +24 -28
  20. package/build/internal/cjs/index.js +41 -51
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +139 -128
  23. package/build/internal/cjs/index.typings.js +34 -44
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +103 -98
  26. package/build/internal/cjs/meta.js +20 -20
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +24 -28
  29. package/build/internal/es/index.mjs +39 -48
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +139 -128
  32. package/build/internal/es/index.typings.mjs +32 -41
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +103 -98
  35. package/build/internal/es/meta.mjs +18 -18
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1 +1 @@
1
- export { ActionEvent, AddDiscountRequest, AddDiscountResponse, AddDiscountToCurrentCartRequest, AddDiscountToCurrentCartResponse, AddGiftCardRequest, AddGiftCardResponse, AddGiftCardToCurrentCartRequest, AddGiftCardToCurrentCartResponse, AddLineItemsOptions, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartOptions, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationComponent, CalculationComponentWithLiterals, CalculationConfig, CalculationError, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, CreateCartOptions, CreateCartRequest, CreateCartResponse, CreateCurrentCartRequest, CreateCurrentCartResponse, CreatedBy, CreatedByIdOneOf, CustomContentReference, CustomField, CustomItemAttributes, CustomItemDeliveryConfig, CustomItemInput, CustomItemPaymentConfig, CustomItemPricingInfo, CustomItemQuantityInfo, CustomItemSource, CustomItemTaxConfig, CustomerInfo, CustomerInfoIdOneOf, DeleteCartRequest, DeleteCartResponse, DeleteCurrentCartRequest, DeleteCurrentCartResponse, DeliveryInfo, DeliveryMethod, DeliverySummary, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Discount, DiscountBenefit, DiscountBenefitValueOneOf, DiscountScope, DiscountScopeWithLiterals, DiscountSource, DiscountSourceType, DiscountSourceTypeWithLiterals, DiscountStatus, DiscountStatusWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ErrorCode, ErrorCodeWithLiterals, ExtendedFields, ExternalReference, FieldViolation, FileType, FileTypeWithLiterals, FreeTrialPeriod, FullAddressContactDetails, GetCartRequest, GetCartResponse, GetCheckoutURLRequest, GetCheckoutURLResponse, GetCheckoutUrlOptions, GetCurrentCartRequest, GetCurrentCartResponse, GiftCard, GiftCardSummary, Group, HandleAsyncCheckoutCompletionRequest, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, ItemAttributes, ItemDeliveryConfig, ItemModifier, ItemPaymentConfig, ItemPriceBreakdown, ItemPricingInfo, ItemQuantityInfo, ItemSource, ItemStatus, ItemStatusWithLiterals, ItemTaxConfig, ItemType, ItemTypeItemType, ItemTypeItemTypeDataOneOf, ItemTypeItemTypeWithLiterals, LineItem, LineItemSummary, LineItemTax, LineItemUpdate, MarkCartAsCompletedOptions, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, PlaceOrderOptions, PlaceOrderRequest, PlaceOrderResponse, PlainTextValue, Policy, PriceDescription, PriceSummary, QuantityUpdate, RawHttpResponse, RedirectUrls, RefreshCartRequest, RefreshCartResponse, RefreshCurrentCartRequest, RefreshCurrentCartResponse, RemoveDiscountFromCurrentCartRequest, RemoveDiscountFromCurrentCartResponse, RemoveDiscountRequest, RemoveDiscountResponse, RemoveGiftCardFromCurrentCartRequest, RemoveGiftCardFromCurrentCartResponse, RemoveGiftCardRequest, RemoveGiftCardResponse, RemoveLineItemsFromCurrentCartRequest, RemoveLineItemsFromCurrentCartResponse, RemoveLineItemsRequest, RemoveLineItemsResponse, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedMembership, SelectedMembershipUpdate, ServiceProperties, Severity, SeverityWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetTargetTypeOneOf, Tax, TaxDetails, TaxInfo, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UpdateCart, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsOptions, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
1
+ export { ActionEvent, AddCouponRequest, AddCouponResponse, AddCouponToCurrentCartRequest, AddCouponToCurrentCartResponse, AddGiftCardRequest, AddGiftCardResponse, AddGiftCardToCurrentCartRequest, AddGiftCardToCurrentCartResponse, AddLineItemsOptions, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartOptions, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationComponent, CalculationComponentWithLiterals, CalculationConfig, CalculationError, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, Coupon, CreateCartOptions, CreateCartRequest, CreateCartResponse, CreateCurrentCartRequest, CreateCurrentCartResponse, CreatedBy, CreatedByIdOneOf, CustomContentReference, CustomField, CustomItemAttributes, CustomItemDeliveryConfig, CustomItemInput, CustomItemPaymentConfig, CustomItemPricingInfo, CustomItemQuantityInfo, CustomItemSource, CustomItemTaxConfig, CustomerInfo, CustomerInfoIdOneOf, DeleteCartRequest, DeleteCartResponse, DeleteCurrentCartRequest, DeleteCurrentCartResponse, DeliveryInfo, DeliveryMethod, DeliverySummary, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Discount, DiscountBenefit, DiscountBenefitValueOneOf, DiscountScope, DiscountScopeWithLiterals, DiscountSource, DiscountSourceType, DiscountSourceTypeWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ErrorCode, ErrorCodeWithLiterals, ExtendedFields, ExternalReference, FieldViolation, FileType, FileTypeWithLiterals, FreeTrialPeriod, FullAddressContactDetails, GetCartRequest, GetCartResponse, GetCheckoutURLRequest, GetCheckoutURLResponse, GetCheckoutUrlOptions, GetCurrentCartRequest, GetCurrentCartResponse, GiftCard, GiftCardSummary, Group, HandleAsyncCheckoutCompletionRequest, HeadersEntry, IdentificationData, IdentificationDataIdOneOf, ItemAttributes, ItemDeliveryConfig, ItemDiscount, ItemModifier, ItemPaymentConfig, ItemPriceBreakdown, ItemPricingInfo, ItemQuantityInfo, ItemSource, ItemStatus, ItemStatusWithLiterals, ItemTaxConfig, ItemType, ItemTypeItemType, ItemTypeItemTypeDataOneOf, ItemTypeItemTypeWithLiterals, LegacyFields, LineItem, LineItemSummary, LineItemTax, LineItemUpdate, MarkCartAsCompletedOptions, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, PlaceOrderOptions, PlaceOrderRequest, PlaceOrderResponse, PlainTextValue, Policy, PriceDescription, PriceSummary, QuantityUpdate, RawHttpResponse, RedirectUrls, RefreshCartRequest, RefreshCartResponse, RefreshCurrentCartRequest, RefreshCurrentCartResponse, RemoveCouponFromCurrentCartRequest, RemoveCouponFromCurrentCartResponse, RemoveCouponRequest, RemoveCouponResponse, RemoveGiftCardFromCurrentCartRequest, RemoveGiftCardFromCurrentCartResponse, RemoveGiftCardRequest, RemoveGiftCardResponse, RemoveLineItemsFromCurrentCartRequest, RemoveLineItemsFromCurrentCartResponse, RemoveLineItemsRequest, RemoveLineItemsResponse, RestoreInfo, RuleType, RuleTypeWithLiterals, Scope, SecuredMedia, SelectedMembership, SelectedMembershipUpdate, ServiceProperties, Severity, SeverityWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetTargetTypeOneOf, Tax, TaxDetails, TaxInfo, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UpdateCart, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsOptions, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
@@ -662,15 +662,15 @@ function updateLineItems(payload) {
662
662
  }
663
663
  return __updateLineItems;
664
664
  }
665
- function addDiscount(payload) {
666
- function __addDiscount({ host }) {
665
+ function addCoupon(payload) {
666
+ function __addCoupon({ host }) {
667
667
  const metadata = {
668
668
  entityFqdn: "wix.ecom.v2.cart",
669
669
  method: "POST",
670
- methodFqn: "wix.ecom.cart.v2.CartService.AddDiscount",
670
+ methodFqn: "wix.ecom.cart.v2.CartService.AddCoupon",
671
671
  packageName: PACKAGE_NAME,
672
672
  url: resolveWixEcomCartV2CartServiceUrl({
673
- protoPath: "/v2/carts/{cartId}/add-discount",
673
+ protoPath: "/v2/carts/{cartId}/add-coupon",
674
674
  data: payload,
675
675
  host
676
676
  }),
@@ -710,17 +710,17 @@ function addDiscount(payload) {
710
710
  };
711
711
  return metadata;
712
712
  }
713
- return __addDiscount;
713
+ return __addCoupon;
714
714
  }
715
- function removeDiscount(payload) {
716
- function __removeDiscount({ host }) {
715
+ function removeCoupon(payload) {
716
+ function __removeCoupon({ host }) {
717
717
  const metadata = {
718
718
  entityFqdn: "wix.ecom.v2.cart",
719
719
  method: "POST",
720
- methodFqn: "wix.ecom.cart.v2.CartService.RemoveDiscount",
720
+ methodFqn: "wix.ecom.cart.v2.CartService.RemoveCoupon",
721
721
  packageName: PACKAGE_NAME,
722
722
  url: resolveWixEcomCartV2CartServiceUrl({
723
- protoPath: "/v2/carts/{cartId}/remove-discount",
723
+ protoPath: "/v2/carts/{cartId}/remove-coupon",
724
724
  data: payload,
725
725
  host
726
726
  }),
@@ -760,7 +760,7 @@ function removeDiscount(payload) {
760
760
  };
761
761
  return metadata;
762
762
  }
763
- return __removeDiscount;
763
+ return __removeCoupon;
764
764
  }
765
765
  function addGiftCard(payload) {
766
766
  function __addGiftCard({ host }) {
@@ -1000,27 +1000,6 @@ var ItemStatus = /* @__PURE__ */ ((ItemStatus2) => {
1000
1000
  ItemStatus2["REMOVED_FROM_CATALOG"] = "REMOVED_FROM_CATALOG";
1001
1001
  return ItemStatus2;
1002
1002
  })(ItemStatus || {});
1003
- var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
1004
- DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
1005
- DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
1006
- DiscountSourceType2["COUPON"] = "COUPON";
1007
- return DiscountSourceType2;
1008
- })(DiscountSourceType || {});
1009
- var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
1010
- DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
1011
- DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
1012
- DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
1013
- DiscountScope2["DELIVERY"] = "DELIVERY";
1014
- return DiscountScope2;
1015
- })(DiscountScope || {});
1016
- var DiscountStatus = /* @__PURE__ */ ((DiscountStatus2) => {
1017
- DiscountStatus2["UNKNOWN_DISCOUNT_STATUS"] = "UNKNOWN_DISCOUNT_STATUS";
1018
- DiscountStatus2["ACTIVE"] = "ACTIVE";
1019
- DiscountStatus2["EXPIRED"] = "EXPIRED";
1020
- DiscountStatus2["DELETED"] = "DELETED";
1021
- DiscountStatus2["MAX_USAGE_REACHED"] = "MAX_USAGE_REACHED";
1022
- return DiscountStatus2;
1023
- })(DiscountStatus || {});
1024
1003
  var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
1025
1004
  ChannelType2["UNSPECIFIED"] = "UNSPECIFIED";
1026
1005
  ChannelType2["WEB"] = "WEB";
@@ -1053,6 +1032,19 @@ var WeightUnit = /* @__PURE__ */ ((WeightUnit2) => {
1053
1032
  WeightUnit2["LB"] = "LB";
1054
1033
  return WeightUnit2;
1055
1034
  })(WeightUnit || {});
1035
+ var DiscountSourceType = /* @__PURE__ */ ((DiscountSourceType2) => {
1036
+ DiscountSourceType2["UNKNOWN_DISCOUNT_SOURCE_TYPE"] = "UNKNOWN_DISCOUNT_SOURCE_TYPE";
1037
+ DiscountSourceType2["AUTOMATIC_RULE"] = "AUTOMATIC_RULE";
1038
+ DiscountSourceType2["COUPON"] = "COUPON";
1039
+ return DiscountSourceType2;
1040
+ })(DiscountSourceType || {});
1041
+ var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
1042
+ DiscountScope2["UNKNOWN_DISCOUNT_SCOPE"] = "UNKNOWN_DISCOUNT_SCOPE";
1043
+ DiscountScope2["CART_SUBTOTAL"] = "CART_SUBTOTAL";
1044
+ DiscountScope2["LINE_ITEM"] = "LINE_ITEM";
1045
+ DiscountScope2["DELIVERY"] = "DELIVERY";
1046
+ return DiscountScope2;
1047
+ })(DiscountScope || {});
1056
1048
  var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
1057
1049
  CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
1058
1050
  CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
@@ -1662,13 +1654,13 @@ async function updateLineItems2(cartId, options) {
1662
1654
  throw transformedError;
1663
1655
  }
1664
1656
  }
1665
- async function addDiscount2(cartId, couponCode) {
1657
+ async function addCoupon2(cartId, couponCode) {
1666
1658
  const { httpClient, sideEffects } = arguments[2];
1667
1659
  const payload = renameKeysFromSDKRequestToRESTRequest({
1668
1660
  cartId,
1669
1661
  couponCode
1670
1662
  });
1671
- const reqOpts = addDiscount(payload);
1663
+ const reqOpts = addCoupon(payload);
1672
1664
  sideEffects?.onSiteCall?.();
1673
1665
  try {
1674
1666
  const result = await httpClient.request(reqOpts);
@@ -1709,13 +1701,13 @@ async function addDiscount2(cartId, couponCode) {
1709
1701
  throw transformedError;
1710
1702
  }
1711
1703
  }
1712
- async function removeDiscount2(cartId, discountId) {
1704
+ async function removeCoupon2(cartId, couponId) {
1713
1705
  const { httpClient, sideEffects } = arguments[2];
1714
1706
  const payload = renameKeysFromSDKRequestToRESTRequest({
1715
1707
  cartId,
1716
- discountId
1708
+ couponId
1717
1709
  });
1718
- const reqOpts = removeDiscount(payload);
1710
+ const reqOpts = removeCoupon(payload);
1719
1711
  sideEffects?.onSiteCall?.();
1720
1712
  try {
1721
1713
  const result = await httpClient.request(reqOpts);
@@ -1747,10 +1739,10 @@ async function removeDiscount2(cartId, discountId) {
1747
1739
  err,
1748
1740
  {
1749
1741
  spreadPathsToArguments: {},
1750
- explicitPathsToArguments: { cartId: "$[0]", discountId: "$[1]" },
1742
+ explicitPathsToArguments: { cartId: "$[0]", couponId: "$[1]" },
1751
1743
  singleArgumentUnchanged: false
1752
1744
  },
1753
- ["cartId", "discountId"]
1745
+ ["cartId", "couponId"]
1754
1746
  );
1755
1747
  sideEffects?.onError?.(err);
1756
1748
  throw transformedError;
@@ -1926,7 +1918,6 @@ export {
1926
1918
  DescriptionLineType,
1927
1919
  DiscountScope,
1928
1920
  DiscountSourceType,
1929
- DiscountStatus,
1930
1921
  ErrorCode,
1931
1922
  FileType,
1932
1923
  ItemStatus,
@@ -1943,7 +1934,7 @@ export {
1943
1934
  VatType,
1944
1935
  WebhookIdentityType,
1945
1936
  WeightUnit,
1946
- addDiscount2 as addDiscount,
1937
+ addCoupon2 as addCoupon,
1947
1938
  addGiftCard2 as addGiftCard,
1948
1939
  addLineItems2 as addLineItems,
1949
1940
  calculateCart2 as calculateCart,
@@ -1955,7 +1946,7 @@ export {
1955
1946
  markCartAsCompleted2 as markCartAsCompleted,
1956
1947
  placeOrder2 as placeOrder,
1957
1948
  refreshCart2 as refreshCart,
1958
- removeDiscount2 as removeDiscount,
1949
+ removeCoupon2 as removeCoupon,
1959
1950
  removeGiftCard2 as removeGiftCard,
1960
1951
  removeLineItems2 as removeLineItems,
1961
1952
  updateCart2 as updateCart,