@coveo/headless 3.28.3-pre.695edfd62e → 3.28.3-pre.6a8b1a1dbe

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 (36) hide show
  1. package/dist/cjs/case-assist/headless.cjs +1 -1
  2. package/dist/cjs/commerce/headless.cjs +25 -61
  3. package/dist/cjs/commerce/node.cjs.stats.json +1 -1
  4. package/dist/cjs/headless.cjs +1 -1
  5. package/dist/cjs/insight/headless.cjs +1 -1
  6. package/dist/cjs/recommendation/headless.cjs +1 -1
  7. package/dist/cjs/ssr/headless.cjs +1 -1
  8. package/dist/cjs/ssr-commerce/headless.cjs +25 -61
  9. package/dist/cjs/ssr-commerce/node.cjs.stats.json +1 -1
  10. package/dist/cjs/ssr-commerce-next/headless.cjs +25 -61
  11. package/dist/cjs/ssr-commerce-next/node.cjs.stats.json +1 -1
  12. package/dist/cjs/ssr-next/headless.cjs +1 -1
  13. package/dist/definitions/api/commerce/common/product.d.ts +0 -4
  14. package/dist/definitions/ssr-next/commerce/engine/commerce-engine.ssr.d.ts +31 -5
  15. package/dist/definitions/ssr-next/commerce/types/engine.d.ts +0 -8
  16. package/dist/definitions/ssr-next/commerce/types/fetch-static-state.d.ts +35 -1
  17. package/dist/definitions/ssr-next/common/types/engine.d.ts +0 -8
  18. package/dist/definitions/ssr-next/common/types/fetch-static-state.d.ts +18 -1
  19. package/dist/definitions/ssr-next/search/engine/search-engine.ssr.d.ts +19 -20
  20. package/dist/esm/controllers/commerce/core/interactive-product/headless-core-interactive-product.js +1 -2
  21. package/dist/esm/features/commerce/instant-products/instant-products-slice.js +3 -6
  22. package/dist/esm/features/commerce/product-listing/product-listing-slice.js +4 -7
  23. package/dist/esm/features/commerce/recommendations/recommendations-slice.js +4 -7
  24. package/dist/esm/features/commerce/search/search-slice.js +4 -7
  25. package/dist/esm/ssr-next/commerce/engine/commerce-engine.ssr.js +35 -14
  26. package/dist/esm/ssr-next/commerce/factories/static-state-factory.js +22 -8
  27. package/dist/esm/ssr-next/search/engine/search-engine.ssr.js +55 -39
  28. package/dist/esm/utils/version.js +1 -1
  29. package/dist/quantic/case-assist/headless.js +1 -1
  30. package/dist/quantic/commerce/browser.cjs.stats.json +1 -1
  31. package/dist/quantic/commerce/headless.js +7 -7
  32. package/dist/quantic/commerce/headless.js.map +3 -3
  33. package/dist/quantic/headless.js +1 -1
  34. package/dist/quantic/insight/headless.js +1 -1
  35. package/dist/quantic/recommendation/headless.js +1 -1
  36. package/package.json +1 -1
@@ -800,7 +800,7 @@ var import_bueno5 = require("@coveo/bueno");
800
800
  var import_toolkit7 = require("@reduxjs/toolkit");
801
801
 
802
802
  // src/utils/version.ts
803
- var VERSION = "3.28.3-pre.695edfd62e";
803
+ var VERSION = "3.28.3-pre.6a8b1a1dbe";
804
804
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
805
805
 
806
806
  // src/features/configuration/configuration-actions.ts
@@ -1148,7 +1148,7 @@ var import_bueno6 = require("@coveo/bueno");
1148
1148
  var import_toolkit4 = require("@reduxjs/toolkit");
1149
1149
 
1150
1150
  // src/utils/version.ts
1151
- var VERSION = "3.28.3-pre.695edfd62e";
1151
+ var VERSION = "3.28.3-pre.6a8b1a1dbe";
1152
1152
  var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
1153
1153
 
1154
1154
  // src/features/configuration/configuration-actions.ts
@@ -10355,11 +10355,7 @@ var productListingReducer = (0, import_toolkit62.createReducer)(
10355
10355
  const paginationOffset = getPaginationOffset(action.payload);
10356
10356
  handleFullfilled(state, action.payload.response);
10357
10357
  state.products = action.payload.response.products.map(
10358
- (product, index) => preprocessProduct(
10359
- product,
10360
- paginationOffset + index + 1,
10361
- action.payload.response.responseId
10362
- )
10358
+ (product, index) => preprocessProduct(product, paginationOffset + index + 1)
10363
10359
  );
10364
10360
  }).addCase(fetchMoreProducts2.fulfilled, (state, action) => {
10365
10361
  if (!action.payload) {
@@ -10369,11 +10365,7 @@ var productListingReducer = (0, import_toolkit62.createReducer)(
10369
10365
  handleFullfilled(state, action.payload.response);
10370
10366
  state.products = state.products.concat(
10371
10367
  action.payload.response.products.map(
10372
- (product, index) => preprocessProduct(
10373
- product,
10374
- paginationOffset + index + 1,
10375
- action.payload?.response.responseId
10376
- )
10368
+ (product, index) => preprocessProduct(product, paginationOffset + index + 1)
10377
10369
  )
10378
10370
  );
10379
10371
  }).addCase(fetchProductListing.pending, (state, action) => {
@@ -10392,15 +10384,13 @@ var productListingReducer = (0, import_toolkit62.createReducer)(
10392
10384
  if (currentParentIndex === -1 || childToPromote === void 0) {
10393
10385
  return;
10394
10386
  }
10395
- const responseId = products[currentParentIndex].responseId;
10396
10387
  const position = products[currentParentIndex].position;
10397
10388
  const { children, totalNumberOfChildren } = products[currentParentIndex];
10398
10389
  const newParent = {
10399
10390
  ...childToPromote,
10400
10391
  children,
10401
10392
  totalNumberOfChildren,
10402
- position,
10403
- responseId
10393
+ position
10404
10394
  };
10405
10395
  products.splice(currentParentIndex, 1, newParent);
10406
10396
  }).addCase(setView, () => getProductListingInitialState()).addCase(setContext, () => getProductListingInitialState()).addCase(setError, (state, action) => {
@@ -10426,12 +10416,12 @@ function getPaginationOffset(payload) {
10426
10416
  const pagination = payload.response.pagination;
10427
10417
  return pagination.page * pagination.perPage;
10428
10418
  }
10429
- function preprocessProduct(product, position, responseId) {
10419
+ function preprocessProduct(product, position) {
10430
10420
  const isParentAlreadyInChildren = product.children.some(
10431
10421
  (child) => child.permanentid === product.permanentid
10432
10422
  );
10433
10423
  if (product.children.length === 0 || isParentAlreadyInChildren) {
10434
- return { ...product, position, responseId };
10424
+ return { ...product, position };
10435
10425
  }
10436
10426
  const {
10437
10427
  children,
@@ -10441,8 +10431,7 @@ function preprocessProduct(product, position, responseId) {
10441
10431
  return {
10442
10432
  ...product,
10443
10433
  children: [restOfProduct, ...children],
10444
- position,
10445
- responseId
10434
+ position
10446
10435
  };
10447
10436
  }
10448
10437
 
@@ -10505,11 +10494,7 @@ var recommendationsReducer = (0, import_toolkit64.createReducer)(
10505
10494
  }
10506
10495
  const paginationOffset = getPaginationOffset2(action.payload);
10507
10496
  recommendations.products = response.products.map(
10508
- (product, index) => preprocessProduct2(
10509
- product,
10510
- paginationOffset + index + 1,
10511
- response.responseId
10512
- )
10497
+ (product, index) => preprocessProduct2(product, paginationOffset + index + 1)
10513
10498
  );
10514
10499
  }).addCase(fetchMoreRecommendations.fulfilled, (state, action) => {
10515
10500
  if (!action.payload) {
@@ -10525,11 +10510,7 @@ var recommendationsReducer = (0, import_toolkit64.createReducer)(
10525
10510
  const paginationOffset = getPaginationOffset2(action.payload);
10526
10511
  recommendations.products = recommendations.products.concat(
10527
10512
  response.products.map(
10528
- (product, index) => preprocessProduct2(
10529
- product,
10530
- paginationOffset + index + 1,
10531
- response.responseId
10532
- )
10513
+ (product, index) => preprocessProduct2(product, paginationOffset + index + 1)
10533
10514
  )
10534
10515
  );
10535
10516
  }).addCase(fetchRecommendations.pending, (state, action) => {
@@ -10552,15 +10533,13 @@ var recommendationsReducer = (0, import_toolkit64.createReducer)(
10552
10533
  if (currentParentIndex === -1 || childToPromote === void 0) {
10553
10534
  return;
10554
10535
  }
10555
- const responseId = products[currentParentIndex].responseId;
10556
10536
  const position = products[currentParentIndex].position;
10557
10537
  const { children, totalNumberOfChildren } = products[currentParentIndex];
10558
10538
  const newParent = {
10559
10539
  ...childToPromote,
10560
10540
  children,
10561
10541
  totalNumberOfChildren,
10562
- position,
10563
- responseId
10542
+ position
10564
10543
  };
10565
10544
  products.splice(currentParentIndex, 1, newParent);
10566
10545
  }).addCase(setError, (state, action) => {
@@ -10605,12 +10584,12 @@ function getPaginationOffset2(actionPayload) {
10605
10584
  const pagination = actionPayload.response.pagination;
10606
10585
  return pagination.page * pagination.perPage;
10607
10586
  }
10608
- function preprocessProduct2(product, position, responseId) {
10587
+ function preprocessProduct2(product, position) {
10609
10588
  const isParentAlreadyInChildren = product.children.some(
10610
10589
  (child) => child.permanentid === product.permanentid
10611
10590
  );
10612
10591
  if (product.children.length === 0 || isParentAlreadyInChildren) {
10613
- return { ...product, position, responseId };
10592
+ return { ...product, position };
10614
10593
  }
10615
10594
  const {
10616
10595
  children,
@@ -10620,8 +10599,7 @@ function preprocessProduct2(product, position, responseId) {
10620
10599
  return {
10621
10600
  ...product,
10622
10601
  children: [restOfProduct, ...children],
10623
- position,
10624
- responseId
10602
+ position
10625
10603
  };
10626
10604
  }
10627
10605
 
@@ -10655,11 +10633,7 @@ var commerceSearchReducer = (0, import_toolkit65.createReducer)(
10655
10633
  action.payload.queryExecuted
10656
10634
  );
10657
10635
  state.products = action.payload.response.products.map(
10658
- (product, index) => preprocessProduct3(
10659
- product,
10660
- paginationOffset + index + 1,
10661
- action.payload.response.responseId
10662
- )
10636
+ (product, index) => preprocessProduct3(product, paginationOffset + index + 1)
10663
10637
  );
10664
10638
  }).addCase(fetchMoreProducts.fulfilled, (state, action) => {
10665
10639
  if (!action.payload) {
@@ -10673,11 +10647,7 @@ var commerceSearchReducer = (0, import_toolkit65.createReducer)(
10673
10647
  );
10674
10648
  state.products = state.products.concat(
10675
10649
  action.payload.response.products.map(
10676
- (product, index) => preprocessProduct3(
10677
- product,
10678
- paginationOffset + index + 1,
10679
- action.payload?.response.responseId
10680
- )
10650
+ (product, index) => preprocessProduct3(product, paginationOffset + index + 1)
10681
10651
  )
10682
10652
  );
10683
10653
  }).addCase(executeSearch.pending, (state, action) => {
@@ -10696,15 +10666,13 @@ var commerceSearchReducer = (0, import_toolkit65.createReducer)(
10696
10666
  if (currentParentIndex === -1 || childToPromote === void 0) {
10697
10667
  return;
10698
10668
  }
10699
- const responseId = products[currentParentIndex].responseId;
10700
10669
  const position = products[currentParentIndex].position;
10701
10670
  const { children, totalNumberOfChildren } = products[currentParentIndex];
10702
10671
  const newParent = {
10703
10672
  ...childToPromote,
10704
10673
  children,
10705
10674
  totalNumberOfChildren,
10706
- position,
10707
- responseId
10675
+ position
10708
10676
  };
10709
10677
  products.splice(currentParentIndex, 1, newParent);
10710
10678
  }).addCase(setView, () => getCommerceSearchInitialState()).addCase(setContext, () => getCommerceSearchInitialState()).addCase(setError, (state, action) => {
@@ -10732,12 +10700,12 @@ function getPaginationOffset3(payload) {
10732
10700
  const pagination = payload.response.pagination;
10733
10701
  return pagination.page * pagination.perPage;
10734
10702
  }
10735
- function preprocessProduct3(product, position, responseId) {
10703
+ function preprocessProduct3(product, position) {
10736
10704
  const isParentAlreadyInChildren = product.children.some(
10737
10705
  (child) => child.permanentid === product.permanentid
10738
10706
  );
10739
10707
  if (product.children.length === 0 || isParentAlreadyInChildren) {
10740
- return { ...product, position, responseId };
10708
+ return { ...product, position };
10741
10709
  }
10742
10710
  const {
10743
10711
  children,
@@ -10747,8 +10715,7 @@ function preprocessProduct3(product, position, responseId) {
10747
10715
  return {
10748
10716
  ...product,
10749
10717
  children: [restOfProduct, ...children],
10750
- position,
10751
- responseId
10718
+ position
10752
10719
  };
10753
10720
  }
10754
10721
 
@@ -13214,7 +13181,7 @@ var instantProductsReducer = (0, import_toolkit88.createReducer)(
13214
13181
  state,
13215
13182
  {
13216
13183
  products: products.map(
13217
- (product, index) => preprocessProduct4(product, index + 1, responseId)
13184
+ (product, index) => preprocessProduct4(product, index + 1)
13218
13185
  )
13219
13186
  }
13220
13187
  );
@@ -13236,15 +13203,13 @@ var instantProductsReducer = (0, import_toolkit88.createReducer)(
13236
13203
  if (currentParentIndex === -1 || childToPromote === void 0) {
13237
13204
  return;
13238
13205
  }
13239
- const responseId = products[currentParentIndex].responseId;
13240
13206
  const position = products[currentParentIndex].position;
13241
13207
  const { children, totalNumberOfChildren } = products[currentParentIndex];
13242
13208
  const newParent = {
13243
13209
  ...childToPromote,
13244
13210
  children,
13245
13211
  totalNumberOfChildren,
13246
- position,
13247
- responseId
13212
+ position
13248
13213
  };
13249
13214
  const newProducts = [...products];
13250
13215
  newProducts.splice(currentParentIndex, 1, newParent);
@@ -13252,12 +13217,12 @@ var instantProductsReducer = (0, import_toolkit88.createReducer)(
13252
13217
  });
13253
13218
  }
13254
13219
  );
13255
- function preprocessProduct4(product, position, responseId) {
13220
+ function preprocessProduct4(product, position) {
13256
13221
  const isParentAlreadyInChildren = product.children.some(
13257
13222
  (child) => child.permanentid === product.permanentid
13258
13223
  );
13259
13224
  if (product.children.length === 0 || isParentAlreadyInChildren) {
13260
- return { ...product, position, responseId };
13225
+ return { ...product, position };
13261
13226
  }
13262
13227
  const {
13263
13228
  children,
@@ -13267,8 +13232,7 @@ function preprocessProduct4(product, position, responseId) {
13267
13232
  return {
13268
13233
  ...product,
13269
13234
  children: [restOfProduct, ...children],
13270
- position,
13271
- responseId
13235
+ position
13272
13236
  };
13273
13237
  }
13274
13238
 
@@ -15712,7 +15676,7 @@ Review the configuration of the above 'ec_'-prefixed fields in your index, and m
15712
15676
  productId: props.options.product.ec_product_id ?? props.options.product.permanentid
15713
15677
  },
15714
15678
  position: props.options.product.position,
15715
- responseId: props.options.product.responseId ?? props.responseIdSelector(engine[stateKey])
15679
+ responseId: props.responseIdSelector(engine[stateKey])
15716
15680
  })
15717
15681
  );
15718
15682
  };