@wix/auto_sdk_ecom_current-cart-v-2 1.0.16 → 1.0.17

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.
@@ -123,7 +123,7 @@ interface V2LineItem {
123
123
  /**
124
124
  * Custom extended fields for the line item object.
125
125
  *
126
- * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
126
+ * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured using the 'Checkout & Orders - Line Items Schema Plugin' in the app dashboard before they can be accessed with API calls.
127
127
  */
128
128
  extendedFields?: ExtendedFields;
129
129
  /**
@@ -1489,16 +1489,6 @@ interface CartSummary {
1489
1489
  priceSummary?: PriceSummary;
1490
1490
  /** Payment details summarizing how the customer will pay for the order. */
1491
1491
  paymentSummary?: PaymentSummary;
1492
- /**
1493
- * List of errors that occurred during the calculation process.
1494
- * @maxSize 100
1495
- */
1496
- errors?: CalculationError[];
1497
- /**
1498
- * List of business violations raised by the Validations service plugin ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/service-plugins/validations/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/service-plugins/validations-integration-service-plugin/introduction)).
1499
- * @maxSize 100
1500
- */
1501
- violations?: Violation[];
1502
1492
  /**
1503
1493
  * A token representing the Cart's calculated prices.
1504
1494
  *
@@ -1515,6 +1505,17 @@ interface CartSummary {
1515
1505
  * @maxLength 1024
1516
1506
  */
1517
1507
  priceVerificationToken?: string | null;
1508
+ /**
1509
+ * List of errors that occurred during the calculation process, returned by Totals Calculator.
1510
+ * TODO: Temporary field for backward compatibility; will be removed once we introduce the unified 'violations' model.
1511
+ */
1512
+ calculationErrors?: CalculationErrors;
1513
+ /**
1514
+ * List of business violations raised by the Validations service plugin ([SDK](https://dev.wix.com/docs/sdk/backend-modules/ecom/service-plugins/validations/introduction) | [REST](https://dev.wix.com/docs/rest/business-solutions/e-commerce/service-plugins/validations-integration-service-plugin/introduction)).
1515
+ * TODO: Temporary field for backward compatibility; will be removed once we introduce the unified 'violations' model.
1516
+ * @maxSize 100
1517
+ */
1518
+ spiViolations?: Violation[];
1518
1519
  }
1519
1520
  interface LineItemSummary {
1520
1521
  /**
@@ -1759,32 +1760,37 @@ interface Charge {
1759
1760
  /** The billing date from which the charge starts. */
1760
1761
  cycleBillingDate?: Date | null;
1761
1762
  }
1762
- interface CalculationError {
1763
- /** The calculation component that caused the error. */
1764
- component?: CalculationComponentWithLiterals;
1765
- /** Machine-readable error code. */
1766
- code?: ErrorCodeWithLiterals;
1763
+ interface CalculationErrors extends CalculationErrorsShippingCalculationErrorOneOf {
1764
+ /** General shipping calculation error. */
1765
+ generalShippingCalculationError?: Details;
1766
+ /** Carrier errors. */
1767
+ carrierErrors?: CarrierErrors;
1768
+ /** Tax calculation error. */
1769
+ taxCalculationError?: Details;
1770
+ /** Coupon calculation error. */
1771
+ couponCalculationError?: Details;
1772
+ /** Gift card calculation error. */
1773
+ giftCardCalculationError?: Details;
1774
+ /**
1775
+ * Order validation errors.
1776
+ * @maxSize 100
1777
+ */
1778
+ orderValidationErrors?: ApplicationError[];
1767
1779
  /**
1768
- * Human-readable explanation.
1769
- * @maxLength 100
1780
+ * Membership payment methods calculation errors
1781
+ * For example, will indicate that a line item that must be paid with membership payment doesn't have one or selected memberships are invalid
1770
1782
  */
1771
- description?: string | null;
1783
+ membershipError?: Details;
1784
+ /** Discount Rule calculation error. */
1785
+ discountsCalculationError?: Details;
1772
1786
  }
1773
- declare enum CalculationComponent {
1774
- UNKNOWN_CALCULATION_COMPONENT = "UNKNOWN_CALCULATION_COMPONENT",
1775
- DISCOUNTS = "DISCOUNTS",
1776
- DELIVERY = "DELIVERY",
1777
- TAX = "TAX",
1778
- MEMBERSHIPS = "MEMBERSHIPS",
1779
- GIFT_CARDS = "GIFT_CARDS"
1780
- }
1781
- /** @enumType */
1782
- type CalculationComponentWithLiterals = CalculationComponent | 'UNKNOWN_CALCULATION_COMPONENT' | 'DISCOUNTS' | 'DELIVERY' | 'TAX' | 'MEMBERSHIPS' | 'GIFT_CARDS';
1783
- declare enum ErrorCode {
1784
- UNKNOWN_ERROR_CODE = "UNKNOWN_ERROR_CODE"
1787
+ /** @oneof */
1788
+ interface CalculationErrorsShippingCalculationErrorOneOf {
1789
+ /** General shipping calculation error. */
1790
+ generalShippingCalculationError?: Details;
1791
+ /** Carrier errors. */
1792
+ carrierErrors?: CarrierErrors;
1785
1793
  }
1786
- /** @enumType */
1787
- type ErrorCodeWithLiterals = ErrorCode | 'UNKNOWN_ERROR_CODE';
1788
1794
  interface Details extends DetailsKindOneOf {
1789
1795
  applicationError?: ApplicationError;
1790
1796
  validationError?: ValidationError;
@@ -1881,6 +1887,22 @@ interface SystemError {
1881
1887
  /** Error code. */
1882
1888
  errorCode?: string | null;
1883
1889
  }
1890
+ interface CarrierErrors {
1891
+ /**
1892
+ * Carrier errors.
1893
+ * @maxSize 100
1894
+ */
1895
+ errors?: CarrierError[];
1896
+ }
1897
+ interface CarrierError {
1898
+ /**
1899
+ * Carrier ID.
1900
+ * @format GUID
1901
+ */
1902
+ carrierId?: string;
1903
+ /** Error details. */
1904
+ error?: Details;
1905
+ }
1884
1906
  interface Violation {
1885
1907
  /** Severity of the violation. The violations are shown on the cart and checkout pages. A warning is displayed as yellow, and allows a site visitor to proceed with caution. An error is displayed as red, and doesn't allow a site visitor to proceed with the eCommerce flow. */
1886
1908
  severity?: SeverityWithLiterals;
@@ -2614,10 +2636,14 @@ interface PlaceOrderRequest {
2614
2636
  /**
2615
2637
  * The pricing token received from `CalculateCart`'s response.
2616
2638
  * Used to verify that the prices shown to the customer have not changed before completing checkout.
2617
- * @maxLength 1024
2618
- * @readonly
2639
+ * @maxLength 3000
2619
2640
  */
2620
2641
  pricingToken?: string | null;
2642
+ /**
2643
+ * Payment token.
2644
+ * @maxLength 100
2645
+ */
2646
+ paymentToken?: string | null;
2621
2647
  /** Urls to redirect to after payment is made. */
2622
2648
  redirectUrls?: RedirectUrls;
2623
2649
  /** Indicates the payment method should be saved on the order */
@@ -2896,4 +2922,4 @@ interface UpdateLineItemsInCurrentCartOptions {
2896
2922
  lineItems?: LineItemUpdate[];
2897
2923
  }
2898
2924
 
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 };
2925
+ 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, type CalculationConfig, type CalculationErrors, type CalculationErrorsShippingCalculationErrorOneOf, type CarrierError, type CarrierErrors, 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, 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 };
@@ -20,12 +20,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
- CalculationComponent: () => CalculationComponent,
24
23
  ChannelType: () => ChannelType,
25
24
  DescriptionLineType: () => DescriptionLineType,
26
25
  DiscountScope: () => DiscountScope,
27
26
  DiscountSourceType: () => DiscountSourceType,
28
- ErrorCode: () => ErrorCode,
29
27
  FileType: () => FileType,
30
28
  ItemStatus: () => ItemStatus,
31
29
  ItemTypeItemType: () => ItemTypeItemType,
@@ -1029,19 +1027,6 @@ var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
1029
1027
  DiscountScope2["DELIVERY"] = "DELIVERY";
1030
1028
  return DiscountScope2;
1031
1029
  })(DiscountScope || {});
1032
- var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
1033
- CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
1034
- CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
1035
- CalculationComponent2["DELIVERY"] = "DELIVERY";
1036
- CalculationComponent2["TAX"] = "TAX";
1037
- CalculationComponent2["MEMBERSHIPS"] = "MEMBERSHIPS";
1038
- CalculationComponent2["GIFT_CARDS"] = "GIFT_CARDS";
1039
- return CalculationComponent2;
1040
- })(CalculationComponent || {});
1041
- var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
1042
- ErrorCode2["UNKNOWN_ERROR_CODE"] = "UNKNOWN_ERROR_CODE";
1043
- return ErrorCode2;
1044
- })(ErrorCode || {});
1045
1030
  var RuleType = /* @__PURE__ */ ((RuleType2) => {
1046
1031
  RuleType2["VALIDATION"] = "VALIDATION";
1047
1032
  RuleType2["OTHER"] = "OTHER";
@@ -1856,12 +1841,10 @@ var addGiftCardToCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createR
1856
1841
  var removeGiftCardFromCurrentCart4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(removeGiftCardFromCurrentCart3);
1857
1842
  // Annotate the CommonJS export names for ESM import in node:
1858
1843
  0 && (module.exports = {
1859
- CalculationComponent,
1860
1844
  ChannelType,
1861
1845
  DescriptionLineType,
1862
1846
  DiscountScope,
1863
1847
  DiscountSourceType,
1864
- ErrorCode,
1865
1848
  FileType,
1866
1849
  ItemStatus,
1867
1850
  ItemTypeItemType,