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