@coveo/headless 3.28.4-pre.f345a65b79 → 3.28.4-pre.fe2dbcea63
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/engine/commerce-engine.ssr.d.ts +28 -3
- package/dist/definitions/ssr-next/commerce/types/controller-inference.d.ts +3 -2
- package/dist/definitions/ssr-next/commerce/types/engine.d.ts +0 -8
- package/dist/definitions/ssr-next/commerce/types/fetch-static-state.d.ts +22 -1
- 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/navigator-context-utils.d.ts +16 -0
- package/dist/definitions/ssr-next/common/navigator-context-utils.spec.d.ts +1 -0
- package/dist/definitions/ssr-next/common/types/controllers.d.ts +6 -0
- package/dist/definitions/ssr-next/common/types/engine.d.ts +0 -8
- package/dist/definitions/ssr-next/common/types/fetch-static-state.d.ts +4 -1
- package/dist/definitions/ssr-next/common/types/inference.d.ts +3 -2
- package/dist/definitions/ssr-next/search/engine/search-engine.ssr.d.ts +18 -20
- 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/commerce/engine/commerce-engine.ssr.js +32 -12
- package/dist/esm/ssr-next/commerce/factories/static-state-factory.js +3 -10
- 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/ssr-next/common/navigator-context-utils.js +27 -0
- package/dist/esm/ssr-next/search/engine/search-engine.ssr.js +34 -40
- 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
package/dist/cjs/headless.cjs
CHANGED
|
@@ -1374,7 +1374,7 @@ var import_toolkit2 = require("@reduxjs/toolkit");
|
|
|
1374
1374
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
1375
1375
|
|
|
1376
1376
|
// src/utils/version.ts
|
|
1377
|
-
var VERSION = "3.28.4-pre.
|
|
1377
|
+
var VERSION = "3.28.4-pre.fe2dbcea63";
|
|
1378
1378
|
var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
|
|
1379
1379
|
|
|
1380
1380
|
// src/api/analytics/analytics-selectors.ts
|
|
@@ -1278,7 +1278,7 @@ var import_toolkit2 = require("@reduxjs/toolkit");
|
|
|
1278
1278
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
1279
1279
|
|
|
1280
1280
|
// src/utils/version.ts
|
|
1281
|
-
var VERSION = "3.28.4-pre.
|
|
1281
|
+
var VERSION = "3.28.4-pre.fe2dbcea63";
|
|
1282
1282
|
var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
|
|
1283
1283
|
|
|
1284
1284
|
// src/api/analytics/analytics-selectors.ts
|
|
@@ -881,7 +881,7 @@ var validateObject = (engine, schema, obj, validationMessage, errorMessage) => {
|
|
|
881
881
|
};
|
|
882
882
|
|
|
883
883
|
// src/utils/version.ts
|
|
884
|
-
var VERSION = "3.28.4-pre.
|
|
884
|
+
var VERSION = "3.28.4-pre.fe2dbcea63";
|
|
885
885
|
var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
|
|
886
886
|
|
|
887
887
|
// src/features/configuration/configuration-actions.ts
|
|
@@ -1306,7 +1306,7 @@ var import_toolkit2 = require("@reduxjs/toolkit");
|
|
|
1306
1306
|
var import_toolkit = require("@reduxjs/toolkit");
|
|
1307
1307
|
|
|
1308
1308
|
// src/utils/version.ts
|
|
1309
|
-
var VERSION = "3.28.4-pre.
|
|
1309
|
+
var VERSION = "3.28.4-pre.fe2dbcea63";
|
|
1310
1310
|
var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
|
|
1311
1311
|
|
|
1312
1312
|
// src/api/analytics/analytics-selectors.ts
|
|
@@ -468,7 +468,7 @@ var import_bueno8 = require("@coveo/bueno");
|
|
|
468
468
|
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
469
469
|
|
|
470
470
|
// src/utils/version.ts
|
|
471
|
-
var VERSION = "3.28.4-pre.
|
|
471
|
+
var VERSION = "3.28.4-pre.fe2dbcea63";
|
|
472
472
|
var COVEO_FRAMEWORK = ["@coveo/atomic", "@coveo/quantic"];
|
|
473
473
|
|
|
474
474
|
// src/features/configuration/configuration-actions.ts
|
|
@@ -9086,7 +9086,11 @@ var productListingReducer = (0, import_toolkit39.createReducer)(
|
|
|
9086
9086
|
const paginationOffset = getPaginationOffset(action.payload);
|
|
9087
9087
|
handleFullfilled(state, action.payload.response);
|
|
9088
9088
|
state.products = action.payload.response.products.map(
|
|
9089
|
-
(product, index) => preprocessProduct(
|
|
9089
|
+
(product, index) => preprocessProduct(
|
|
9090
|
+
product,
|
|
9091
|
+
paginationOffset + index + 1,
|
|
9092
|
+
action.payload.response.responseId
|
|
9093
|
+
)
|
|
9090
9094
|
);
|
|
9091
9095
|
}).addCase(fetchMoreProducts.fulfilled, (state, action) => {
|
|
9092
9096
|
if (!action.payload) {
|
|
@@ -9096,7 +9100,11 @@ var productListingReducer = (0, import_toolkit39.createReducer)(
|
|
|
9096
9100
|
handleFullfilled(state, action.payload.response);
|
|
9097
9101
|
state.products = state.products.concat(
|
|
9098
9102
|
action.payload.response.products.map(
|
|
9099
|
-
(product, index) => preprocessProduct(
|
|
9103
|
+
(product, index) => preprocessProduct(
|
|
9104
|
+
product,
|
|
9105
|
+
paginationOffset + index + 1,
|
|
9106
|
+
action.payload?.response.responseId
|
|
9107
|
+
)
|
|
9100
9108
|
)
|
|
9101
9109
|
);
|
|
9102
9110
|
}).addCase(fetchProductListing.pending, (state, action) => {
|
|
@@ -9115,13 +9123,15 @@ var productListingReducer = (0, import_toolkit39.createReducer)(
|
|
|
9115
9123
|
if (currentParentIndex === -1 || childToPromote === void 0) {
|
|
9116
9124
|
return;
|
|
9117
9125
|
}
|
|
9126
|
+
const responseId = products[currentParentIndex].responseId;
|
|
9118
9127
|
const position = products[currentParentIndex].position;
|
|
9119
9128
|
const { children, totalNumberOfChildren } = products[currentParentIndex];
|
|
9120
9129
|
const newParent = {
|
|
9121
9130
|
...childToPromote,
|
|
9122
9131
|
children,
|
|
9123
9132
|
totalNumberOfChildren,
|
|
9124
|
-
position
|
|
9133
|
+
position,
|
|
9134
|
+
responseId
|
|
9125
9135
|
};
|
|
9126
9136
|
products.splice(currentParentIndex, 1, newParent);
|
|
9127
9137
|
}).addCase(setView, () => getProductListingInitialState()).addCase(setContext, () => getProductListingInitialState()).addCase(setError, (state, action) => {
|
|
@@ -9147,12 +9157,12 @@ function getPaginationOffset(payload) {
|
|
|
9147
9157
|
const pagination = payload.response.pagination;
|
|
9148
9158
|
return pagination.page * pagination.perPage;
|
|
9149
9159
|
}
|
|
9150
|
-
function preprocessProduct(product, position) {
|
|
9160
|
+
function preprocessProduct(product, position, responseId) {
|
|
9151
9161
|
const isParentAlreadyInChildren = product.children.some(
|
|
9152
9162
|
(child) => child.permanentid === product.permanentid
|
|
9153
9163
|
);
|
|
9154
9164
|
if (product.children.length === 0 || isParentAlreadyInChildren) {
|
|
9155
|
-
return { ...product, position };
|
|
9165
|
+
return { ...product, position, responseId };
|
|
9156
9166
|
}
|
|
9157
9167
|
const {
|
|
9158
9168
|
children,
|
|
@@ -9162,7 +9172,8 @@ function preprocessProduct(product, position) {
|
|
|
9162
9172
|
return {
|
|
9163
9173
|
...product,
|
|
9164
9174
|
children: [restOfProduct, ...children],
|
|
9165
|
-
position
|
|
9175
|
+
position,
|
|
9176
|
+
responseId
|
|
9166
9177
|
};
|
|
9167
9178
|
}
|
|
9168
9179
|
|
|
@@ -12330,7 +12341,7 @@ Review the configuration of the above 'ec_'-prefixed fields in your index, and m
|
|
|
12330
12341
|
productId: props.options.product.ec_product_id ?? props.options.product.permanentid
|
|
12331
12342
|
},
|
|
12332
12343
|
position: props.options.product.position,
|
|
12333
|
-
responseId: props.responseIdSelector(engine[stateKey])
|
|
12344
|
+
responseId: props.options.product.responseId ?? props.responseIdSelector(engine[stateKey])
|
|
12334
12345
|
})
|
|
12335
12346
|
);
|
|
12336
12347
|
};
|
|
@@ -13823,7 +13834,11 @@ var commerceSearchReducer = (0, import_toolkit84.createReducer)(
|
|
|
13823
13834
|
action.payload.queryExecuted
|
|
13824
13835
|
);
|
|
13825
13836
|
state.products = action.payload.response.products.map(
|
|
13826
|
-
(product, index) => preprocessProduct2(
|
|
13837
|
+
(product, index) => preprocessProduct2(
|
|
13838
|
+
product,
|
|
13839
|
+
paginationOffset + index + 1,
|
|
13840
|
+
action.payload.response.responseId
|
|
13841
|
+
)
|
|
13827
13842
|
);
|
|
13828
13843
|
}).addCase(fetchMoreProducts2.fulfilled, (state, action) => {
|
|
13829
13844
|
if (!action.payload) {
|
|
@@ -13837,7 +13852,11 @@ var commerceSearchReducer = (0, import_toolkit84.createReducer)(
|
|
|
13837
13852
|
);
|
|
13838
13853
|
state.products = state.products.concat(
|
|
13839
13854
|
action.payload.response.products.map(
|
|
13840
|
-
(product, index) => preprocessProduct2(
|
|
13855
|
+
(product, index) => preprocessProduct2(
|
|
13856
|
+
product,
|
|
13857
|
+
paginationOffset + index + 1,
|
|
13858
|
+
action.payload?.response.responseId
|
|
13859
|
+
)
|
|
13841
13860
|
)
|
|
13842
13861
|
);
|
|
13843
13862
|
}).addCase(executeSearch3.pending, (state, action) => {
|
|
@@ -13856,13 +13875,15 @@ var commerceSearchReducer = (0, import_toolkit84.createReducer)(
|
|
|
13856
13875
|
if (currentParentIndex === -1 || childToPromote === void 0) {
|
|
13857
13876
|
return;
|
|
13858
13877
|
}
|
|
13878
|
+
const responseId = products[currentParentIndex].responseId;
|
|
13859
13879
|
const position = products[currentParentIndex].position;
|
|
13860
13880
|
const { children, totalNumberOfChildren } = products[currentParentIndex];
|
|
13861
13881
|
const newParent = {
|
|
13862
13882
|
...childToPromote,
|
|
13863
13883
|
children,
|
|
13864
13884
|
totalNumberOfChildren,
|
|
13865
|
-
position
|
|
13885
|
+
position,
|
|
13886
|
+
responseId
|
|
13866
13887
|
};
|
|
13867
13888
|
products.splice(currentParentIndex, 1, newParent);
|
|
13868
13889
|
}).addCase(setView, () => getCommerceSearchInitialState()).addCase(setContext, () => getCommerceSearchInitialState()).addCase(setError, (state, action) => {
|
|
@@ -13890,12 +13911,12 @@ function getPaginationOffset2(payload) {
|
|
|
13890
13911
|
const pagination = payload.response.pagination;
|
|
13891
13912
|
return pagination.page * pagination.perPage;
|
|
13892
13913
|
}
|
|
13893
|
-
function preprocessProduct2(product, position) {
|
|
13914
|
+
function preprocessProduct2(product, position, responseId) {
|
|
13894
13915
|
const isParentAlreadyInChildren = product.children.some(
|
|
13895
13916
|
(child) => child.permanentid === product.permanentid
|
|
13896
13917
|
);
|
|
13897
13918
|
if (product.children.length === 0 || isParentAlreadyInChildren) {
|
|
13898
|
-
return { ...product, position };
|
|
13919
|
+
return { ...product, position, responseId };
|
|
13899
13920
|
}
|
|
13900
13921
|
const {
|
|
13901
13922
|
children,
|
|
@@ -13905,7 +13926,8 @@ function preprocessProduct2(product, position) {
|
|
|
13905
13926
|
return {
|
|
13906
13927
|
...product,
|
|
13907
13928
|
children: [restOfProduct, ...children],
|
|
13908
|
-
position
|
|
13929
|
+
position,
|
|
13930
|
+
responseId
|
|
13909
13931
|
};
|
|
13910
13932
|
}
|
|
13911
13933
|
|
|
@@ -14885,7 +14907,7 @@ var instantProductsReducer = (0, import_toolkit95.createReducer)(
|
|
|
14885
14907
|
state,
|
|
14886
14908
|
{
|
|
14887
14909
|
products: products.map(
|
|
14888
|
-
(product, index) => preprocessProduct3(product, index + 1)
|
|
14910
|
+
(product, index) => preprocessProduct3(product, index + 1, responseId)
|
|
14889
14911
|
)
|
|
14890
14912
|
}
|
|
14891
14913
|
);
|
|
@@ -14907,13 +14929,15 @@ var instantProductsReducer = (0, import_toolkit95.createReducer)(
|
|
|
14907
14929
|
if (currentParentIndex === -1 || childToPromote === void 0) {
|
|
14908
14930
|
return;
|
|
14909
14931
|
}
|
|
14932
|
+
const responseId = products[currentParentIndex].responseId;
|
|
14910
14933
|
const position = products[currentParentIndex].position;
|
|
14911
14934
|
const { children, totalNumberOfChildren } = products[currentParentIndex];
|
|
14912
14935
|
const newParent = {
|
|
14913
14936
|
...childToPromote,
|
|
14914
14937
|
children,
|
|
14915
14938
|
totalNumberOfChildren,
|
|
14916
|
-
position
|
|
14939
|
+
position,
|
|
14940
|
+
responseId
|
|
14917
14941
|
};
|
|
14918
14942
|
const newProducts = [...products];
|
|
14919
14943
|
newProducts.splice(currentParentIndex, 1, newParent);
|
|
@@ -14921,12 +14945,12 @@ var instantProductsReducer = (0, import_toolkit95.createReducer)(
|
|
|
14921
14945
|
});
|
|
14922
14946
|
}
|
|
14923
14947
|
);
|
|
14924
|
-
function preprocessProduct3(product, position) {
|
|
14948
|
+
function preprocessProduct3(product, position, responseId) {
|
|
14925
14949
|
const isParentAlreadyInChildren = product.children.some(
|
|
14926
14950
|
(child) => child.permanentid === product.permanentid
|
|
14927
14951
|
);
|
|
14928
14952
|
if (product.children.length === 0 || isParentAlreadyInChildren) {
|
|
14929
|
-
return { ...product, position };
|
|
14953
|
+
return { ...product, position, responseId };
|
|
14930
14954
|
}
|
|
14931
14955
|
const {
|
|
14932
14956
|
children,
|
|
@@ -14936,7 +14960,8 @@ function preprocessProduct3(product, position) {
|
|
|
14936
14960
|
return {
|
|
14937
14961
|
...product,
|
|
14938
14962
|
children: [restOfProduct, ...children],
|
|
14939
|
-
position
|
|
14963
|
+
position,
|
|
14964
|
+
responseId
|
|
14940
14965
|
};
|
|
14941
14966
|
}
|
|
14942
14967
|
|
|
@@ -15581,7 +15606,11 @@ var recommendationsReducer = (0, import_toolkit104.createReducer)(
|
|
|
15581
15606
|
}
|
|
15582
15607
|
const paginationOffset = getPaginationOffset3(action.payload);
|
|
15583
15608
|
recommendations.products = response.products.map(
|
|
15584
|
-
(product, index) => preprocessProduct4(
|
|
15609
|
+
(product, index) => preprocessProduct4(
|
|
15610
|
+
product,
|
|
15611
|
+
paginationOffset + index + 1,
|
|
15612
|
+
response.responseId
|
|
15613
|
+
)
|
|
15585
15614
|
);
|
|
15586
15615
|
}).addCase(fetchMoreRecommendations.fulfilled, (state, action) => {
|
|
15587
15616
|
if (!action.payload) {
|
|
@@ -15597,7 +15626,11 @@ var recommendationsReducer = (0, import_toolkit104.createReducer)(
|
|
|
15597
15626
|
const paginationOffset = getPaginationOffset3(action.payload);
|
|
15598
15627
|
recommendations.products = recommendations.products.concat(
|
|
15599
15628
|
response.products.map(
|
|
15600
|
-
(product, index) => preprocessProduct4(
|
|
15629
|
+
(product, index) => preprocessProduct4(
|
|
15630
|
+
product,
|
|
15631
|
+
paginationOffset + index + 1,
|
|
15632
|
+
response.responseId
|
|
15633
|
+
)
|
|
15601
15634
|
)
|
|
15602
15635
|
);
|
|
15603
15636
|
}).addCase(fetchRecommendations.pending, (state, action) => {
|
|
@@ -15620,13 +15653,15 @@ var recommendationsReducer = (0, import_toolkit104.createReducer)(
|
|
|
15620
15653
|
if (currentParentIndex === -1 || childToPromote === void 0) {
|
|
15621
15654
|
return;
|
|
15622
15655
|
}
|
|
15656
|
+
const responseId = products[currentParentIndex].responseId;
|
|
15623
15657
|
const position = products[currentParentIndex].position;
|
|
15624
15658
|
const { children, totalNumberOfChildren } = products[currentParentIndex];
|
|
15625
15659
|
const newParent = {
|
|
15626
15660
|
...childToPromote,
|
|
15627
15661
|
children,
|
|
15628
15662
|
totalNumberOfChildren,
|
|
15629
|
-
position
|
|
15663
|
+
position,
|
|
15664
|
+
responseId
|
|
15630
15665
|
};
|
|
15631
15666
|
products.splice(currentParentIndex, 1, newParent);
|
|
15632
15667
|
}).addCase(setError, (state, action) => {
|
|
@@ -15671,12 +15706,12 @@ function getPaginationOffset3(actionPayload) {
|
|
|
15671
15706
|
const pagination = actionPayload.response.pagination;
|
|
15672
15707
|
return pagination.page * pagination.perPage;
|
|
15673
15708
|
}
|
|
15674
|
-
function preprocessProduct4(product, position) {
|
|
15709
|
+
function preprocessProduct4(product, position, responseId) {
|
|
15675
15710
|
const isParentAlreadyInChildren = product.children.some(
|
|
15676
15711
|
(child) => child.permanentid === product.permanentid
|
|
15677
15712
|
);
|
|
15678
15713
|
if (product.children.length === 0 || isParentAlreadyInChildren) {
|
|
15679
|
-
return { ...product, position };
|
|
15714
|
+
return { ...product, position, responseId };
|
|
15680
15715
|
}
|
|
15681
15716
|
const {
|
|
15682
15717
|
children,
|
|
@@ -15686,7 +15721,8 @@ function preprocessProduct4(product, position) {
|
|
|
15686
15721
|
return {
|
|
15687
15722
|
...product,
|
|
15688
15723
|
children: [restOfProduct, ...children],
|
|
15689
|
-
position
|
|
15724
|
+
position,
|
|
15725
|
+
responseId
|
|
15690
15726
|
};
|
|
15691
15727
|
}
|
|
15692
15728
|
|