@wix/auto_sdk_ecom_cart-v-2 1.0.16 → 1.0.18
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 +69 -39
- package/build/cjs/index.js +2 -17
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -1
- package/build/cjs/index.typings.js +2 -17
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +156 -34
- package/build/es/index.d.mts +69 -39
- package/build/es/index.mjs +2 -15
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -1
- package/build/es/index.typings.mjs +2 -15
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +156 -34
- package/build/internal/cjs/index.d.ts +2 -2
- package/build/internal/cjs/index.js +2 -17
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +70 -40
- package/build/internal/cjs/index.typings.js +2 -17
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +156 -34
- package/build/internal/es/index.d.mts +2 -2
- package/build/internal/es/index.mjs +2 -15
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +70 -40
- package/build/internal/es/index.typings.mjs +2 -15
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +156 -34
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -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
|
/**
|
|
@@ -1238,7 +1238,7 @@ interface AddressLocation {
|
|
|
1238
1238
|
interface DeliveryMethod {
|
|
1239
1239
|
/**
|
|
1240
1240
|
* The carrier app id
|
|
1241
|
-
* @
|
|
1241
|
+
* @maxLength 50
|
|
1242
1242
|
*/
|
|
1243
1243
|
appId?: string;
|
|
1244
1244
|
/**
|
|
@@ -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
|
|
1763
|
-
/**
|
|
1764
|
-
|
|
1765
|
-
/**
|
|
1766
|
-
|
|
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
|
-
*
|
|
1769
|
-
*
|
|
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
|
-
|
|
1783
|
+
membershipError?: Details;
|
|
1784
|
+
/** Discount Rule calculation error. */
|
|
1785
|
+
discountsCalculationError?: Details;
|
|
1772
1786
|
}
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
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
|
|
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 */
|
|
@@ -2986,10 +3012,14 @@ interface PlaceOrderOptions {
|
|
|
2986
3012
|
/**
|
|
2987
3013
|
* The pricing token received from `CalculateCart`'s response.
|
|
2988
3014
|
* Used to verify that the prices shown to the customer have not changed before completing checkout.
|
|
2989
|
-
* @maxLength
|
|
2990
|
-
* @readonly
|
|
3015
|
+
* @maxLength 3000
|
|
2991
3016
|
*/
|
|
2992
3017
|
pricingToken?: string | null;
|
|
3018
|
+
/**
|
|
3019
|
+
* Payment token.
|
|
3020
|
+
* @maxLength 100
|
|
3021
|
+
*/
|
|
3022
|
+
paymentToken?: string | null;
|
|
2993
3023
|
/** Urls to redirect to after payment is made. */
|
|
2994
3024
|
redirectUrls?: RedirectUrls;
|
|
2995
3025
|
/** Indicates the payment method should be saved on the order */
|
|
@@ -3025,4 +3055,4 @@ interface MarkCartAsCompletedOptions {
|
|
|
3025
3055
|
orderId?: string | null;
|
|
3026
3056
|
}
|
|
3027
3057
|
|
|
3028
|
-
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,
|
|
3058
|
+
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, 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 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, 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
|
@@ -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,
|
|
@@ -1156,19 +1154,6 @@ var DiscountScope = /* @__PURE__ */ ((DiscountScope2) => {
|
|
|
1156
1154
|
DiscountScope2["DELIVERY"] = "DELIVERY";
|
|
1157
1155
|
return DiscountScope2;
|
|
1158
1156
|
})(DiscountScope || {});
|
|
1159
|
-
var CalculationComponent = /* @__PURE__ */ ((CalculationComponent2) => {
|
|
1160
|
-
CalculationComponent2["UNKNOWN_CALCULATION_COMPONENT"] = "UNKNOWN_CALCULATION_COMPONENT";
|
|
1161
|
-
CalculationComponent2["DISCOUNTS"] = "DISCOUNTS";
|
|
1162
|
-
CalculationComponent2["DELIVERY"] = "DELIVERY";
|
|
1163
|
-
CalculationComponent2["TAX"] = "TAX";
|
|
1164
|
-
CalculationComponent2["MEMBERSHIPS"] = "MEMBERSHIPS";
|
|
1165
|
-
CalculationComponent2["GIFT_CARDS"] = "GIFT_CARDS";
|
|
1166
|
-
return CalculationComponent2;
|
|
1167
|
-
})(CalculationComponent || {});
|
|
1168
|
-
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
1169
|
-
ErrorCode2["UNKNOWN_ERROR_CODE"] = "UNKNOWN_ERROR_CODE";
|
|
1170
|
-
return ErrorCode2;
|
|
1171
|
-
})(ErrorCode || {});
|
|
1172
1157
|
var RuleType = /* @__PURE__ */ ((RuleType2) => {
|
|
1173
1158
|
RuleType2["VALIDATION"] = "VALIDATION";
|
|
1174
1159
|
RuleType2["OTHER"] = "OTHER";
|
|
@@ -1571,6 +1556,7 @@ async function placeOrder2(cartId, options) {
|
|
|
1571
1556
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1572
1557
|
cartId,
|
|
1573
1558
|
pricingToken: options?.pricingToken,
|
|
1559
|
+
paymentToken: options?.paymentToken,
|
|
1574
1560
|
redirectUrls: options?.redirectUrls,
|
|
1575
1561
|
savePaymentMethod: options?.savePaymentMethod,
|
|
1576
1562
|
delayCapture: options?.delayCapture
|
|
@@ -1589,6 +1575,7 @@ async function placeOrder2(cartId, options) {
|
|
|
1589
1575
|
explicitPathsToArguments: {
|
|
1590
1576
|
cartId: "$[0]",
|
|
1591
1577
|
pricingToken: "$[1].pricingToken",
|
|
1578
|
+
paymentToken: "$[1].paymentToken",
|
|
1592
1579
|
redirectUrls: "$[1].redirectUrls",
|
|
1593
1580
|
savePaymentMethod: "$[1].savePaymentMethod",
|
|
1594
1581
|
delayCapture: "$[1].delayCapture"
|
|
@@ -2178,12 +2165,10 @@ var markCartAsCompleted4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTMo
|
|
|
2178
2165
|
var handleAsyncCheckoutCompletion4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(handleAsyncCheckoutCompletion3);
|
|
2179
2166
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2180
2167
|
0 && (module.exports = {
|
|
2181
|
-
CalculationComponent,
|
|
2182
2168
|
ChannelType,
|
|
2183
2169
|
DescriptionLineType,
|
|
2184
2170
|
DiscountScope,
|
|
2185
2171
|
DiscountSourceType,
|
|
2186
|
-
ErrorCode,
|
|
2187
2172
|
FileType,
|
|
2188
2173
|
ItemStatus,
|
|
2189
2174
|
ItemTypeItemType,
|