@wix/auto_sdk_ecom_current-cart-v-2 1.0.30 → 1.0.32

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.
@@ -19,7 +19,7 @@ interface Cart {
19
19
  * Revision number, which increments by 1 each time the Cart is updated.
20
20
  * @readonly
21
21
  */
22
- revision?: string | null;
22
+ revision?: string;
23
23
  /**
24
24
  * Line items added to the Cart by the customer.
25
25
  * This list may include items in stock and invalid out out stock.
@@ -1986,7 +1986,7 @@ interface LineItem {
1986
1986
  }
1987
1987
  interface CreateCurrentCartRequest {
1988
1988
  /** Cart to be created. */
1989
- cart: Cart;
1989
+ cart?: Cart;
1990
1990
  /**
1991
1991
  * A list of catalog items to add to the cart.
1992
1992
  * @maxSize 300
@@ -2915,6 +2915,8 @@ interface HeadersEntry {
2915
2915
  value?: string;
2916
2916
  }
2917
2917
  interface CreateCurrentCartOptions {
2918
+ /** Cart to be created. */
2919
+ cart?: Cart;
2918
2920
  /**
2919
2921
  * A list of catalog items to add to the cart.
2920
2922
  * @maxSize 300
@@ -1138,11 +1138,11 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
1138
1138
  WebhookIdentityType2["APP"] = "APP";
1139
1139
  return WebhookIdentityType2;
1140
1140
  })(WebhookIdentityType || {});
1141
- async function createCurrentCart2(cart, options) {
1142
- const { httpClient, sideEffects } = arguments[2];
1141
+ async function createCurrentCart2(options) {
1142
+ const { httpClient, sideEffects } = arguments[1];
1143
1143
  const payload = (0, import_transform_paths2.transformPaths)(
1144
1144
  (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
1145
- cart,
1145
+ cart: options?.cart,
1146
1146
  catalogItems: options?.catalogItems,
1147
1147
  customItems: options?.customItems,
1148
1148
  couponCodes: options?.couponCodes,
@@ -1208,16 +1208,16 @@ async function createCurrentCart2(cart, options) {
1208
1208
  {
1209
1209
  spreadPathsToArguments: {},
1210
1210
  explicitPathsToArguments: {
1211
- cart: "$[0]",
1212
- catalogItems: "$[1].catalogItems",
1213
- customItems: "$[1].customItems",
1214
- couponCodes: "$[1].couponCodes",
1215
- deliveryMethod: "$[1].deliveryMethod",
1216
- giftCardCodes: "$[1].giftCardCodes"
1211
+ cart: "$[0].cart",
1212
+ catalogItems: "$[0].catalogItems",
1213
+ customItems: "$[0].customItems",
1214
+ couponCodes: "$[0].couponCodes",
1215
+ deliveryMethod: "$[0].deliveryMethod",
1216
+ giftCardCodes: "$[0].giftCardCodes"
1217
1217
  },
1218
1218
  singleArgumentUnchanged: false
1219
1219
  },
1220
- ["cart", "options"]
1220
+ ["options"]
1221
1221
  );
1222
1222
  sideEffects?.onError?.(err);
1223
1223
  throw transformedError;
@@ -1839,8 +1839,7 @@ async function removeGiftCardFromCurrentCart2(giftCardId) {
1839
1839
 
1840
1840
  // src/ecom-v2-cart-current-cart-v-2.public.ts
1841
1841
  function createCurrentCart3(httpClient) {
1842
- return (cart, options) => createCurrentCart2(
1843
- cart,
1842
+ return (options) => createCurrentCart2(
1844
1843
  options,
1845
1844
  // @ts-ignore
1846
1845
  { httpClient }