@sitecore-jss/sitecore-jss-nextjs 21.1.0-canary.3 → 21.1.0-canary.30
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/components/EditingComponentPlaceholder.js +12 -0
- package/dist/cjs/editing/editing-render-middleware.js +9 -1
- package/dist/cjs/index.js +7 -1
- package/dist/cjs/middleware/personalize-middleware.js +6 -3
- package/dist/esm/components/EditingComponentPlaceholder.js +5 -0
- package/dist/esm/editing/editing-render-middleware.js +9 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/middleware/personalize-middleware.js +6 -3
- package/package.json +6 -5
- package/types/components/EditingComponentPlaceholder.d.ts +4 -0
- package/types/index.d.ts +2 -1
- package/types/middleware/personalize-middleware.d.ts +5 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.EditingComponentPlaceholder = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const layout_1 = require("@sitecore-jss/sitecore-jss/layout");
|
|
9
|
+
const Placeholder_1 = require("./Placeholder");
|
|
10
|
+
const EditingComponentPlaceholder = ({ rendering, }) => (react_1.default.createElement("div", { id: layout_1.EDITING_COMPONENT_ID },
|
|
11
|
+
react_1.default.createElement(Placeholder_1.Placeholder, { name: layout_1.EDITING_COMPONENT_PLACEHOLDER, rendering: rendering })));
|
|
12
|
+
exports.EditingComponentPlaceholder = EditingComponentPlaceholder;
|
|
@@ -12,6 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.extractEditingData = exports.EditingRenderMiddleware = void 0;
|
|
13
13
|
const constants_1 = require("next/constants");
|
|
14
14
|
const sitecore_jss_1 = require("@sitecore-jss/sitecore-jss");
|
|
15
|
+
const layout_1 = require("@sitecore-jss/sitecore-jss/layout");
|
|
16
|
+
const node_html_parser_1 = require("node-html-parser");
|
|
15
17
|
const editing_data_service_1 = require("./editing-data-service");
|
|
16
18
|
const utils_1 = require("../utils");
|
|
17
19
|
/**
|
|
@@ -25,7 +27,7 @@ class EditingRenderMiddleware {
|
|
|
25
27
|
constructor(config) {
|
|
26
28
|
var _a, _b, _c, _d;
|
|
27
29
|
this.handler = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
var _e;
|
|
30
|
+
var _e, _f;
|
|
29
31
|
const { method, query, body, headers } = req;
|
|
30
32
|
sitecore_jss_1.debug.editing('editing render middleware start: %o', {
|
|
31
33
|
method,
|
|
@@ -94,6 +96,12 @@ class EditingRenderMiddleware {
|
|
|
94
96
|
// certain route configurations (e.g. multiple catch-all routes).
|
|
95
97
|
// The following line will trick it into thinking we're SSR, thus avoiding any router.replace.
|
|
96
98
|
html = html.replace(constants_1.STATIC_PROPS_ID, constants_1.SERVER_PROPS_ID);
|
|
99
|
+
if (editingData.layoutData.sitecore.context.renderingType === layout_1.RenderingType.Component) {
|
|
100
|
+
// Handle component rendering. Extract component markup only
|
|
101
|
+
html = (_f = node_html_parser_1.parse(html).getElementById(layout_1.EDITING_COMPONENT_ID)) === null || _f === void 0 ? void 0 : _f.innerHTML;
|
|
102
|
+
if (!html)
|
|
103
|
+
throw new Error(`Failed to render component for ${requestUrl}`);
|
|
104
|
+
}
|
|
97
105
|
const body = { html };
|
|
98
106
|
// Return expected JSON result
|
|
99
107
|
sitecore_jss_1.debug.editing('editing render middleware end: %o', { status: 200, body });
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useSitecoreContext = exports.withSitecoreContext = exports.SitecoreContextReactContext = exports.SitecoreContext = exports.VisitorIdentification = exports.File = exports.DateField = exports.Text = exports.Image = exports.NextImage = exports.EditingComponentPlaceholder = exports.Placeholder = exports.RichText = exports.Link = exports.getPublicUrl = exports.handleEditorFastRefresh = exports.useComponentProps = exports.ComponentPropsContext = exports.ComponentPropsReactContext = exports.GraphQLErrorPagesService = exports.GraphQLSitemapXmlService = exports.GraphQLSitemapService = exports.DisconnectedSitemapService = exports.ComponentPropsService = exports.GraphQLRequestClient = exports.GraphQLRobotsService = exports.CdpHelper = exports.normalizePersonalizedRewrite = exports.getPersonalizedRewriteData = exports.getPersonalizedRewrite = exports.personalizeLayout = exports.RestDictionaryService = exports.GraphQLDictionaryService = exports.trackingApi = exports.mediaApi = exports.EDITING_COMPONENT_ID = exports.EDITING_COMPONENT_PLACEHOLDER = exports.RenderingType = exports.getFieldValue = exports.getChildPlaceholder = exports.RestLayoutService = exports.GraphQLLayoutService = exports.LayoutServicePageState = exports.resolveUrl = exports.resetEditorChromes = exports.isEditorActive = exports.enableDebug = exports.NativeDataFetcher = exports.AxiosDataFetcher = exports.constants = void 0;
|
|
4
|
+
exports.withDatasourceCheck = exports.withPlaceholder = exports.withEditorChromes = void 0;
|
|
4
5
|
var sitecore_jss_1 = require("@sitecore-jss/sitecore-jss");
|
|
5
6
|
Object.defineProperty(exports, "constants", { enumerable: true, get: function () { return sitecore_jss_1.constants; } });
|
|
6
7
|
Object.defineProperty(exports, "AxiosDataFetcher", { enumerable: true, get: function () { return sitecore_jss_1.AxiosDataFetcher; } });
|
|
@@ -16,6 +17,9 @@ Object.defineProperty(exports, "GraphQLLayoutService", { enumerable: true, get:
|
|
|
16
17
|
Object.defineProperty(exports, "RestLayoutService", { enumerable: true, get: function () { return layout_1.RestLayoutService; } });
|
|
17
18
|
Object.defineProperty(exports, "getChildPlaceholder", { enumerable: true, get: function () { return layout_1.getChildPlaceholder; } });
|
|
18
19
|
Object.defineProperty(exports, "getFieldValue", { enumerable: true, get: function () { return layout_1.getFieldValue; } });
|
|
20
|
+
Object.defineProperty(exports, "RenderingType", { enumerable: true, get: function () { return layout_1.RenderingType; } });
|
|
21
|
+
Object.defineProperty(exports, "EDITING_COMPONENT_PLACEHOLDER", { enumerable: true, get: function () { return layout_1.EDITING_COMPONENT_PLACEHOLDER; } });
|
|
22
|
+
Object.defineProperty(exports, "EDITING_COMPONENT_ID", { enumerable: true, get: function () { return layout_1.EDITING_COMPONENT_ID; } });
|
|
19
23
|
var media_1 = require("@sitecore-jss/sitecore-jss/media");
|
|
20
24
|
Object.defineProperty(exports, "mediaApi", { enumerable: true, get: function () { return media_1.mediaApi; } });
|
|
21
25
|
var tracking_1 = require("@sitecore-jss/sitecore-jss/tracking");
|
|
@@ -55,6 +59,8 @@ var RichText_1 = require("./components/RichText");
|
|
|
55
59
|
Object.defineProperty(exports, "RichText", { enumerable: true, get: function () { return RichText_1.RichText; } });
|
|
56
60
|
var Placeholder_1 = require("./components/Placeholder");
|
|
57
61
|
Object.defineProperty(exports, "Placeholder", { enumerable: true, get: function () { return Placeholder_1.Placeholder; } });
|
|
62
|
+
var EditingComponentPlaceholder_1 = require("./components/EditingComponentPlaceholder");
|
|
63
|
+
Object.defineProperty(exports, "EditingComponentPlaceholder", { enumerable: true, get: function () { return EditingComponentPlaceholder_1.EditingComponentPlaceholder; } });
|
|
58
64
|
var NextImage_1 = require("./components/NextImage");
|
|
59
65
|
Object.defineProperty(exports, "NextImage", { enumerable: true, get: function () { return NextImage_1.NextImage; } });
|
|
60
66
|
var sitecore_jss_react_1 = require("@sitecore-jss/sitecore-jss-react");
|
|
@@ -38,7 +38,8 @@ class PersonalizeMiddleware {
|
|
|
38
38
|
}
|
|
39
39
|
if (response.redirected || // Don't attempt to personalize a redirect
|
|
40
40
|
this.isPreview(req) || // No need to personalize for preview (layout data is already prepared for preview)
|
|
41
|
-
|
|
41
|
+
this.excludeRoute(pathname) ||
|
|
42
|
+
(this.config.excludeRoute && this.config.excludeRoute(pathname))) {
|
|
42
43
|
sitecore_jss_1.debug.personalize('skipped (%s)', response.redirected ? 'redirected' : this.isPreview(req) ? 'preview' : 'route excluded');
|
|
43
44
|
return response;
|
|
44
45
|
}
|
|
@@ -63,7 +64,8 @@ class PersonalizeMiddleware {
|
|
|
63
64
|
// Execute targeted experience in CDP
|
|
64
65
|
const { ua } = server_1.userAgent(req);
|
|
65
66
|
const params = this.getExperienceParams(req);
|
|
66
|
-
const
|
|
67
|
+
const pointOfSale = this.config.getPointOfSale(language);
|
|
68
|
+
const variantId = yield this.cdpService.executeExperience(personalizeInfo.contentId, browserId, ua, pointOfSale, params);
|
|
67
69
|
if (!variantId) {
|
|
68
70
|
sitecore_jss_1.debug.personalize('skipped (no variant identified)');
|
|
69
71
|
return response;
|
|
@@ -94,10 +96,11 @@ class PersonalizeMiddleware {
|
|
|
94
96
|
// (underlying default 'cross-fetch' is not currently compatible: https://github.com/lquixada/cross-fetch/issues/78)
|
|
95
97
|
this.personalizeService = new personalize_1.GraphQLPersonalizeService(Object.assign(Object.assign({}, config.edgeConfig), { fetch: fetch }));
|
|
96
98
|
// NOTE: same here, we provide NativeDataFetcher for compatibility on Next.js Edge Runtime
|
|
97
|
-
this.cdpService = new personalize_1.CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout }) => {
|
|
99
|
+
this.cdpService = new personalize_1.CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout, headers, }) => {
|
|
98
100
|
const fetcher = new sitecore_jss_1.NativeDataFetcher({
|
|
99
101
|
debugger: sitecore_jss_1.debug.personalize,
|
|
100
102
|
timeout,
|
|
103
|
+
headers,
|
|
101
104
|
});
|
|
102
105
|
return (url, data) => fetcher.fetch(url, data);
|
|
103
106
|
} }));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EDITING_COMPONENT_ID, EDITING_COMPONENT_PLACEHOLDER, } from '@sitecore-jss/sitecore-jss/layout';
|
|
3
|
+
import { Placeholder } from './Placeholder';
|
|
4
|
+
export const EditingComponentPlaceholder = ({ rendering, }) => (React.createElement("div", { id: EDITING_COMPONENT_ID },
|
|
5
|
+
React.createElement(Placeholder, { name: EDITING_COMPONENT_PLACEHOLDER, rendering: rendering })));
|
|
@@ -9,6 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { STATIC_PROPS_ID, SERVER_PROPS_ID } from 'next/constants';
|
|
11
11
|
import { AxiosDataFetcher, debug } from '@sitecore-jss/sitecore-jss';
|
|
12
|
+
import { EDITING_COMPONENT_ID, RenderingType } from '@sitecore-jss/sitecore-jss/layout';
|
|
13
|
+
import { parse } from 'node-html-parser';
|
|
12
14
|
import { editingDataService, QUERY_PARAM_EDITING_SECRET, } from './editing-data-service';
|
|
13
15
|
import { getJssEditingSecret } from '../utils';
|
|
14
16
|
/**
|
|
@@ -22,7 +24,7 @@ export class EditingRenderMiddleware {
|
|
|
22
24
|
constructor(config) {
|
|
23
25
|
var _a, _b, _c, _d;
|
|
24
26
|
this.handler = (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
var _e;
|
|
27
|
+
var _e, _f;
|
|
26
28
|
const { method, query, body, headers } = req;
|
|
27
29
|
debug.editing('editing render middleware start: %o', {
|
|
28
30
|
method,
|
|
@@ -91,6 +93,12 @@ export class EditingRenderMiddleware {
|
|
|
91
93
|
// certain route configurations (e.g. multiple catch-all routes).
|
|
92
94
|
// The following line will trick it into thinking we're SSR, thus avoiding any router.replace.
|
|
93
95
|
html = html.replace(STATIC_PROPS_ID, SERVER_PROPS_ID);
|
|
96
|
+
if (editingData.layoutData.sitecore.context.renderingType === RenderingType.Component) {
|
|
97
|
+
// Handle component rendering. Extract component markup only
|
|
98
|
+
html = (_f = parse(html).getElementById(EDITING_COMPONENT_ID)) === null || _f === void 0 ? void 0 : _f.innerHTML;
|
|
99
|
+
if (!html)
|
|
100
|
+
throw new Error(`Failed to render component for ${requestUrl}`);
|
|
101
|
+
}
|
|
94
102
|
const body = { html };
|
|
95
103
|
// Return expected JSON result
|
|
96
104
|
debug.editing('editing render middleware end: %o', { status: 200, body });
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { constants, AxiosDataFetcher, NativeDataFetcher, enableDebug, } from '@sitecore-jss/sitecore-jss';
|
|
2
2
|
export { isEditorActive, resetEditorChromes, resolveUrl } from '@sitecore-jss/sitecore-jss/utils';
|
|
3
|
-
export { LayoutServicePageState, GraphQLLayoutService, RestLayoutService, getChildPlaceholder, getFieldValue, } from '@sitecore-jss/sitecore-jss/layout';
|
|
3
|
+
export { LayoutServicePageState, GraphQLLayoutService, RestLayoutService, getChildPlaceholder, getFieldValue, RenderingType, EDITING_COMPONENT_PLACEHOLDER, EDITING_COMPONENT_ID, } from '@sitecore-jss/sitecore-jss/layout';
|
|
4
4
|
export { mediaApi } from '@sitecore-jss/sitecore-jss/media';
|
|
5
5
|
export { trackingApi, } from '@sitecore-jss/sitecore-jss/tracking';
|
|
6
6
|
export { GraphQLDictionaryService, RestDictionaryService, } from '@sitecore-jss/sitecore-jss/i18n';
|
|
@@ -16,5 +16,6 @@ export { handleEditorFastRefresh, getPublicUrl } from './utils';
|
|
|
16
16
|
export { Link } from './components/Link';
|
|
17
17
|
export { RichText } from './components/RichText';
|
|
18
18
|
export { Placeholder } from './components/Placeholder';
|
|
19
|
+
export { EditingComponentPlaceholder } from './components/EditingComponentPlaceholder';
|
|
19
20
|
export { NextImage } from './components/NextImage';
|
|
20
21
|
export { Image, Text, DateField, File, VisitorIdentification, SitecoreContext, SitecoreContextReactContext, withSitecoreContext, useSitecoreContext, withEditorChromes, withPlaceholder, withDatasourceCheck, } from '@sitecore-jss/sitecore-jss-react';
|
|
@@ -35,7 +35,8 @@ export class PersonalizeMiddleware {
|
|
|
35
35
|
}
|
|
36
36
|
if (response.redirected || // Don't attempt to personalize a redirect
|
|
37
37
|
this.isPreview(req) || // No need to personalize for preview (layout data is already prepared for preview)
|
|
38
|
-
|
|
38
|
+
this.excludeRoute(pathname) ||
|
|
39
|
+
(this.config.excludeRoute && this.config.excludeRoute(pathname))) {
|
|
39
40
|
debug.personalize('skipped (%s)', response.redirected ? 'redirected' : this.isPreview(req) ? 'preview' : 'route excluded');
|
|
40
41
|
return response;
|
|
41
42
|
}
|
|
@@ -60,7 +61,8 @@ export class PersonalizeMiddleware {
|
|
|
60
61
|
// Execute targeted experience in CDP
|
|
61
62
|
const { ua } = userAgent(req);
|
|
62
63
|
const params = this.getExperienceParams(req);
|
|
63
|
-
const
|
|
64
|
+
const pointOfSale = this.config.getPointOfSale(language);
|
|
65
|
+
const variantId = yield this.cdpService.executeExperience(personalizeInfo.contentId, browserId, ua, pointOfSale, params);
|
|
64
66
|
if (!variantId) {
|
|
65
67
|
debug.personalize('skipped (no variant identified)');
|
|
66
68
|
return response;
|
|
@@ -91,10 +93,11 @@ export class PersonalizeMiddleware {
|
|
|
91
93
|
// (underlying default 'cross-fetch' is not currently compatible: https://github.com/lquixada/cross-fetch/issues/78)
|
|
92
94
|
this.personalizeService = new GraphQLPersonalizeService(Object.assign(Object.assign({}, config.edgeConfig), { fetch: fetch }));
|
|
93
95
|
// NOTE: same here, we provide NativeDataFetcher for compatibility on Next.js Edge Runtime
|
|
94
|
-
this.cdpService = new CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout }) => {
|
|
96
|
+
this.cdpService = new CdpService(Object.assign(Object.assign({}, config.cdpConfig), { dataFetcherResolver: ({ timeout, headers, }) => {
|
|
95
97
|
const fetcher = new NativeDataFetcher({
|
|
96
98
|
debugger: debug.personalize,
|
|
97
99
|
timeout,
|
|
100
|
+
headers,
|
|
98
101
|
});
|
|
99
102
|
return (url, data) => fetcher.fetch(url, data);
|
|
100
103
|
} }));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-jss/sitecore-jss-nextjs",
|
|
3
|
-
"version": "21.1.0-canary.
|
|
3
|
+
"version": "21.1.0-canary.30",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -70,16 +70,17 @@
|
|
|
70
70
|
"react-dom": "^18.1.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@sitecore-jss/sitecore-jss": "^21.1.0-canary.
|
|
74
|
-
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.
|
|
75
|
-
"@sitecore-jss/sitecore-jss-react": "^21.1.0-canary.
|
|
73
|
+
"@sitecore-jss/sitecore-jss": "^21.1.0-canary.30",
|
|
74
|
+
"@sitecore-jss/sitecore-jss-dev-tools": "^21.1.0-canary.30",
|
|
75
|
+
"@sitecore-jss/sitecore-jss-react": "^21.1.0-canary.30",
|
|
76
|
+
"node-html-parser": "^6.0.0",
|
|
76
77
|
"prop-types": "^15.7.2",
|
|
77
78
|
"regex-parser": "^2.2.11",
|
|
78
79
|
"sync-disk-cache": "^2.1.0"
|
|
79
80
|
},
|
|
80
81
|
"description": "",
|
|
81
82
|
"types": "types/index.d.ts",
|
|
82
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "4b9e015c1a62b4f4ac6ca8f6cf891c85f53a116d",
|
|
83
84
|
"files": [
|
|
84
85
|
"dist",
|
|
85
86
|
"types",
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { constants, HttpDataFetcher, HttpResponse, AxiosDataFetcher, AxiosDataFetcherConfig, NativeDataFetcher, NativeDataFetcherConfig, enableDebug, } from '@sitecore-jss/sitecore-jss';
|
|
2
2
|
export { isEditorActive, resetEditorChromes, resolveUrl } from '@sitecore-jss/sitecore-jss/utils';
|
|
3
|
-
export { LayoutService, LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, GraphQLLayoutService, GraphQLLayoutServiceConfig, RestLayoutService, RestLayoutServiceConfig, PlaceholderData, PlaceholdersData, RouteData, Field, Item, HtmlElementRendering, getChildPlaceholder, getFieldValue, ComponentRendering, ComponentFields, ComponentParams, } from '@sitecore-jss/sitecore-jss/layout';
|
|
3
|
+
export { LayoutService, LayoutServiceData, LayoutServicePageState, LayoutServiceContext, LayoutServiceContextData, GraphQLLayoutService, GraphQLLayoutServiceConfig, RestLayoutService, RestLayoutServiceConfig, PlaceholderData, PlaceholdersData, RouteData, Field, Item, HtmlElementRendering, getChildPlaceholder, getFieldValue, ComponentRendering, ComponentFields, ComponentParams, RenderingType, EDITING_COMPONENT_PLACEHOLDER, EDITING_COMPONENT_ID, } from '@sitecore-jss/sitecore-jss/layout';
|
|
4
4
|
export { mediaApi } from '@sitecore-jss/sitecore-jss/media';
|
|
5
5
|
export { trackingApi, TrackingRequestOptions, CampaignInstance, GoalInstance, OutcomeInstance, EventInstance, PageViewInstance, } from '@sitecore-jss/sitecore-jss/tracking';
|
|
6
6
|
export { DictionaryPhrases, DictionaryService, GraphQLDictionaryService, GraphQLDictionaryServiceConfig, RestDictionaryService, RestDictionaryServiceConfig, } from '@sitecore-jss/sitecore-jss/i18n';
|
|
@@ -19,5 +19,6 @@ export { handleEditorFastRefresh, getPublicUrl } from './utils';
|
|
|
19
19
|
export { Link, LinkProps } from './components/Link';
|
|
20
20
|
export { RichText, RichTextProps } from './components/RichText';
|
|
21
21
|
export { Placeholder } from './components/Placeholder';
|
|
22
|
+
export { EditingComponentPlaceholder } from './components/EditingComponentPlaceholder';
|
|
22
23
|
export { NextImage } from './components/NextImage';
|
|
23
24
|
export { ComponentFactory, Image, ImageField, ImageFieldValue, ImageProps, LinkField, LinkFieldValue, Text, TextField, DateField, File, FileField, RichTextField, VisitorIdentification, PlaceholderComponentProps, SitecoreContext, SitecoreContextState, SitecoreContextValue, SitecoreContextReactContext, withSitecoreContext, useSitecoreContext, withEditorChromes, withPlaceholder, withDatasourceCheck, ImageSizeParameters, ComponentConsumerProps, WithSitecoreContextOptions, WithSitecoreContextProps, } from '@sitecore-jss/sitecore-jss-react';
|
|
@@ -17,6 +17,11 @@ export declare type PersonalizeMiddlewareConfig = {
|
|
|
17
17
|
* Configuration for your Sitecore CDP endpoint
|
|
18
18
|
*/
|
|
19
19
|
cdpConfig: Omit<CdpServiceConfig, 'dataFetcherResolver'>;
|
|
20
|
+
/**
|
|
21
|
+
* function used to resolve correct point of sale for current locale during a request
|
|
22
|
+
* @param {string} locale locale at the time of request
|
|
23
|
+
*/
|
|
24
|
+
getPointOfSale: (locale: string) => string;
|
|
20
25
|
/**
|
|
21
26
|
* function, determines if middleware should be turned off, based on cookie, header, or other considerations
|
|
22
27
|
* @param {NextRequest} [req] optional: request object from middleware handler
|