@wix/auto_sdk_ecom_cart-v-2 1.0.26 → 1.0.28

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 +88 -28
  2. package/build/cjs/index.js +109 -0
  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 +100 -0
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +84 -29
  8. package/build/cjs/meta.js +69 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +88 -28
  11. package/build/es/index.mjs +108 -0
  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 +99 -0
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +84 -29
  17. package/build/es/meta.mjs +68 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +28 -16
  20. package/build/internal/cjs/index.js +109 -0
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +114 -41
  23. package/build/internal/cjs/index.typings.js +100 -0
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +84 -29
  26. package/build/internal/cjs/meta.js +69 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +28 -16
  29. package/build/internal/es/index.mjs +108 -0
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +114 -41
  32. package/build/internal/es/index.typings.mjs +99 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +84 -29
  35. package/build/internal/es/meta.mjs +68 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1 +1 @@
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, CalculationConfig, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, CarrierError, CarrierErrors, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, ConvertedMoney, 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, 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, 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.js';
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, CalculationConfig, CalculationErrors, CalculationErrorsShippingCalculationErrorOneOf, CarrierError, CarrierErrors, Cart, CartSettings, CartSource, CartSummary, CatalogItemInput, CatalogOverrideFields, CatalogReference, ChannelType, ChannelTypeWithLiterals, Charge, Color, ConvertedMoney, 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, DeliveryMethodInput, DeliverySummary, Description, DescriptionLine, DescriptionLineDescriptionLineValueOneOf, DescriptionLineName, DescriptionLineType, DescriptionLineTypeWithLiterals, DescriptionLineValueOneOf, Details, DetailsKindOneOf, Discount, DiscountBenefit, DiscountBenefitValueOneOf, DiscountScope, DiscountScopeWithLiterals, DiscountSource, DiscountSourceType, DiscountSourceTypeWithLiterals, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, 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, 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, SetDeliveryMethodForCurrentCartRequest, SetDeliveryMethodForCurrentCartResponse, SetDeliveryMethodRequest, SetDeliveryMethodResponse, Severity, SeverityWithLiterals, StreetAddress, SubscriptionCharges, SubscriptionFrequency, SubscriptionFrequencyWithLiterals, SubscriptionOptionInfo, SubscriptionSettings, SuggestedFix, SuggestedFixWithLiterals, SystemError, Target, TargetTargetTypeOneOf, Tax, TaxDetails, TaxInfo, TaxSummary, TaxableAddress, TaxableAddressTaxableAddressDataOneOf, TaxableAddressType, TaxableAddressTypeWithLiterals, Title, TranslatableString, UnmarkAsCurrentCartRequest, UnmarkAsCurrentCartResponse, 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.js';
@@ -54,6 +54,7 @@ __export(index_typings_exports, {
54
54
  removeCoupon: () => removeCoupon2,
55
55
  removeGiftCard: () => removeGiftCard2,
56
56
  removeLineItems: () => removeLineItems2,
57
+ setDeliveryMethod: () => setDeliveryMethod2,
57
58
  updateCart: () => updateCart2,
58
59
  updateLineItems: () => updateLineItems2
59
60
  });
@@ -803,6 +804,55 @@ function removeCoupon(payload) {
803
804
  }
804
805
  return __removeCoupon;
805
806
  }
807
+ function setDeliveryMethod(payload) {
808
+ function __setDeliveryMethod({ host }) {
809
+ const metadata = {
810
+ entityFqdn: "wix.ecom.v2.cart",
811
+ method: "POST",
812
+ methodFqn: "wix.ecom.cart.v2.CartService.SetDeliveryMethod",
813
+ packageName: PACKAGE_NAME,
814
+ migrationOptions: {
815
+ optInTransformResponse: true
816
+ },
817
+ url: resolveWixEcomCartV2CartServiceUrl({
818
+ protoPath: "/v2/carts/{cartId}/set-delivery-method",
819
+ data: payload,
820
+ host
821
+ }),
822
+ data: payload,
823
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
824
+ {
825
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
826
+ paths: [
827
+ { path: "cart.createdDate" },
828
+ { path: "cart.updatedDate" },
829
+ {
830
+ path: "cart.lineItems.attributes.subscriptionInfo.subscriptionSettings.startDate"
831
+ },
832
+ {
833
+ path: "cart.lineItems.attributes.serviceProperties.scheduledDate"
834
+ }
835
+ ]
836
+ },
837
+ {
838
+ transformFn: import_float2.transformRESTFloatToSDKFloat,
839
+ paths: [
840
+ {
841
+ path: "cart.lineItems.source.catalogOverrideFields.physicalProperties.weight"
842
+ },
843
+ { path: "cart.lineItems.attributes.physicalProperties.weight" },
844
+ { path: "cart.deliveryInfo.address.geocode.latitude" },
845
+ { path: "cart.deliveryInfo.address.geocode.longitude" },
846
+ { path: "cart.paymentInfo.billingAddress.geocode.latitude" },
847
+ { path: "cart.paymentInfo.billingAddress.geocode.longitude" }
848
+ ]
849
+ }
850
+ ])
851
+ };
852
+ return metadata;
853
+ }
854
+ return __setDeliveryMethod;
855
+ }
806
856
  function addGiftCard(payload) {
807
857
  function __addGiftCard({ host }) {
808
858
  const metadata = {
@@ -1151,6 +1201,7 @@ async function createCart2(options) {
1151
1201
  catalogItems: options?.catalogItems,
1152
1202
  customItems: options?.customItems,
1153
1203
  couponCodes: options?.couponCodes,
1204
+ deliveryMethod: options?.deliveryMethod,
1154
1205
  giftCardCodes: options?.giftCardCodes
1155
1206
  }),
1156
1207
  [
@@ -1216,6 +1267,7 @@ async function createCart2(options) {
1216
1267
  catalogItems: "$[0].catalogItems",
1217
1268
  customItems: "$[0].customItems",
1218
1269
  couponCodes: "$[0].couponCodes",
1270
+ deliveryMethod: "$[0].deliveryMethod",
1219
1271
  giftCardCodes: "$[0].giftCardCodes"
1220
1272
  },
1221
1273
  singleArgumentUnchanged: false
@@ -1780,6 +1832,53 @@ async function removeCoupon2(cartId, couponId) {
1780
1832
  throw transformedError;
1781
1833
  }
1782
1834
  }
1835
+ async function setDeliveryMethod2(cartId, deliveryMethod) {
1836
+ const { httpClient, sideEffects } = arguments[2];
1837
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1838
+ cartId,
1839
+ deliveryMethod
1840
+ });
1841
+ const reqOpts = setDeliveryMethod(payload);
1842
+ sideEffects?.onSiteCall?.();
1843
+ try {
1844
+ const result = await httpClient.request(reqOpts);
1845
+ sideEffects?.onSuccess?.(result);
1846
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
1847
+ (0, import_transform_paths2.transformPaths)(result.data, [
1848
+ {
1849
+ transformFn: import_image2.transformRESTImageToSDKImage,
1850
+ paths: [
1851
+ { path: "cart.lineItems.source.catalogOverrideFields.image" },
1852
+ { path: "cart.lineItems.attributes.image" }
1853
+ ]
1854
+ },
1855
+ {
1856
+ transformFn: import_page_url_v22.transformRESTPageURLV2ToSDKPageURLV2,
1857
+ paths: [{ path: "cart.lineItems.attributes.url" }]
1858
+ },
1859
+ {
1860
+ transformFn: import_address2.transformRESTAddressToSDKAddress,
1861
+ paths: [
1862
+ { path: "cart.deliveryInfo.address" },
1863
+ { path: "cart.paymentInfo.billingAddress" }
1864
+ ]
1865
+ }
1866
+ ])
1867
+ );
1868
+ } catch (err) {
1869
+ const transformedError = (0, import_transform_error.transformError)(
1870
+ err,
1871
+ {
1872
+ spreadPathsToArguments: {},
1873
+ explicitPathsToArguments: { cartId: "$[0]", deliveryMethod: "$[1]" },
1874
+ singleArgumentUnchanged: false
1875
+ },
1876
+ ["cartId", "deliveryMethod"]
1877
+ );
1878
+ sideEffects?.onError?.(err);
1879
+ throw transformedError;
1880
+ }
1881
+ }
1783
1882
  async function addGiftCard2(cartId, giftCardCode) {
1784
1883
  const { httpClient, sideEffects } = arguments[2];
1785
1884
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -1980,6 +2079,7 @@ async function handleAsyncCheckoutCompletion2(token) {
1980
2079
  removeCoupon,
1981
2080
  removeGiftCard,
1982
2081
  removeLineItems,
2082
+ setDeliveryMethod,
1983
2083
  updateCart,
1984
2084
  updateLineItems
1985
2085
  });