@sitecore-content-sdk/nextjs 2.1.0-canary.14 → 2.1.0-canary.15
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/client/sitecore-nextjs-client.js +13 -110
- package/dist/cjs/editing/editing-render-middleware.js +1 -1
- package/dist/cjs/editing/utils.js +5 -2
- package/dist/cjs/proxy/index.js +3 -1
- package/dist/cjs/proxy/preview-proxy.js +67 -0
- package/dist/cjs/proxy/proxy.js +7 -1
- package/dist/esm/client/sitecore-nextjs-client.js +13 -110
- package/dist/esm/editing/editing-render-middleware.js +1 -1
- package/dist/esm/editing/utils.js +5 -2
- package/dist/esm/proxy/index.js +1 -0
- package/dist/esm/proxy/preview-proxy.js +60 -0
- package/dist/esm/proxy/proxy.js +7 -1
- package/package.json +8 -8
- package/types/client/sitecore-nextjs-client.d.ts +6 -65
- package/types/client/sitecore-nextjs-client.d.ts.map +1 -1
- package/types/editing/editing-render-middleware.d.ts.map +1 -1
- package/types/editing/utils.d.ts.map +1 -1
- package/types/proxy/index.d.ts +1 -0
- package/types/proxy/index.d.ts.map +1 -1
- package/types/proxy/preview-proxy.d.ts +21 -0
- package/types/proxy/preview-proxy.d.ts.map +1 -0
- package/types/proxy/proxy.d.ts.map +1 -1
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.SitecoreNextjsClient = void 0;
|
|
15
4
|
const client_1 = require("@sitecore-content-sdk/content/client");
|
|
16
5
|
const component_props_service_1 = require("../services/component-props-service");
|
|
17
|
-
const constants_1 = require("../editing/constants");
|
|
18
6
|
const site_1 = require("@sitecore-content-sdk/content/site");
|
|
19
7
|
const personalize_1 = require("@sitecore-content-sdk/content/personalize");
|
|
8
|
+
const constants_1 = require("../editing/constants");
|
|
20
9
|
/**
|
|
21
10
|
* The SitecoreNextjsClient class extends the SitecoreClient class to provide additional functionality for Next.js.
|
|
22
11
|
* @public
|
|
@@ -66,8 +55,7 @@ class SitecoreNextjsClient extends client_1.SitecoreClient {
|
|
|
66
55
|
* @returns {Page} preview page for Design Library
|
|
67
56
|
*/
|
|
68
57
|
async getDesignLibraryData(designLibData, fetchOptions) {
|
|
69
|
-
|
|
70
|
-
return super.getDesignLibraryData(merged.previewData, merged.fetchOptions);
|
|
58
|
+
return super.getDesignLibraryData(designLibData, fetchOptions);
|
|
71
59
|
}
|
|
72
60
|
/**
|
|
73
61
|
* Retrieves preview page and layout details
|
|
@@ -75,31 +63,7 @@ class SitecoreNextjsClient extends client_1.SitecoreClient {
|
|
|
75
63
|
* @param {FetchOptions} [fetchOptions] Additional fetch fetch options to override GraphQL requests (like retries and fetch)
|
|
76
64
|
*/
|
|
77
65
|
async getPreview(previewData, fetchOptions) {
|
|
78
|
-
|
|
79
|
-
return super.getPreview(merged.previewData, merged.fetchOptions);
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* **NOTE**: App Router only.
|
|
83
|
-
*
|
|
84
|
-
* Builds the inputs for the Preview mode based on incoming request headers.
|
|
85
|
-
*
|
|
86
|
-
* - Reads editing preview data from the `x-sitecore-editing-params` header.
|
|
87
|
-
* - Reads the `authorization` header from the request and merges it as
|
|
88
|
-
* `Authorization` into `fetchOptions.headers`. The request value takes
|
|
89
|
-
* precedence over any `Authorization` (case-insensitive) supplied via
|
|
90
|
-
* `extra.headers`; existing case-variant keys are removed so the result
|
|
91
|
-
* never contains duplicates. An empty `Authorization` is never emitted.
|
|
92
|
-
*
|
|
93
|
-
* Other headers present on the input are ignored. Non-`headers` fields of
|
|
94
|
-
* `extra` are preserved as-is. Extra headers are merged into `fetchOptions.headers`.
|
|
95
|
-
* @param {Headers} headers - The headers from the incoming request.
|
|
96
|
-
* @param {FetchOptions} [extra] - Optional base fetch options to merge with.
|
|
97
|
-
* @returns The `previewData` and `fetchOptions` to forward
|
|
98
|
-
*/
|
|
99
|
-
getPreviewInputs(headers, extra) {
|
|
100
|
-
const previewData = this.parsePreviewDataFromHeader(headers);
|
|
101
|
-
const fetchOptions = this.mergeAuthorizationHeader(headers, extra);
|
|
102
|
-
return { previewData, fetchOptions };
|
|
66
|
+
return super.getPreview(previewData, fetchOptions);
|
|
103
67
|
}
|
|
104
68
|
/**
|
|
105
69
|
* Generates static params for the Next.js App Router from Sitecore routes.
|
|
@@ -179,87 +143,26 @@ class SitecoreNextjsClient extends client_1.SitecoreClient {
|
|
|
179
143
|
}
|
|
180
144
|
return componentProps;
|
|
181
145
|
}
|
|
182
|
-
getComponentPropsService() {
|
|
183
|
-
return new component_props_service_1.ComponentPropsService();
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* **NOTE**: Pages Router only.
|
|
187
|
-
*
|
|
188
|
-
* Merges the authorization header from the preview data into the fetch options.
|
|
189
|
-
* The `authorization` field is always stripped from the returned preview data
|
|
190
|
-
* to avoid leaking it back into request payloads.
|
|
191
|
-
*
|
|
192
|
-
* The value stashed in preview data takes precedence over any caller-supplied
|
|
193
|
-
* `Authorization` header. Existing `Authorization` keys are removed
|
|
194
|
-
* case-insensitively before the merged value is set, so the result never
|
|
195
|
-
* contains duplicate keys.
|
|
196
|
-
* @param {PreviewData} previewData - The preview data to merge the authorization header from.
|
|
197
|
-
* @param {FetchOptions} [fetchOptions] - The fetch options to merge the authorization header into.
|
|
198
|
-
* @returns The preview data and fetch options with the authorization header merged.
|
|
199
|
-
*/
|
|
200
|
-
mergePreviewAuthorization(previewData, fetchOptions) {
|
|
201
|
-
if (!previewData || typeof previewData !== 'object') {
|
|
202
|
-
return { previewData: previewData, fetchOptions };
|
|
203
|
-
}
|
|
204
|
-
const _a = previewData, { authorization } = _a, rest = __rest(_a, ["authorization"]);
|
|
205
|
-
if (!authorization) {
|
|
206
|
-
return { previewData: rest, fetchOptions };
|
|
207
|
-
}
|
|
208
|
-
const mergedHeaders = this.applyAuthorizationHeader(fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.headers, authorization);
|
|
209
|
-
return { previewData: rest, fetchOptions: Object.assign(Object.assign({}, fetchOptions), { headers: mergedHeaders }) };
|
|
210
|
-
}
|
|
211
146
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* @
|
|
216
|
-
* @returns {PreviewData} The parsed preview data, or an empty object.
|
|
147
|
+
* **NOTE**: App Router only.
|
|
148
|
+
* Retrieves preview data from the request headers
|
|
149
|
+
* @param {Headers} headers - The headers from the incoming request.
|
|
150
|
+
* @returns {PreviewData} The preview data.
|
|
217
151
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
152
|
+
getPreviewData(headers) {
|
|
153
|
+
var _a;
|
|
154
|
+
const packed = (_a = headers.get(constants_1.EDITING_PARAMS_HEADER)) !== null && _a !== void 0 ? _a : '';
|
|
220
155
|
if (!packed)
|
|
221
156
|
return {};
|
|
222
157
|
try {
|
|
223
158
|
return JSON.parse(packed);
|
|
224
159
|
}
|
|
225
|
-
catch (
|
|
160
|
+
catch (_b) {
|
|
226
161
|
return {};
|
|
227
162
|
}
|
|
228
163
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
* incoming request headers into `extra`. The request value takes precedence
|
|
232
|
-
* over any caller-supplied `Authorization` header (case-insensitive). An
|
|
233
|
-
* empty `Authorization` is never emitted.
|
|
234
|
-
* @param {Headers} headers - The incoming request headers.
|
|
235
|
-
* @param {FetchOptions} [extra] - Optional base fetch options to merge with.
|
|
236
|
-
* @returns {FetchOptions} The merged fetch options.
|
|
237
|
-
*/
|
|
238
|
-
mergeAuthorizationHeader(headers, extra) {
|
|
239
|
-
const authorization = headers.get('authorization');
|
|
240
|
-
const mergedHeaders = this.applyAuthorizationHeader(extra === null || extra === void 0 ? void 0 : extra.headers, authorization);
|
|
241
|
-
return Object.assign(Object.assign({}, extra), { headers: mergedHeaders });
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* Returns a shallow-cloned headers record with `Authorization` set to
|
|
245
|
-
* `authorization` (when truthy). Any pre-existing `Authorization` key is
|
|
246
|
-
* removed case-insensitively to avoid emitting both `authorization` and
|
|
247
|
-
* `Authorization` in the same record.
|
|
248
|
-
* @param {Record<string, string> | undefined} headers - Existing headers, if any.
|
|
249
|
-
* @param {string | null | undefined} authorization - The authorization value to apply, or null/undefined to leave headers unchanged.
|
|
250
|
-
* @returns {Record<string, string>} The merged headers.
|
|
251
|
-
*/
|
|
252
|
-
applyAuthorizationHeader(headers, authorization) {
|
|
253
|
-
const merged = Object.assign({}, (headers !== null && headers !== void 0 ? headers : {}));
|
|
254
|
-
if (!authorization)
|
|
255
|
-
return merged;
|
|
256
|
-
for (const key of Object.keys(merged)) {
|
|
257
|
-
if (key.toLowerCase() === 'authorization') {
|
|
258
|
-
delete merged[key];
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
merged.Authorization = authorization;
|
|
262
|
-
return merged;
|
|
164
|
+
getComponentPropsService() {
|
|
165
|
+
return new component_props_service_1.ComponentPropsService();
|
|
263
166
|
}
|
|
264
167
|
}
|
|
265
168
|
exports.SitecoreNextjsClient = SitecoreNextjsClient;
|
|
@@ -87,7 +87,7 @@ class EditingRenderMiddleware extends render_middleware_1.RenderMiddlewareBase {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
const previewDataParams = (0, utils_2.mapEditingParams)(query);
|
|
90
|
-
res.setPreviewData(Object.assign(Object.assign(Object.assign({}, previewDataParams), allowedQueryParams), { variantIds: (_c = previewDataParams.variantIds) === null || _c === void 0 ? void 0 : _c.split(',')
|
|
90
|
+
res.setPreviewData(Object.assign(Object.assign(Object.assign({}, previewDataParams), allowedQueryParams), { variantIds: (_c = previewDataParams.variantIds) === null || _c === void 0 ? void 0 : _c.split(',') }), {
|
|
91
91
|
maxAge: 3,
|
|
92
92
|
});
|
|
93
93
|
// Set Preview mode identifier cookie, if the page is rendered in Sitecore Preview mode
|
|
@@ -183,6 +183,7 @@ exports.getHeadersForPropagation = getHeadersForPropagation;
|
|
|
183
183
|
* @returns {string} HTML with editing markup
|
|
184
184
|
*/
|
|
185
185
|
const getEditingRequestHtml = async (requestUrl, propagatedQsParams, propagatedHeaders, cookies, dataFetcher) => {
|
|
186
|
+
var _a;
|
|
186
187
|
// Grab the Next.js preview cookies to send on to the render request
|
|
187
188
|
propagatedHeaders.cookie = `${propagatedHeaders.cookie ? propagatedHeaders.cookie + ';' : ''}${cookies.join(';')}`;
|
|
188
189
|
// enable content sdk preview
|
|
@@ -201,12 +202,14 @@ const getEditingRequestHtml = async (requestUrl, propagatedQsParams, propagatedH
|
|
|
201
202
|
.catch((err) => {
|
|
202
203
|
// We need to handle not found error provided by Vercel
|
|
203
204
|
// for `fallback: false` pages
|
|
204
|
-
|
|
205
|
+
// Or preview content is not found or access is denied
|
|
206
|
+
if (err.response.status === 404 || err.response.status === 403) {
|
|
205
207
|
return err.response;
|
|
206
208
|
}
|
|
207
209
|
throw err;
|
|
208
210
|
});
|
|
209
|
-
|
|
211
|
+
// pageRes.data.html can be passed by middleware
|
|
212
|
+
let html = typeof pageRes.data === 'string' ? pageRes.data : ((_a = pageRes.data) === null || _a === void 0 ? void 0 : _a.html) || '';
|
|
210
213
|
if (!html || html.length === 0) {
|
|
211
214
|
throw new Error(`Failed to render html for ${requestUrl.toString()}`);
|
|
212
215
|
}
|
package/dist/cjs/proxy/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.debug = exports.REDIRECT_TYPE_SERVER_TRANSFER = exports.REDIRECT_TYPE_302 = exports.REDIRECT_TYPE_301 = exports.RedirectsService = exports.BotTrackingProxy = exports.PersonalizeService = exports.LocaleProxy = exports.AppRouterMultisiteProxy = exports.MultisiteProxy = exports.PersonalizeProxy = exports.RedirectsProxy = exports.defineProxy = exports.ProxyHandler = exports.ProxyBase = void 0;
|
|
6
|
+
exports.debug = exports.REDIRECT_TYPE_SERVER_TRANSFER = exports.REDIRECT_TYPE_302 = exports.REDIRECT_TYPE_301 = exports.RedirectsService = exports.PreviewProxy = exports.BotTrackingProxy = exports.PersonalizeService = exports.LocaleProxy = exports.AppRouterMultisiteProxy = exports.MultisiteProxy = exports.PersonalizeProxy = exports.RedirectsProxy = exports.defineProxy = exports.ProxyHandler = exports.ProxyBase = void 0;
|
|
7
7
|
var proxy_1 = require("./proxy");
|
|
8
8
|
Object.defineProperty(exports, "ProxyBase", { enumerable: true, get: function () { return proxy_1.ProxyBase; } });
|
|
9
9
|
Object.defineProperty(exports, "ProxyHandler", { enumerable: true, get: function () { return proxy_1.ProxyHandler; } });
|
|
@@ -22,6 +22,8 @@ var personalize_1 = require("@sitecore-content-sdk/content/personalize");
|
|
|
22
22
|
Object.defineProperty(exports, "PersonalizeService", { enumerable: true, get: function () { return personalize_1.PersonalizeService; } });
|
|
23
23
|
var bot_tracking_proxy_1 = require("./bot-tracking-proxy");
|
|
24
24
|
Object.defineProperty(exports, "BotTrackingProxy", { enumerable: true, get: function () { return bot_tracking_proxy_1.BotTrackingProxy; } });
|
|
25
|
+
var preview_proxy_1 = require("./preview-proxy");
|
|
26
|
+
Object.defineProperty(exports, "PreviewProxy", { enumerable: true, get: function () { return preview_proxy_1.PreviewProxy; } });
|
|
25
27
|
var site_1 = require("@sitecore-content-sdk/content/site");
|
|
26
28
|
Object.defineProperty(exports, "RedirectsService", { enumerable: true, get: function () { return site_1.RedirectsService; } });
|
|
27
29
|
Object.defineProperty(exports, "REDIRECT_TYPE_301", { enumerable: true, get: function () { return site_1.REDIRECT_TYPE_301; } });
|
|
@@ -0,0 +1,67 @@
|
|
|
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.PreviewProxy = void 0;
|
|
7
|
+
const server_1 = require("next/server");
|
|
8
|
+
const proxy_1 = require("./proxy");
|
|
9
|
+
const constants_1 = require("../editing/constants");
|
|
10
|
+
const site_1 = require("@sitecore-content-sdk/content/site");
|
|
11
|
+
const debug_1 = __importDefault(require("../debug"));
|
|
12
|
+
/**
|
|
13
|
+
* Proxy for preview requests. Acts as a gateway for preview requests.
|
|
14
|
+
* Currently it only supports internal editing hosts deployed on Sitecore AI.
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
class PreviewProxy extends proxy_1.ProxyBase {
|
|
18
|
+
constructor(config) {
|
|
19
|
+
// PreviewProxy does not need site resolution
|
|
20
|
+
super(Object.assign(Object.assign({}, config), { sites: [] }));
|
|
21
|
+
this.handle = async (req, res) => {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
// Run only in internal editing host
|
|
24
|
+
if (!process.env.SITECORE) {
|
|
25
|
+
return res;
|
|
26
|
+
}
|
|
27
|
+
const previewParams = req.headers.get(constants_1.EDITING_PARAMS_HEADER);
|
|
28
|
+
const authHeader = (_a = req.headers.get('Authorization')) !== null && _a !== void 0 ? _a : '';
|
|
29
|
+
let editingOptions = previewParams ? JSON.parse(previewParams) : null;
|
|
30
|
+
debug_1.default.editing('preview proxy start');
|
|
31
|
+
// Process only preview requests (e.g. non editing or design studio)
|
|
32
|
+
if (editingOptions && editingOptions.mode !== 'preview') {
|
|
33
|
+
debug_1.default.editing('preview proxy skipped (mode is not preview)');
|
|
34
|
+
return res;
|
|
35
|
+
}
|
|
36
|
+
let pageData = null;
|
|
37
|
+
// Scenario when the request is coming from /api/editing/render endpoint
|
|
38
|
+
if (editingOptions) {
|
|
39
|
+
pageData = await this.client.getPreview(editingOptions, {
|
|
40
|
+
headers: {
|
|
41
|
+
Authorization: authHeader,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
// Scenario when the page is requested using direct path or navigation is performed
|
|
47
|
+
pageData = await this.client.getPage(req.nextUrl.pathname, {
|
|
48
|
+
site: (_b = req.cookies.get(site_1.SITE_KEY)) === null || _b === void 0 ? void 0 : _b.value,
|
|
49
|
+
locale: this.getLanguage(req),
|
|
50
|
+
}, {
|
|
51
|
+
headers: {
|
|
52
|
+
Authorization: authHeader,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// Preview content is not found or access is denied
|
|
57
|
+
if (!pageData) {
|
|
58
|
+
debug_1.default.editing('preview content is not found or access is denied');
|
|
59
|
+
return server_1.NextResponse.json({ html: 'Preview content is not found or access is denied' }, { status: 403 });
|
|
60
|
+
}
|
|
61
|
+
debug_1.default.editing('preview proxy end');
|
|
62
|
+
return res;
|
|
63
|
+
};
|
|
64
|
+
this.client = config.client;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.PreviewProxy = PreviewProxy;
|
package/dist/cjs/proxy/proxy.js
CHANGED
|
@@ -210,7 +210,13 @@ const defineProxy = (...proxies) => {
|
|
|
210
210
|
const response = res || server_1.NextResponse.next();
|
|
211
211
|
debug_1.default.common('proxy start');
|
|
212
212
|
const start = Date.now();
|
|
213
|
-
const proxyResponse = await proxies.reduce((p, proxy) => p.then((res) =>
|
|
213
|
+
const proxyResponse = await proxies.reduce((p, proxy) => p.then((res) => {
|
|
214
|
+
// Short-circuit the remaining proxies once a previous one
|
|
215
|
+
// denied the request (e.g. PreviewProxy returning 403).
|
|
216
|
+
if (res.status === 403)
|
|
217
|
+
return res;
|
|
218
|
+
return proxy.handle(req, res);
|
|
219
|
+
}), Promise.resolve(response));
|
|
214
220
|
debug_1.default.common('proxy end in %dms', Date.now() - start);
|
|
215
221
|
return proxyResponse;
|
|
216
222
|
},
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { SitecoreClient, } from '@sitecore-content-sdk/content/client';
|
|
13
2
|
import { ComponentPropsService } from '../services/component-props-service';
|
|
14
|
-
import { EDITING_PARAMS_HEADER } from '../editing/constants';
|
|
15
3
|
import { getSiteRewriteData, normalizeSiteRewrite } from '@sitecore-content-sdk/content/site';
|
|
16
4
|
import { getPersonalizedRewriteData, normalizePersonalizedRewrite, } from '@sitecore-content-sdk/content/personalize';
|
|
5
|
+
import { EDITING_PARAMS_HEADER } from '../editing/constants';
|
|
17
6
|
/**
|
|
18
7
|
* The SitecoreNextjsClient class extends the SitecoreClient class to provide additional functionality for Next.js.
|
|
19
8
|
* @public
|
|
@@ -63,8 +52,7 @@ export class SitecoreNextjsClient extends SitecoreClient {
|
|
|
63
52
|
* @returns {Page} preview page for Design Library
|
|
64
53
|
*/
|
|
65
54
|
async getDesignLibraryData(designLibData, fetchOptions) {
|
|
66
|
-
|
|
67
|
-
return super.getDesignLibraryData(merged.previewData, merged.fetchOptions);
|
|
55
|
+
return super.getDesignLibraryData(designLibData, fetchOptions);
|
|
68
56
|
}
|
|
69
57
|
/**
|
|
70
58
|
* Retrieves preview page and layout details
|
|
@@ -72,31 +60,7 @@ export class SitecoreNextjsClient extends SitecoreClient {
|
|
|
72
60
|
* @param {FetchOptions} [fetchOptions] Additional fetch fetch options to override GraphQL requests (like retries and fetch)
|
|
73
61
|
*/
|
|
74
62
|
async getPreview(previewData, fetchOptions) {
|
|
75
|
-
|
|
76
|
-
return super.getPreview(merged.previewData, merged.fetchOptions);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* **NOTE**: App Router only.
|
|
80
|
-
*
|
|
81
|
-
* Builds the inputs for the Preview mode based on incoming request headers.
|
|
82
|
-
*
|
|
83
|
-
* - Reads editing preview data from the `x-sitecore-editing-params` header.
|
|
84
|
-
* - Reads the `authorization` header from the request and merges it as
|
|
85
|
-
* `Authorization` into `fetchOptions.headers`. The request value takes
|
|
86
|
-
* precedence over any `Authorization` (case-insensitive) supplied via
|
|
87
|
-
* `extra.headers`; existing case-variant keys are removed so the result
|
|
88
|
-
* never contains duplicates. An empty `Authorization` is never emitted.
|
|
89
|
-
*
|
|
90
|
-
* Other headers present on the input are ignored. Non-`headers` fields of
|
|
91
|
-
* `extra` are preserved as-is. Extra headers are merged into `fetchOptions.headers`.
|
|
92
|
-
* @param {Headers} headers - The headers from the incoming request.
|
|
93
|
-
* @param {FetchOptions} [extra] - Optional base fetch options to merge with.
|
|
94
|
-
* @returns The `previewData` and `fetchOptions` to forward
|
|
95
|
-
*/
|
|
96
|
-
getPreviewInputs(headers, extra) {
|
|
97
|
-
const previewData = this.parsePreviewDataFromHeader(headers);
|
|
98
|
-
const fetchOptions = this.mergeAuthorizationHeader(headers, extra);
|
|
99
|
-
return { previewData, fetchOptions };
|
|
63
|
+
return super.getPreview(previewData, fetchOptions);
|
|
100
64
|
}
|
|
101
65
|
/**
|
|
102
66
|
* Generates static params for the Next.js App Router from Sitecore routes.
|
|
@@ -176,86 +140,25 @@ export class SitecoreNextjsClient extends SitecoreClient {
|
|
|
176
140
|
}
|
|
177
141
|
return componentProps;
|
|
178
142
|
}
|
|
179
|
-
getComponentPropsService() {
|
|
180
|
-
return new ComponentPropsService();
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* **NOTE**: Pages Router only.
|
|
184
|
-
*
|
|
185
|
-
* Merges the authorization header from the preview data into the fetch options.
|
|
186
|
-
* The `authorization` field is always stripped from the returned preview data
|
|
187
|
-
* to avoid leaking it back into request payloads.
|
|
188
|
-
*
|
|
189
|
-
* The value stashed in preview data takes precedence over any caller-supplied
|
|
190
|
-
* `Authorization` header. Existing `Authorization` keys are removed
|
|
191
|
-
* case-insensitively before the merged value is set, so the result never
|
|
192
|
-
* contains duplicate keys.
|
|
193
|
-
* @param {PreviewData} previewData - The preview data to merge the authorization header from.
|
|
194
|
-
* @param {FetchOptions} [fetchOptions] - The fetch options to merge the authorization header into.
|
|
195
|
-
* @returns The preview data and fetch options with the authorization header merged.
|
|
196
|
-
*/
|
|
197
|
-
mergePreviewAuthorization(previewData, fetchOptions) {
|
|
198
|
-
if (!previewData || typeof previewData !== 'object') {
|
|
199
|
-
return { previewData: previewData, fetchOptions };
|
|
200
|
-
}
|
|
201
|
-
const _a = previewData, { authorization } = _a, rest = __rest(_a, ["authorization"]);
|
|
202
|
-
if (!authorization) {
|
|
203
|
-
return { previewData: rest, fetchOptions };
|
|
204
|
-
}
|
|
205
|
-
const mergedHeaders = this.applyAuthorizationHeader(fetchOptions === null || fetchOptions === void 0 ? void 0 : fetchOptions.headers, authorization);
|
|
206
|
-
return { previewData: rest, fetchOptions: Object.assign(Object.assign({}, fetchOptions), { headers: mergedHeaders }) };
|
|
207
|
-
}
|
|
208
143
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
* @
|
|
213
|
-
* @returns {PreviewData} The parsed preview data, or an empty object.
|
|
144
|
+
* **NOTE**: App Router only.
|
|
145
|
+
* Retrieves preview data from the request headers
|
|
146
|
+
* @param {Headers} headers - The headers from the incoming request.
|
|
147
|
+
* @returns {PreviewData} The preview data.
|
|
214
148
|
*/
|
|
215
|
-
|
|
216
|
-
|
|
149
|
+
getPreviewData(headers) {
|
|
150
|
+
var _a;
|
|
151
|
+
const packed = (_a = headers.get(EDITING_PARAMS_HEADER)) !== null && _a !== void 0 ? _a : '';
|
|
217
152
|
if (!packed)
|
|
218
153
|
return {};
|
|
219
154
|
try {
|
|
220
155
|
return JSON.parse(packed);
|
|
221
156
|
}
|
|
222
|
-
catch (
|
|
157
|
+
catch (_b) {
|
|
223
158
|
return {};
|
|
224
159
|
}
|
|
225
160
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
* incoming request headers into `extra`. The request value takes precedence
|
|
229
|
-
* over any caller-supplied `Authorization` header (case-insensitive). An
|
|
230
|
-
* empty `Authorization` is never emitted.
|
|
231
|
-
* @param {Headers} headers - The incoming request headers.
|
|
232
|
-
* @param {FetchOptions} [extra] - Optional base fetch options to merge with.
|
|
233
|
-
* @returns {FetchOptions} The merged fetch options.
|
|
234
|
-
*/
|
|
235
|
-
mergeAuthorizationHeader(headers, extra) {
|
|
236
|
-
const authorization = headers.get('authorization');
|
|
237
|
-
const mergedHeaders = this.applyAuthorizationHeader(extra === null || extra === void 0 ? void 0 : extra.headers, authorization);
|
|
238
|
-
return Object.assign(Object.assign({}, extra), { headers: mergedHeaders });
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Returns a shallow-cloned headers record with `Authorization` set to
|
|
242
|
-
* `authorization` (when truthy). Any pre-existing `Authorization` key is
|
|
243
|
-
* removed case-insensitively to avoid emitting both `authorization` and
|
|
244
|
-
* `Authorization` in the same record.
|
|
245
|
-
* @param {Record<string, string> | undefined} headers - Existing headers, if any.
|
|
246
|
-
* @param {string | null | undefined} authorization - The authorization value to apply, or null/undefined to leave headers unchanged.
|
|
247
|
-
* @returns {Record<string, string>} The merged headers.
|
|
248
|
-
*/
|
|
249
|
-
applyAuthorizationHeader(headers, authorization) {
|
|
250
|
-
const merged = Object.assign({}, (headers !== null && headers !== void 0 ? headers : {}));
|
|
251
|
-
if (!authorization)
|
|
252
|
-
return merged;
|
|
253
|
-
for (const key of Object.keys(merged)) {
|
|
254
|
-
if (key.toLowerCase() === 'authorization') {
|
|
255
|
-
delete merged[key];
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
merged.Authorization = authorization;
|
|
259
|
-
return merged;
|
|
161
|
+
getComponentPropsService() {
|
|
162
|
+
return new ComponentPropsService();
|
|
260
163
|
}
|
|
261
164
|
}
|
|
@@ -81,7 +81,7 @@ export class EditingRenderMiddleware extends RenderMiddlewareBase {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
const previewDataParams = mapEditingParams(query);
|
|
84
|
-
res.setPreviewData(Object.assign(Object.assign(Object.assign({}, previewDataParams), allowedQueryParams), { variantIds: (_c = previewDataParams.variantIds) === null || _c === void 0 ? void 0 : _c.split(',')
|
|
84
|
+
res.setPreviewData(Object.assign(Object.assign(Object.assign({}, previewDataParams), allowedQueryParams), { variantIds: (_c = previewDataParams.variantIds) === null || _c === void 0 ? void 0 : _c.split(',') }), {
|
|
85
85
|
maxAge: 3,
|
|
86
86
|
});
|
|
87
87
|
// Set Preview mode identifier cookie, if the page is rendered in Sitecore Preview mode
|
|
@@ -172,6 +172,7 @@ export const getHeadersForPropagation = (headers) => {
|
|
|
172
172
|
* @returns {string} HTML with editing markup
|
|
173
173
|
*/
|
|
174
174
|
export const getEditingRequestHtml = async (requestUrl, propagatedQsParams, propagatedHeaders, cookies, dataFetcher) => {
|
|
175
|
+
var _a;
|
|
175
176
|
// Grab the Next.js preview cookies to send on to the render request
|
|
176
177
|
propagatedHeaders.cookie = `${propagatedHeaders.cookie ? propagatedHeaders.cookie + ';' : ''}${cookies.join(';')}`;
|
|
177
178
|
// enable content sdk preview
|
|
@@ -190,12 +191,14 @@ export const getEditingRequestHtml = async (requestUrl, propagatedQsParams, prop
|
|
|
190
191
|
.catch((err) => {
|
|
191
192
|
// We need to handle not found error provided by Vercel
|
|
192
193
|
// for `fallback: false` pages
|
|
193
|
-
|
|
194
|
+
// Or preview content is not found or access is denied
|
|
195
|
+
if (err.response.status === 404 || err.response.status === 403) {
|
|
194
196
|
return err.response;
|
|
195
197
|
}
|
|
196
198
|
throw err;
|
|
197
199
|
});
|
|
198
|
-
|
|
200
|
+
// pageRes.data.html can be passed by middleware
|
|
201
|
+
let html = typeof pageRes.data === 'string' ? pageRes.data : ((_a = pageRes.data) === null || _a === void 0 ? void 0 : _a.html) || '';
|
|
199
202
|
if (!html || html.length === 0) {
|
|
200
203
|
throw new Error(`Failed to render html for ${requestUrl.toString()}`);
|
|
201
204
|
}
|
package/dist/esm/proxy/index.js
CHANGED
|
@@ -6,5 +6,6 @@ export { AppRouterMultisiteProxy } from './app-router-multisite-proxy';
|
|
|
6
6
|
export { LocaleProxy } from './locale-proxy';
|
|
7
7
|
export { PersonalizeService, } from '@sitecore-content-sdk/content/personalize';
|
|
8
8
|
export { BotTrackingProxy } from './bot-tracking-proxy';
|
|
9
|
+
export { PreviewProxy } from './preview-proxy';
|
|
9
10
|
export { RedirectsService, REDIRECT_TYPE_301, REDIRECT_TYPE_302, REDIRECT_TYPE_SERVER_TRANSFER, } from '@sitecore-content-sdk/content/site';
|
|
10
11
|
export { default as debug } from '../debug';
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { ProxyBase } from './proxy';
|
|
3
|
+
import { EDITING_PARAMS_HEADER } from '../editing/constants';
|
|
4
|
+
import { SITE_KEY } from '@sitecore-content-sdk/content/site';
|
|
5
|
+
import debug from '../debug';
|
|
6
|
+
/**
|
|
7
|
+
* Proxy for preview requests. Acts as a gateway for preview requests.
|
|
8
|
+
* Currently it only supports internal editing hosts deployed on Sitecore AI.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export class PreviewProxy extends ProxyBase {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
// PreviewProxy does not need site resolution
|
|
14
|
+
super(Object.assign(Object.assign({}, config), { sites: [] }));
|
|
15
|
+
this.handle = async (req, res) => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
// Run only in internal editing host
|
|
18
|
+
if (!process.env.SITECORE) {
|
|
19
|
+
return res;
|
|
20
|
+
}
|
|
21
|
+
const previewParams = req.headers.get(EDITING_PARAMS_HEADER);
|
|
22
|
+
const authHeader = (_a = req.headers.get('Authorization')) !== null && _a !== void 0 ? _a : '';
|
|
23
|
+
let editingOptions = previewParams ? JSON.parse(previewParams) : null;
|
|
24
|
+
debug.editing('preview proxy start');
|
|
25
|
+
// Process only preview requests (e.g. non editing or design studio)
|
|
26
|
+
if (editingOptions && editingOptions.mode !== 'preview') {
|
|
27
|
+
debug.editing('preview proxy skipped (mode is not preview)');
|
|
28
|
+
return res;
|
|
29
|
+
}
|
|
30
|
+
let pageData = null;
|
|
31
|
+
// Scenario when the request is coming from /api/editing/render endpoint
|
|
32
|
+
if (editingOptions) {
|
|
33
|
+
pageData = await this.client.getPreview(editingOptions, {
|
|
34
|
+
headers: {
|
|
35
|
+
Authorization: authHeader,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Scenario when the page is requested using direct path or navigation is performed
|
|
41
|
+
pageData = await this.client.getPage(req.nextUrl.pathname, {
|
|
42
|
+
site: (_b = req.cookies.get(SITE_KEY)) === null || _b === void 0 ? void 0 : _b.value,
|
|
43
|
+
locale: this.getLanguage(req),
|
|
44
|
+
}, {
|
|
45
|
+
headers: {
|
|
46
|
+
Authorization: authHeader,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Preview content is not found or access is denied
|
|
51
|
+
if (!pageData) {
|
|
52
|
+
debug.editing('preview content is not found or access is denied');
|
|
53
|
+
return NextResponse.json({ html: 'Preview content is not found or access is denied' }, { status: 403 });
|
|
54
|
+
}
|
|
55
|
+
debug.editing('preview proxy end');
|
|
56
|
+
return res;
|
|
57
|
+
};
|
|
58
|
+
this.client = config.client;
|
|
59
|
+
}
|
|
60
|
+
}
|
package/dist/esm/proxy/proxy.js
CHANGED
|
@@ -202,7 +202,13 @@ export const defineProxy = (...proxies) => {
|
|
|
202
202
|
const response = res || NextResponse.next();
|
|
203
203
|
debug.common('proxy start');
|
|
204
204
|
const start = Date.now();
|
|
205
|
-
const proxyResponse = await proxies.reduce((p, proxy) => p.then((res) =>
|
|
205
|
+
const proxyResponse = await proxies.reduce((p, proxy) => p.then((res) => {
|
|
206
|
+
// Short-circuit the remaining proxies once a previous one
|
|
207
|
+
// denied the request (e.g. PreviewProxy returning 403).
|
|
208
|
+
if (res.status === 403)
|
|
209
|
+
return res;
|
|
210
|
+
return proxy.handle(req, res);
|
|
211
|
+
}), Promise.resolve(response));
|
|
206
212
|
debug.common('proxy end in %dms', Date.now() - start);
|
|
207
213
|
return proxyResponse;
|
|
208
214
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sitecore-content-sdk/nextjs",
|
|
3
|
-
"version": "2.1.0-canary.
|
|
3
|
+
"version": "2.1.0-canary.15",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"url": "https://github.com/sitecore/content-sdk/issues"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.
|
|
36
|
-
"@sitecore-content-sdk/personalize": "2.1.0-canary.
|
|
35
|
+
"@sitecore-content-sdk/analytics-core": "2.1.0-canary.15",
|
|
36
|
+
"@sitecore-content-sdk/personalize": "2.1.0-canary.15",
|
|
37
37
|
"@stylistic/eslint-plugin": "^5.2.2",
|
|
38
38
|
"@testing-library/dom": "^10.4.0",
|
|
39
39
|
"@testing-library/react": "^16.3.0",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
},
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@babel/parser": "^7.27.2",
|
|
94
|
-
"@sitecore-content-sdk/content": "2.1.0-canary.
|
|
95
|
-
"@sitecore-content-sdk/core": "2.1.0-canary.
|
|
96
|
-
"@sitecore-content-sdk/events": "2.1.0-canary.
|
|
97
|
-
"@sitecore-content-sdk/react": "2.1.0-canary.
|
|
94
|
+
"@sitecore-content-sdk/content": "2.1.0-canary.15",
|
|
95
|
+
"@sitecore-content-sdk/core": "2.1.0-canary.15",
|
|
96
|
+
"@sitecore-content-sdk/events": "2.1.0-canary.15",
|
|
97
|
+
"@sitecore-content-sdk/react": "2.1.0-canary.15",
|
|
98
98
|
"recast": "^0.23.11",
|
|
99
99
|
"regex-parser": "^2.3.1",
|
|
100
100
|
"sync-disk-cache": "^2.1.0"
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
},
|
|
179
179
|
"description": "",
|
|
180
180
|
"types": "types/index.d.ts",
|
|
181
|
-
"gitHead": "
|
|
181
|
+
"gitHead": "3fc9a7a7bbaac657678e88e950d95af7e0801a82",
|
|
182
182
|
"files": [
|
|
183
183
|
"dist",
|
|
184
184
|
"types",
|
|
@@ -46,28 +46,6 @@ export declare class SitecoreNextjsClient extends SitecoreClient {
|
|
|
46
46
|
* @param {FetchOptions} [fetchOptions] Additional fetch fetch options to override GraphQL requests (like retries and fetch)
|
|
47
47
|
*/
|
|
48
48
|
getPreview(previewData: PreviewData, fetchOptions?: FetchOptions): Promise<Page | null>;
|
|
49
|
-
/**
|
|
50
|
-
* **NOTE**: App Router only.
|
|
51
|
-
*
|
|
52
|
-
* Builds the inputs for the Preview mode based on incoming request headers.
|
|
53
|
-
*
|
|
54
|
-
* - Reads editing preview data from the `x-sitecore-editing-params` header.
|
|
55
|
-
* - Reads the `authorization` header from the request and merges it as
|
|
56
|
-
* `Authorization` into `fetchOptions.headers`. The request value takes
|
|
57
|
-
* precedence over any `Authorization` (case-insensitive) supplied via
|
|
58
|
-
* `extra.headers`; existing case-variant keys are removed so the result
|
|
59
|
-
* never contains duplicates. An empty `Authorization` is never emitted.
|
|
60
|
-
*
|
|
61
|
-
* Other headers present on the input are ignored. Non-`headers` fields of
|
|
62
|
-
* `extra` are preserved as-is. Extra headers are merged into `fetchOptions.headers`.
|
|
63
|
-
* @param {Headers} headers - The headers from the incoming request.
|
|
64
|
-
* @param {FetchOptions} [extra] - Optional base fetch options to merge with.
|
|
65
|
-
* @returns The `previewData` and `fetchOptions` to forward
|
|
66
|
-
*/
|
|
67
|
-
getPreviewInputs(headers: Headers, extra?: FetchOptions): {
|
|
68
|
-
previewData: PreviewData;
|
|
69
|
-
fetchOptions: FetchOptions;
|
|
70
|
-
};
|
|
71
49
|
/**
|
|
72
50
|
* Generates static params for the Next.js App Router from Sitecore routes.
|
|
73
51
|
*
|
|
@@ -100,50 +78,13 @@ export declare class SitecoreNextjsClient extends SitecoreClient {
|
|
|
100
78
|
* @returns {ComponentPropsCollection} component props
|
|
101
79
|
*/
|
|
102
80
|
getComponentData(layoutData: LayoutServiceData, context: GetServerSidePropsContext | GetStaticPropsContext, components: ComponentMap<NextjsContentSdkComponent>): Promise<ComponentPropsCollection>;
|
|
103
|
-
protected getComponentPropsService(): ComponentPropsService;
|
|
104
81
|
/**
|
|
105
|
-
* **NOTE**:
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* to avoid leaking it back into request payloads.
|
|
110
|
-
*
|
|
111
|
-
* The value stashed in preview data takes precedence over any caller-supplied
|
|
112
|
-
* `Authorization` header. Existing `Authorization` keys are removed
|
|
113
|
-
* case-insensitively before the merged value is set, so the result never
|
|
114
|
-
* contains duplicate keys.
|
|
115
|
-
* @param {PreviewData} previewData - The preview data to merge the authorization header from.
|
|
116
|
-
* @param {FetchOptions} [fetchOptions] - The fetch options to merge the authorization header into.
|
|
117
|
-
* @returns The preview data and fetch options with the authorization header merged.
|
|
118
|
-
*/
|
|
119
|
-
private mergePreviewAuthorization;
|
|
120
|
-
/**
|
|
121
|
-
* Reads and JSON-parses the editing preview data propagated via
|
|
122
|
-
* `EDITING_PARAMS_HEADER`. Returns an empty object when the header is
|
|
123
|
-
* missing or its value is not valid JSON.
|
|
124
|
-
* @param {Headers} headers - The incoming request headers.
|
|
125
|
-
* @returns {PreviewData} The parsed preview data, or an empty object.
|
|
126
|
-
*/
|
|
127
|
-
private parsePreviewDataFromHeader;
|
|
128
|
-
/**
|
|
129
|
-
* Builds `FetchOptions` by merging the `Authorization` header from the
|
|
130
|
-
* incoming request headers into `extra`. The request value takes precedence
|
|
131
|
-
* over any caller-supplied `Authorization` header (case-insensitive). An
|
|
132
|
-
* empty `Authorization` is never emitted.
|
|
133
|
-
* @param {Headers} headers - The incoming request headers.
|
|
134
|
-
* @param {FetchOptions} [extra] - Optional base fetch options to merge with.
|
|
135
|
-
* @returns {FetchOptions} The merged fetch options.
|
|
136
|
-
*/
|
|
137
|
-
private mergeAuthorizationHeader;
|
|
138
|
-
/**
|
|
139
|
-
* Returns a shallow-cloned headers record with `Authorization` set to
|
|
140
|
-
* `authorization` (when truthy). Any pre-existing `Authorization` key is
|
|
141
|
-
* removed case-insensitively to avoid emitting both `authorization` and
|
|
142
|
-
* `Authorization` in the same record.
|
|
143
|
-
* @param {Record<string, string> | undefined} headers - Existing headers, if any.
|
|
144
|
-
* @param {string | null | undefined} authorization - The authorization value to apply, or null/undefined to leave headers unchanged.
|
|
145
|
-
* @returns {Record<string, string>} The merged headers.
|
|
82
|
+
* **NOTE**: App Router only.
|
|
83
|
+
* Retrieves preview data from the request headers
|
|
84
|
+
* @param {Headers} headers - The headers from the incoming request.
|
|
85
|
+
* @returns {PreviewData} The preview data.
|
|
146
86
|
*/
|
|
147
|
-
|
|
87
|
+
getPreviewData(headers: Headers): PreviewData;
|
|
88
|
+
protected getComponentPropsService(): ComponentPropsService;
|
|
148
89
|
}
|
|
149
90
|
//# sourceMappingURL=sitecore-nextjs-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sitecore-nextjs-client.d.ts","sourceRoot":"","sources":["../../src/client/sitecore-nextjs-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,cAAc,EACd,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,wBAAwB,EAExB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"sitecore-nextjs-client.d.ts","sourceRoot":"","sources":["../../src/client/sitecore-nextjs-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,cAAc,EACd,kBAAkB,EACnB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,wBAAwB,EAExB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAU5E,OAAO,EAAE,YAAY,EAAE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AG,EAAE,qBAAqB,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC;IAIxF,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"editing-render-middleware.d.ts","sourceRoot":"","sources":["../../src/editing/editing-render-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAEvD,OAAO,EAIL,wBAAwB,EACzB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAe3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C;;OAEG;IACH,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG;IACnD,KAAK,EAAE,wBAAwB,CAAC;CACjC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,oBAAoB;IAK5C,MAAM,CAAC,EAAE,6BAA6B;IAJzD,OAAO,CAAC,WAAW,CAAoB;IACvC;;OAEG;gBACgB,MAAM,CAAC,EAAE,6BAA6B,YAAA;IAKzD;;;OAGG;IACI,UAAU,IAAI,CAAC,GAAG,EAAE,qBAAqB,EAAE,GAAG,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC;IAIxF,OAAO,CAAC,OAAO,CA8Jb;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/editing/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAE9B,wBA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;;GAcG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,cAAc,GAAG,WAAW,WAmBjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,cAIxB,CAAC"}
|
package/types/proxy/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { AppRouterMultisiteProxy } from './app-router-multisite-proxy';
|
|
|
6
6
|
export { LocaleProxy, LocaleProxyConfig } from './locale-proxy';
|
|
7
7
|
export { PersonalizeService, PersonalizeServiceConfig, } from '@sitecore-content-sdk/content/personalize';
|
|
8
8
|
export { BotTrackingProxy, BotTrackingProxyConfig } from './bot-tracking-proxy';
|
|
9
|
+
export { PreviewProxy, PreviewProxyConfig } from './preview-proxy';
|
|
9
10
|
export { RedirectsService, RedirectsServiceConfig, REDIRECT_TYPE_301, REDIRECT_TYPE_302, REDIRECT_TYPE_SERVER_TRANSFER, RedirectInfo, } from '@sitecore-content-sdk/content/site';
|
|
10
11
|
export { default as debug } from '../debug';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/proxy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/proxy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,YAAY,GACb,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import { ProxyBase } from './proxy';
|
|
3
|
+
import { SitecoreClient } from '../client';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for PreviewProxy
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export type PreviewProxyConfig = {
|
|
9
|
+
client: SitecoreClient;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Proxy for preview requests. Acts as a gateway for preview requests.
|
|
13
|
+
* Currently it only supports internal editing hosts deployed on Sitecore AI.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare class PreviewProxy extends ProxyBase {
|
|
17
|
+
protected client: SitecoreClient;
|
|
18
|
+
constructor(config: PreviewProxyConfig);
|
|
19
|
+
handle: (req: NextRequest, res: NextResponse) => Promise<NextResponse>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=preview-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-proxy.d.ts","sourceRoot":"","sources":["../../src/proxy/preview-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAM3C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,SAAS;IACzC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC;gBAErB,MAAM,EAAE,kBAAkB;IAMtC,MAAM,GAAU,KAAK,WAAW,EAAE,KAAK,YAAY,KAAG,OAAO,CAAC,YAAY,CAAC,CAuDzE;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.d.ts","sourceRoot":"","sources":["../../src/proxy/proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO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