@wix/auto_sdk_ecom_cart-v-2 1.0.15 → 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.
Files changed (37) hide show
  1. package/build/cjs/index.d.ts +68 -38
  2. package/build/cjs/index.js +53 -17
  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 +53 -17
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +155 -33
  8. package/build/cjs/meta.js +51 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +68 -38
  11. package/build/es/index.mjs +53 -15
  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 +53 -15
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +155 -33
  17. package/build/es/meta.mjs +51 -0
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +2 -2
  20. package/build/internal/cjs/index.js +53 -17
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +69 -39
  23. package/build/internal/cjs/index.typings.js +53 -17
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +155 -33
  26. package/build/internal/cjs/meta.js +51 -0
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +2 -2
  29. package/build/internal/es/index.mjs +53 -15
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +69 -39
  32. package/build/internal/es/index.typings.mjs +53 -15
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +155 -33
  35. package/build/internal/es/meta.mjs +51 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -125,7 +125,7 @@ interface V2LineItem {
125
125
  /**
126
126
  * Custom extended fields for the line item object.
127
127
  *
128
- * [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.
128
+ * [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.
129
129
  */
130
130
  extendedFields?: ExtendedFields;
131
131
  /**
@@ -1460,16 +1460,6 @@ interface CartSummary {
1460
1460
  priceSummary?: PriceSummary;
1461
1461
  /** Payment details summarizing how the customer will pay for the order. */
1462
1462
  paymentSummary?: PaymentSummary;
1463
- /**
1464
- * List of errors that occurred during the calculation process.
1465
- * @maxSize 100
1466
- */
1467
- errors?: CalculationError[];
1468
- /**
1469
- * 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)).
1470
- * @maxSize 100
1471
- */
1472
- violations?: Violation[];
1473
1463
  /**
1474
1464
  * A token representing the Cart's calculated prices.
1475
1465
  *
@@ -1486,6 +1476,17 @@ interface CartSummary {
1486
1476
  * @maxLength 1024
1487
1477
  */
1488
1478
  priceVerificationToken?: string | null;
1479
+ /**
1480
+ * List of errors that occurred during the calculation process, returned by Totals Calculator.
1481
+ * TODO: Temporary field for backward compatibility; will be removed once we introduce the unified 'violations' model.
1482
+ */
1483
+ calculationErrors?: CalculationErrors;
1484
+ /**
1485
+ * 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)).
1486
+ * TODO: Temporary field for backward compatibility; will be removed once we introduce the unified 'violations' model.
1487
+ * @maxSize 100
1488
+ */
1489
+ spiViolations?: Violation[];
1489
1490
  }
1490
1491
  interface LineItemSummary {
1491
1492
  /**
@@ -1730,32 +1731,149 @@ interface Charge {
1730
1731
  /** The billing date from which the charge starts. */
1731
1732
  cycleBillingDate?: Date | null;
1732
1733
  }
1733
- interface CalculationError {
1734
- /** The calculation component that caused the error. */
1735
- component?: CalculationComponentWithLiterals;
1736
- /** Machine-readable error code. */
1737
- code?: ErrorCodeWithLiterals;
1734
+ interface CalculationErrors extends CalculationErrorsShippingCalculationErrorOneOf {
1735
+ /** General shipping calculation error. */
1736
+ generalShippingCalculationError?: Details;
1737
+ /** Carrier errors. */
1738
+ carrierErrors?: CarrierErrors;
1739
+ /** Tax calculation error. */
1740
+ taxCalculationError?: Details;
1741
+ /** Coupon calculation error. */
1742
+ couponCalculationError?: Details;
1743
+ /** Gift card calculation error. */
1744
+ giftCardCalculationError?: Details;
1745
+ /**
1746
+ * Order validation errors.
1747
+ * @maxSize 100
1748
+ */
1749
+ orderValidationErrors?: ApplicationError[];
1738
1750
  /**
1739
- * Human-readable explanation.
1740
- * @maxLength 100
1751
+ * Membership payment methods calculation errors
1752
+ * For example, will indicate that a line item that must be paid with membership payment doesn't have one or selected memberships are invalid
1741
1753
  */
1742
- description?: string | null;
1754
+ membershipError?: Details;
1755
+ /** Discount Rule calculation error. */
1756
+ discountsCalculationError?: Details;
1743
1757
  }
1744
- declare enum CalculationComponent {
1745
- UNKNOWN_CALCULATION_COMPONENT = "UNKNOWN_CALCULATION_COMPONENT",
1746
- DISCOUNTS = "DISCOUNTS",
1747
- DELIVERY = "DELIVERY",
1748
- TAX = "TAX",
1749
- MEMBERSHIPS = "MEMBERSHIPS",
1750
- GIFT_CARDS = "GIFT_CARDS"
1758
+ /** @oneof */
1759
+ interface CalculationErrorsShippingCalculationErrorOneOf {
1760
+ /** General shipping calculation error. */
1761
+ generalShippingCalculationError?: Details;
1762
+ /** Carrier errors. */
1763
+ carrierErrors?: CarrierErrors;
1751
1764
  }
1752
- /** @enumType */
1753
- type CalculationComponentWithLiterals = CalculationComponent | 'UNKNOWN_CALCULATION_COMPONENT' | 'DISCOUNTS' | 'DELIVERY' | 'TAX' | 'MEMBERSHIPS' | 'GIFT_CARDS';
1754
- declare enum ErrorCode {
1755
- UNKNOWN_ERROR_CODE = "UNKNOWN_ERROR_CODE"
1765
+ interface Details extends DetailsKindOneOf {
1766
+ applicationError?: ApplicationError;
1767
+ validationError?: ValidationError;
1768
+ systemError?: SystemError;
1769
+ /**
1770
+ * deprecated in API's - to enable migration from rendering arbitrary tracing to rest response
1771
+ * @deprecated
1772
+ */
1773
+ tracing?: Record<string, string>;
1774
+ }
1775
+ /** @oneof */
1776
+ interface DetailsKindOneOf {
1777
+ applicationError?: ApplicationError;
1778
+ validationError?: ValidationError;
1779
+ systemError?: SystemError;
1780
+ }
1781
+ interface ApplicationError {
1782
+ /** Error code. */
1783
+ code?: string;
1784
+ /** Description of the error. */
1785
+ description?: string;
1786
+ /** Data related to the error. */
1787
+ data?: Record<string, any> | null;
1788
+ }
1789
+ /**
1790
+ * example result:
1791
+ * {
1792
+ * "fieldViolations": [
1793
+ * {
1794
+ * "field": "fieldA",
1795
+ * "description": "invalid music note. supported notes: [do,re,mi,fa,sol,la,ti]",
1796
+ * "violatedRule": "OTHER",
1797
+ * "ruleName": "INVALID_NOTE",
1798
+ * "data": {
1799
+ * "value": "FI"
1800
+ * }
1801
+ * },
1802
+ * {
1803
+ * "field": "fieldB",
1804
+ * "description": "field value out of range. supported range: [0-20]",
1805
+ * "violatedRule": "MAX",
1806
+ * "data": {
1807
+ * "threshold": 20
1808
+ * }
1809
+ * },
1810
+ * {
1811
+ * "field": "fieldC",
1812
+ * "description": "invalid phone number. provide a valid phone number of size: [7-12], supported characters: [0-9, +, -, (, )]",
1813
+ * "violatedRule": "FORMAT",
1814
+ * "data": {
1815
+ * "type": "PHONE"
1816
+ * }
1817
+ * }
1818
+ * ]
1819
+ * }
1820
+ */
1821
+ interface ValidationError {
1822
+ fieldViolations?: FieldViolation[];
1823
+ }
1824
+ declare enum RuleType {
1825
+ VALIDATION = "VALIDATION",
1826
+ OTHER = "OTHER",
1827
+ MAX = "MAX",
1828
+ MIN = "MIN",
1829
+ MAX_LENGTH = "MAX_LENGTH",
1830
+ MIN_LENGTH = "MIN_LENGTH",
1831
+ MAX_SIZE = "MAX_SIZE",
1832
+ MIN_SIZE = "MIN_SIZE",
1833
+ FORMAT = "FORMAT",
1834
+ DECIMAL_LTE = "DECIMAL_LTE",
1835
+ DECIMAL_GTE = "DECIMAL_GTE",
1836
+ DECIMAL_LT = "DECIMAL_LT",
1837
+ DECIMAL_GT = "DECIMAL_GT",
1838
+ DECIMAL_MAX_SCALE = "DECIMAL_MAX_SCALE",
1839
+ INVALID_ENUM_VALUE = "INVALID_ENUM_VALUE",
1840
+ REQUIRED_FIELD = "REQUIRED_FIELD",
1841
+ FIELD_NOT_ALLOWED = "FIELD_NOT_ALLOWED",
1842
+ ONE_OF_ALIGNMENT = "ONE_OF_ALIGNMENT",
1843
+ EXACT_LENGTH = "EXACT_LENGTH",
1844
+ EXACT_SIZE = "EXACT_SIZE",
1845
+ REQUIRED_ONE_OF_FIELD = "REQUIRED_ONE_OF_FIELD"
1756
1846
  }
1757
1847
  /** @enumType */
1758
- type ErrorCodeWithLiterals = ErrorCode | 'UNKNOWN_ERROR_CODE';
1848
+ type RuleTypeWithLiterals = RuleType | 'VALIDATION' | 'OTHER' | 'MAX' | 'MIN' | 'MAX_LENGTH' | 'MIN_LENGTH' | 'MAX_SIZE' | 'MIN_SIZE' | 'FORMAT' | 'DECIMAL_LTE' | 'DECIMAL_GTE' | 'DECIMAL_LT' | 'DECIMAL_GT' | 'DECIMAL_MAX_SCALE' | 'INVALID_ENUM_VALUE' | 'REQUIRED_FIELD' | 'FIELD_NOT_ALLOWED' | 'ONE_OF_ALIGNMENT' | 'EXACT_LENGTH' | 'EXACT_SIZE' | 'REQUIRED_ONE_OF_FIELD';
1849
+ interface FieldViolation {
1850
+ field?: string;
1851
+ description?: string;
1852
+ violatedRule?: RuleTypeWithLiterals;
1853
+ /** applicable when violated_rule=OTHER */
1854
+ ruleName?: string | null;
1855
+ data?: Record<string, any> | null;
1856
+ }
1857
+ interface SystemError {
1858
+ /** Error code. */
1859
+ errorCode?: string | null;
1860
+ }
1861
+ interface CarrierErrors {
1862
+ /**
1863
+ * Carrier errors.
1864
+ * @maxSize 100
1865
+ */
1866
+ errors?: CarrierError[];
1867
+ }
1868
+ interface CarrierError {
1869
+ /**
1870
+ * Carrier ID.
1871
+ * @format GUID
1872
+ */
1873
+ carrierId?: string;
1874
+ /** Error details. */
1875
+ error?: Details;
1876
+ }
1759
1877
  interface Violation {
1760
1878
  /** 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. */
1761
1879
  severity?: SeverityWithLiterals;
@@ -2175,10 +2293,14 @@ interface PlaceOrderRequest {
2175
2293
  /**
2176
2294
  * The pricing token received from `CalculateCart`'s response.
2177
2295
  * Used to verify that the prices shown to the customer have not changed before completing checkout.
2178
- * @maxLength 1024
2179
- * @readonly
2296
+ * @maxLength 3000
2180
2297
  */
2181
2298
  pricingToken?: string | null;
2299
+ /**
2300
+ * Payment token.
2301
+ * @maxLength 100
2302
+ */
2303
+ paymentToken?: string | null;
2182
2304
  /** Urls to redirect to after payment is made. */
2183
2305
  redirectUrls?: RedirectUrls;
2184
2306
  /** Indicates the payment method should be saved on the order */
package/build/es/meta.mjs CHANGED
@@ -147,6 +147,9 @@ function createCart(payload) {
147
147
  method: "POST",
148
148
  methodFqn: "wix.ecom.cart.v2.CartService.CreateCart",
149
149
  packageName: PACKAGE_NAME,
150
+ migrationOptions: {
151
+ optInTransformResponse: true
152
+ },
150
153
  url: resolveWixEcomCartV2CartServiceUrl({
151
154
  protoPath: "/v2/carts",
152
155
  data: serializedData,
@@ -197,6 +200,9 @@ function getCart(payload) {
197
200
  method: "GET",
198
201
  methodFqn: "wix.ecom.cart.v2.CartService.GetCart",
199
202
  packageName: PACKAGE_NAME,
203
+ migrationOptions: {
204
+ optInTransformResponse: true
205
+ },
200
206
  url: resolveWixEcomCartV2CartServiceUrl({
201
207
  protoPath: "/v2/carts/{cartId}",
202
208
  data: payload,
@@ -281,6 +287,9 @@ function updateCart(payload) {
281
287
  method: "PATCH",
282
288
  methodFqn: "wix.ecom.cart.v2.CartService.UpdateCart",
283
289
  packageName: PACKAGE_NAME,
290
+ migrationOptions: {
291
+ optInTransformResponse: true
292
+ },
284
293
  url: resolveWixEcomCartV2CartServiceUrl({
285
294
  protoPath: "/v2/carts/{cart.id}",
286
295
  data: serializedData,
@@ -331,6 +340,9 @@ function deleteCart(payload) {
331
340
  method: "DELETE",
332
341
  methodFqn: "wix.ecom.cart.v2.CartService.DeleteCart",
333
342
  packageName: PACKAGE_NAME,
343
+ migrationOptions: {
344
+ optInTransformResponse: true
345
+ },
334
346
  url: resolveWixEcomCartV2CartServiceUrl({
335
347
  protoPath: "/v2/carts/{cartId}",
336
348
  data: payload,
@@ -349,6 +361,9 @@ function refreshCart(payload) {
349
361
  method: "POST",
350
362
  methodFqn: "wix.ecom.cart.v2.CartService.RefreshCart",
351
363
  packageName: PACKAGE_NAME,
364
+ migrationOptions: {
365
+ optInTransformResponse: true
366
+ },
352
367
  url: resolveWixEcomCartV2CartServiceUrl({
353
368
  protoPath: "/v2/carts/{cartId}/refresh",
354
369
  data: payload,
@@ -399,6 +414,9 @@ function calculateCart(payload) {
399
414
  method: "POST",
400
415
  methodFqn: "wix.ecom.cart.v2.CartService.CalculateCart",
401
416
  packageName: PACKAGE_NAME,
417
+ migrationOptions: {
418
+ optInTransformResponse: true
419
+ },
402
420
  url: resolveWixEcomCartV2CartServiceUrl({
403
421
  protoPath: "/v2/carts/{cartId}/calculate",
404
422
  data: payload,
@@ -452,6 +470,9 @@ function getCheckoutUrl(payload) {
452
470
  method: "POST",
453
471
  methodFqn: "wix.ecom.cart.v2.CartService.GetCheckoutURL",
454
472
  packageName: PACKAGE_NAME,
473
+ migrationOptions: {
474
+ optInTransformResponse: true
475
+ },
455
476
  url: resolveWixEcomCartV2CartServiceUrl({
456
477
  protoPath: "/v2/carts/{cartId}/get-checkout-url",
457
478
  data: payload,
@@ -470,6 +491,9 @@ function placeOrder(payload) {
470
491
  method: "POST",
471
492
  methodFqn: "wix.ecom.cart.v2.CartService.PlaceOrder",
472
493
  packageName: PACKAGE_NAME,
494
+ migrationOptions: {
495
+ optInTransformResponse: true
496
+ },
473
497
  url: resolveWixEcomCartV2CartServiceUrl({
474
498
  protoPath: "/v2/carts/{cartId}/place-order",
475
499
  data: payload,
@@ -512,6 +536,9 @@ function addLineItems(payload) {
512
536
  method: "POST",
513
537
  methodFqn: "wix.ecom.cart.v2.CartService.AddLineItems",
514
538
  packageName: PACKAGE_NAME,
539
+ migrationOptions: {
540
+ optInTransformResponse: true
541
+ },
515
542
  url: resolveWixEcomCartV2CartServiceUrl({
516
543
  protoPath: "/v2/carts/{cartId}/add-line-items",
517
544
  data: serializedData,
@@ -562,6 +589,9 @@ function removeLineItems(payload) {
562
589
  method: "POST",
563
590
  methodFqn: "wix.ecom.cart.v2.CartService.RemoveLineItems",
564
591
  packageName: PACKAGE_NAME,
592
+ migrationOptions: {
593
+ optInTransformResponse: true
594
+ },
565
595
  url: resolveWixEcomCartV2CartServiceUrl({
566
596
  protoPath: "/v2/carts/{cartId}/remove-line-items",
567
597
  data: payload,
@@ -612,6 +642,9 @@ function updateLineItems(payload) {
612
642
  method: "POST",
613
643
  methodFqn: "wix.ecom.cart.v2.CartService.UpdateLineItems",
614
644
  packageName: PACKAGE_NAME,
645
+ migrationOptions: {
646
+ optInTransformResponse: true
647
+ },
615
648
  url: resolveWixEcomCartV2CartServiceUrl({
616
649
  protoPath: "/v2/carts/{cartId}/update-line-items",
617
650
  data: payload,
@@ -662,6 +695,9 @@ function addCoupon(payload) {
662
695
  method: "POST",
663
696
  methodFqn: "wix.ecom.cart.v2.CartService.AddCoupon",
664
697
  packageName: PACKAGE_NAME,
698
+ migrationOptions: {
699
+ optInTransformResponse: true
700
+ },
665
701
  url: resolveWixEcomCartV2CartServiceUrl({
666
702
  protoPath: "/v2/carts/{cartId}/add-coupon",
667
703
  data: payload,
@@ -712,6 +748,9 @@ function removeCoupon(payload) {
712
748
  method: "POST",
713
749
  methodFqn: "wix.ecom.cart.v2.CartService.RemoveCoupon",
714
750
  packageName: PACKAGE_NAME,
751
+ migrationOptions: {
752
+ optInTransformResponse: true
753
+ },
715
754
  url: resolveWixEcomCartV2CartServiceUrl({
716
755
  protoPath: "/v2/carts/{cartId}/remove-coupon",
717
756
  data: payload,
@@ -762,6 +801,9 @@ function addGiftCard(payload) {
762
801
  method: "POST",
763
802
  methodFqn: "wix.ecom.cart.v2.CartService.AddGiftCard",
764
803
  packageName: PACKAGE_NAME,
804
+ migrationOptions: {
805
+ optInTransformResponse: true
806
+ },
765
807
  url: resolveWixEcomCartV2CartServiceUrl({
766
808
  protoPath: "/v2/carts/{cartId}/add-gift-card",
767
809
  data: payload,
@@ -812,6 +854,9 @@ function removeGiftCard(payload) {
812
854
  method: "POST",
813
855
  methodFqn: "wix.ecom.cart.v2.CartService.RemoveGiftCard",
814
856
  packageName: PACKAGE_NAME,
857
+ migrationOptions: {
858
+ optInTransformResponse: true
859
+ },
815
860
  url: resolveWixEcomCartV2CartServiceUrl({
816
861
  protoPath: "/v2/carts/{cartId}/remove-gift-card",
817
862
  data: payload,
@@ -862,6 +907,9 @@ function markCartAsCompleted(payload) {
862
907
  method: "POST",
863
908
  methodFqn: "wix.ecom.cart.v2.CartService.MarkCartAsCompleted",
864
909
  packageName: PACKAGE_NAME,
910
+ migrationOptions: {
911
+ optInTransformResponse: true
912
+ },
865
913
  url: resolveWixEcomCartV2CartServiceUrl({
866
914
  protoPath: "/v2/carts/{cartId}/mark-cart-as-completed",
867
915
  data: payload,
@@ -912,6 +960,9 @@ function handleAsyncCheckoutCompletion(payload) {
912
960
  method: "POST",
913
961
  methodFqn: "wix.ecom.cart.v2.CartService.HandleAsyncCheckoutCompletion",
914
962
  packageName: PACKAGE_NAME,
963
+ migrationOptions: {
964
+ optInTransformResponse: true
965
+ },
915
966
  url: resolveWixEcomCartV2CartServiceUrl({
916
967
  protoPath: "/v2/carts/handle-async-checkout-completion",
917
968
  data: payload,