@wix/auto_sdk_ecom_current-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 +116 -99
  2. package/build/cjs/index.js +41 -53
  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 -46
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +102 -97
  8. package/build/cjs/meta.js +20 -20
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +116 -99
  11. package/build/es/index.mjs +39 -50
  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 -43
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +102 -97
  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 -53
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +134 -121
  23. package/build/internal/cjs/index.typings.js +34 -46
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +102 -97
  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 -50
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +134 -121
  32. package/build/internal/es/index.typings.mjs +32 -43
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +102 -97
  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, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartOptions, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartOptions, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationComponent, CalculationComponentWithLiterals, CalculationConfig, CalculationError, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, CreateCartRequest, CreateCartResponse, CreateCurrentCartOptions, 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, 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, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, 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, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartOptions, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, 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, AddLineItemsRequest, AddLineItemsResponse, AddLineItemsToCurrentCartOptions, AddLineItemsToCurrentCartRequest, AddLineItemsToCurrentCartResponse, AdditionalFee, AdditionalFeeTax, Address, AddressLocation, ApplicationError, BusinessInfo, CalculateCartRequest, CalculateCartResponse, CalculateCurrentCartOptions, CalculateCurrentCartRequest, CalculateCurrentCartResponse, CalculationComponent, CalculationComponentWithLiterals, CalculationConfig, CalculationError, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, Coupon, CreateCartRequest, CreateCartResponse, CreateCurrentCartOptions, 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, 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, MarkCartAsCompletedRequest, MarkCartAsCompletedResponse, Membership, MessageEnvelope, ModifierGroup, MultiCurrencyPrice, NameInLineItem, NameInLineItemWithLiterals, NameInOther, NameInOtherWithLiterals, Other, PaymentInfo, PaymentOption, PaymentOptionType, PaymentOptionTypeWithLiterals, PaymentSummary, PhysicalProperties, 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, UpdateCartRequest, UpdateCartResponse, UpdateCurrentCartRequest, UpdateCurrentCartResponse, UpdateLineItemsInCurrentCartOptions, UpdateLineItemsInCurrentCartRequest, UpdateLineItemsInCurrentCartResponse, UpdateLineItemsRequest, UpdateLineItemsResponse, V2AdditionalFee, V2LineItem, ValidationError, ValidationsConfig, ValidationsConfigWithLiterals, VatId, VatType, VatTypeWithLiterals, Violation, WebhookIdentityType, WebhookIdentityTypeWithLiterals, WeightUnit, WeightUnitWithLiterals } from './index.mjs';
@@ -625,15 +625,15 @@ function updateLineItemsInCurrentCart(payload) {
625
625
  }
626
626
  return __updateLineItemsInCurrentCart;
627
627
  }
628
- function addDiscountToCurrentCart(payload) {
629
- function __addDiscountToCurrentCart({ host }) {
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.AddDiscountToCurrentCart",
633
+ methodFqn: "wix.ecom.cart.v2.CurrentCartService.AddCouponToCurrentCart",
634
634
  packageName: PACKAGE_NAME,
635
635
  url: resolveWixEcomCartV2CurrentCartServiceUrl({
636
- protoPath: "/v2/carts/current/add-discount",
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 __addDiscountToCurrentCart;
676
+ return __addCouponToCurrentCart;
677
677
  }
678
- function removeDiscountFromCurrentCart(payload) {
679
- function __removeDiscountFromCurrentCart({ host }) {
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.RemoveDiscountFromCurrentCart",
683
+ methodFqn: "wix.ecom.cart.v2.CurrentCartService.RemoveCouponFromCurrentCart",
684
684
  packageName: PACKAGE_NAME,
685
685
  url: resolveWixEcomCartV2CurrentCartServiceUrl({
686
- protoPath: "/v2/carts/current/remove-discount",
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 __removeDiscountFromCurrentCart;
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 addDiscountToCurrentCart2(couponCode) {
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 = addDiscountToCurrentCart(payload);
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 removeDiscountFromCurrentCart2(discountId) {
1519
+ async function removeCouponFromCurrentCart2(couponId) {
1528
1520
  const { httpClient, sideEffects } = arguments[1];
1529
- const payload = renameKeysFromSDKRequestToRESTRequest({
1530
- discountId
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: { discountId: "$[0]" },
1554
+ explicitPathsToArguments: { couponId: "$[0]" },
1565
1555
  singleArgumentUnchanged: false
1566
1556
  },
1567
- ["discountId"]
1557
+ ["couponId"]
1568
1558
  );
1569
1559
  sideEffects?.onError?.(err);
1570
1560
  throw transformedError;
@@ -1668,7 +1658,6 @@ export {
1668
1658
  DescriptionLineType,
1669
1659
  DiscountScope,
1670
1660
  DiscountSourceType,
1671
- DiscountStatus,
1672
1661
  ErrorCode,
1673
1662
  FileType,
1674
1663
  ItemStatus,
@@ -1685,7 +1674,7 @@ export {
1685
1674
  VatType,
1686
1675
  WebhookIdentityType,
1687
1676
  WeightUnit,
1688
- addDiscountToCurrentCart2 as addDiscountToCurrentCart,
1677
+ addCouponToCurrentCart2 as addCouponToCurrentCart,
1689
1678
  addGiftCardToCurrentCart2 as addGiftCardToCurrentCart,
1690
1679
  addLineItemsToCurrentCart2 as addLineItemsToCurrentCart,
1691
1680
  calculateCurrentCart2 as calculateCurrentCart,
@@ -1693,7 +1682,7 @@ export {
1693
1682
  deleteCurrentCart2 as deleteCurrentCart,
1694
1683
  getCurrentCart2 as getCurrentCart,
1695
1684
  refreshCurrentCart2 as refreshCurrentCart,
1696
- removeDiscountFromCurrentCart2 as removeDiscountFromCurrentCart,
1685
+ removeCouponFromCurrentCart2 as removeCouponFromCurrentCart,
1697
1686
  removeGiftCardFromCurrentCart2 as removeGiftCardFromCurrentCart,
1698
1687
  removeLineItemsFromCurrentCart2 as removeLineItemsFromCurrentCart,
1699
1688
  updateCurrentCart2 as updateCurrentCart,