@cmssy/next 0.5.6 → 0.7.0
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/README.md +1 -2
- package/dist/index.cjs +35 -13
- package/dist/index.d.cts +4 -9
- package/dist/index.d.ts +4 -9
- package/dist/index.js +35 -13
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -26,11 +26,10 @@ export default createCmssyPage(cmssy, blocks, { editor: CmssyEditor });
|
|
|
26
26
|
import type { CmssyNextConfig } from "@cmssy/next";
|
|
27
27
|
|
|
28
28
|
export const cmssy: CmssyNextConfig = {
|
|
29
|
-
apiUrl: process.env.CMSSY_API_URL ?? "", // public GraphQL delivery endpoint
|
|
30
29
|
workspaceSlug: process.env.CMSSY_WORKSPACE_SLUG ?? "",
|
|
31
30
|
draftSecret: process.env.CMSSY_DRAFT_SECRET ?? "", // edit-mode preview handshake
|
|
32
|
-
editorOrigin: process.env.CMSSY_EDITOR_ORIGIN ?? "", // only needed in edit mode
|
|
33
31
|
defaultLocale: "en",
|
|
32
|
+
// apiUrl + editorOrigin default to cmssy cloud; set them only for self-host/staging.
|
|
34
33
|
};
|
|
35
34
|
```
|
|
36
35
|
|
package/dist/index.cjs
CHANGED
|
@@ -71,14 +71,29 @@ function sessionCookieOptions() {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// src/config.ts
|
|
74
|
-
var
|
|
74
|
+
var DEFAULT_CMSSY_EDITOR_ORIGINS = [
|
|
75
|
+
"https://cmssy.io",
|
|
76
|
+
"https://www.cmssy.io"
|
|
77
|
+
];
|
|
78
|
+
function parseEditorOriginEnv(raw) {
|
|
79
|
+
if (!raw) return void 0;
|
|
80
|
+
const parts = raw.split(",").map((o) => o.trim()).filter((o) => o.length > 0);
|
|
81
|
+
if (parts.length === 0) return void 0;
|
|
82
|
+
return parts.length === 1 ? parts[0] : parts;
|
|
83
|
+
}
|
|
84
|
+
function isDevelopment() {
|
|
85
|
+
return typeof process !== "undefined" && process.env.NODE_ENV === "development";
|
|
86
|
+
}
|
|
75
87
|
function resolveEditorOrigin(editorOrigin) {
|
|
76
|
-
|
|
77
|
-
if (
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
const value = editorOrigin ?? (typeof process !== "undefined" ? parseEditorOriginEnv(process.env.CMSSY_EDITOR_ORIGIN) : void 0);
|
|
89
|
+
if (value === void 0) {
|
|
90
|
+
return isDevelopment() ? "*" : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
91
|
+
}
|
|
92
|
+
if (Array.isArray(value)) {
|
|
93
|
+
const cleaned = value.filter((o) => o && o.trim().length > 0);
|
|
94
|
+
return cleaned.length > 0 ? cleaned : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
80
95
|
}
|
|
81
|
-
return
|
|
96
|
+
return value.trim().length > 0 ? value : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
82
97
|
}
|
|
83
98
|
function assertAuthConfig(config) {
|
|
84
99
|
const auth = config.auth;
|
|
@@ -162,6 +177,7 @@ function applyCmssyCsp(response, options) {
|
|
|
162
177
|
return response;
|
|
163
178
|
}
|
|
164
179
|
var EDIT_QUERY_PARAM = "cmssyEdit";
|
|
180
|
+
var DEV_QUERY_PARAM = "cmssyDev";
|
|
165
181
|
function hasEditFlag(value) {
|
|
166
182
|
return Array.isArray(value) ? value.includes("1") : value === "1";
|
|
167
183
|
}
|
|
@@ -185,6 +201,8 @@ function createCmssyPage(config, blocks, options) {
|
|
|
185
201
|
const { isEnabled } = await headers.draftMode();
|
|
186
202
|
const query = searchParams ? await searchParams : {};
|
|
187
203
|
const editMode = isEnabled || hasEditFlag(query[EDIT_QUERY_PARAM]);
|
|
204
|
+
const devMode = isDevelopment() && Boolean(config.devToken?.trim()) && hasEditFlag(query[DEV_QUERY_PARAM]);
|
|
205
|
+
const editorActive = editMode || devMode;
|
|
188
206
|
let locale;
|
|
189
207
|
let pagePath = path;
|
|
190
208
|
let defaultLocale;
|
|
@@ -201,15 +219,19 @@ function createCmssyPage(config, blocks, options) {
|
|
|
201
219
|
locale = split.locale;
|
|
202
220
|
pagePath = split.path;
|
|
203
221
|
}
|
|
222
|
+
const devWorkspaceId = devMode ? await client$1.resolveWorkspaceId() : void 0;
|
|
204
223
|
const page = await react.fetchPage(clientConfig, pagePath, {
|
|
205
|
-
previewSecret: editMode ? config.draftSecret : void 0
|
|
224
|
+
previewSecret: editMode ? config.draftSecret : void 0,
|
|
225
|
+
devPreview: devMode || void 0,
|
|
226
|
+
devToken: devMode ? config.devToken : void 0,
|
|
227
|
+
workspaceId: devWorkspaceId
|
|
206
228
|
});
|
|
207
229
|
if (!page) {
|
|
208
230
|
navigation.notFound();
|
|
209
231
|
}
|
|
210
|
-
if (
|
|
232
|
+
if (editorActive && !Editor) {
|
|
211
233
|
throw new Error(
|
|
212
|
-
'cmssy: edit mode requires options.editor \u2014 pass a "use client" editor that imports your blocks and renders <CmssyEditablePage blocks={blocks} \u2026 />'
|
|
234
|
+
'cmssy: edit/dev mode requires options.editor \u2014 pass a "use client" editor that imports your blocks and renders <CmssyEditablePage blocks={blocks} \u2026 />'
|
|
213
235
|
);
|
|
214
236
|
}
|
|
215
237
|
const resolvedForms = await react.resolveForms(
|
|
@@ -224,7 +246,7 @@ function createCmssyPage(config, blocks, options) {
|
|
|
224
246
|
default: defaultLocale,
|
|
225
247
|
enabled: enabledLocales && enabledLocales.length > 0 ? enabledLocales : Array.from(/* @__PURE__ */ new Set([defaultLocale, locale]))
|
|
226
248
|
};
|
|
227
|
-
if (
|
|
249
|
+
if (editorActive && Editor) {
|
|
228
250
|
const bridgeOrigin = resolveBridgeOrigin(config.editorOrigin);
|
|
229
251
|
return /* @__PURE__ */ jsxRuntime.jsx(client.CmssyLocaleProvider, { value: localeContext, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
230
252
|
Editor,
|
|
@@ -286,9 +308,9 @@ function resolveBridgeOrigin(editorOrigin) {
|
|
|
286
308
|
);
|
|
287
309
|
}
|
|
288
310
|
const origin = toCspOrigin(origins[0].trim());
|
|
289
|
-
if (origin === "*") {
|
|
311
|
+
if (origin === "*" && !isDevelopment()) {
|
|
290
312
|
throw new Error(
|
|
291
|
-
"cmssy: editorOrigin '*' is
|
|
313
|
+
"cmssy: editorOrigin '*' is only allowed in development; set a concrete editor origin (e.g. https://cmssy.io) for production"
|
|
292
314
|
);
|
|
293
315
|
}
|
|
294
316
|
return origin;
|
|
@@ -1631,7 +1653,7 @@ exports.CMSSY_EDIT_HEADER = CMSSY_EDIT_HEADER;
|
|
|
1631
1653
|
exports.CMSSY_LOCALE_HEADER = CMSSY_LOCALE_HEADER;
|
|
1632
1654
|
exports.CMSSY_SESSION_COOKIE = CMSSY_SESSION_COOKIE;
|
|
1633
1655
|
exports.CmssyWebhookError = CmssyWebhookError;
|
|
1634
|
-
exports.
|
|
1656
|
+
exports.DEFAULT_CMSSY_EDITOR_ORIGINS = DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
1635
1657
|
exports.SESSION_MAX_AGE_SECONDS = SESSION_MAX_AGE_SECONDS;
|
|
1636
1658
|
exports.applyCmssyCsp = applyCmssyCsp;
|
|
1637
1659
|
exports.assertAuthConfig = assertAuthConfig;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,13 +6,7 @@ import { EditBridgeConfig } from '@cmssy/react/client';
|
|
|
6
6
|
import { MetadataRoute, Metadata } from 'next';
|
|
7
7
|
import { NextRequest, NextResponse } from 'next/server';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
* Origin of the cmssy admin/editor that frames your site (postMessage source +
|
|
11
|
-
* CSP `frame-ancestors`). Identical for every workspace on cmssy cloud, so
|
|
12
|
-
* `editorOrigin` defaults to this. Self-hosted admins override it via config.
|
|
13
|
-
*/
|
|
14
|
-
declare const DEFAULT_CMSSY_EDITOR_ORIGIN = "https://www.cmssy.io";
|
|
15
|
-
/** Resolves `editorOrigin`, falling back to the cmssy cloud admin when unset. */
|
|
9
|
+
declare const DEFAULT_CMSSY_EDITOR_ORIGINS: string[];
|
|
16
10
|
declare function resolveEditorOrigin(editorOrigin: string | string[] | undefined): string | string[];
|
|
17
11
|
interface CmssyAuthConfig {
|
|
18
12
|
modelSlug: string;
|
|
@@ -26,9 +20,10 @@ interface CmssyNextConfig {
|
|
|
26
20
|
apiUrl?: string;
|
|
27
21
|
workspaceSlug: string;
|
|
28
22
|
draftSecret: string;
|
|
23
|
+
devToken?: string;
|
|
29
24
|
/**
|
|
30
25
|
* Origin allowed to frame your app in the editor. Defaults to
|
|
31
|
-
* {@link
|
|
26
|
+
* {@link DEFAULT_CMSSY_EDITOR_ORIGINS}; set it only for self-hosted admins.
|
|
32
27
|
*/
|
|
33
28
|
editorOrigin?: string | string[];
|
|
34
29
|
/**
|
|
@@ -346,4 +341,4 @@ declare class CmssyWebhookError extends Error {
|
|
|
346
341
|
*/
|
|
347
342
|
declare function verifyCmssyWebhook(options: VerifyCmssyWebhookOptions): CmssyWebhookEvent;
|
|
348
343
|
|
|
349
|
-
export { type BuildCmssyMetadataOptions, CMSSY_CART_COOKIE, CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CMSSY_SESSION_COOKIE, type CmssyAuthConfig, type CmssyAuthMiddleware, type CmssyAuthRouteHandlers, type CmssyCartRouteHandlers, type CmssyCspOptions, type CmssyDraftRouteConfig, type CmssyEditorProps, type CmssyNextConfig, type CmssyOrdersRouteHandlers, type CmssySessionPayload, type CmssySessionUser, CmssyWebhookError, type CmssyWebhookEvent, type CmssyWebhookOrder, type CreateCmssyNotFoundOptions, type CreateCmssyPageOptions, type CreateCmssyRobotsOptions, type CreateCmssySitemapOptions,
|
|
344
|
+
export { type BuildCmssyMetadataOptions, CMSSY_CART_COOKIE, CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CMSSY_SESSION_COOKIE, type CmssyAuthConfig, type CmssyAuthMiddleware, type CmssyAuthRouteHandlers, type CmssyCartRouteHandlers, type CmssyCspOptions, type CmssyDraftRouteConfig, type CmssyEditorProps, type CmssyNextConfig, type CmssyOrdersRouteHandlers, type CmssySessionPayload, type CmssySessionUser, CmssyWebhookError, type CmssyWebhookEvent, type CmssyWebhookOrder, type CreateCmssyNotFoundOptions, type CreateCmssyPageOptions, type CreateCmssyRobotsOptions, type CreateCmssySitemapOptions, DEFAULT_CMSSY_EDITOR_ORIGINS, type FetchProductOptions, type FetchProductsOptions, type MyOrdersResult, SESSION_MAX_AGE_SECONDS, type SessionCookieOptions, type VerifyCmssyWebhookOptions, applyCmssyCsp, assertAuthConfig, buildCmssyMetadata, cmssyCspHeaders, createCmssyAuthMiddleware, createCmssyAuthRoute, createCmssyCartRoute, createCmssyLocaleMiddleware, createCmssyNotFound, createCmssyOrdersRoute, createCmssyPage, createCmssyRobots, createCmssySitemap, createDraftRoute, fetchProduct, fetchProducts, getCmssyAccessToken, getCmssyLocale, getCmssyUser, isAccessExpired, isCmssyEditMode, isCmssyEditRequest, localeForPathname, openSession, resolveEditorOrigin, resolveLocaleFromPathname, sealSession, sessionCookieOptions, splitCmssyLocale, verifyCmssyWebhook };
|
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,7 @@ import { EditBridgeConfig } from '@cmssy/react/client';
|
|
|
6
6
|
import { MetadataRoute, Metadata } from 'next';
|
|
7
7
|
import { NextRequest, NextResponse } from 'next/server';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
* Origin of the cmssy admin/editor that frames your site (postMessage source +
|
|
11
|
-
* CSP `frame-ancestors`). Identical for every workspace on cmssy cloud, so
|
|
12
|
-
* `editorOrigin` defaults to this. Self-hosted admins override it via config.
|
|
13
|
-
*/
|
|
14
|
-
declare const DEFAULT_CMSSY_EDITOR_ORIGIN = "https://www.cmssy.io";
|
|
15
|
-
/** Resolves `editorOrigin`, falling back to the cmssy cloud admin when unset. */
|
|
9
|
+
declare const DEFAULT_CMSSY_EDITOR_ORIGINS: string[];
|
|
16
10
|
declare function resolveEditorOrigin(editorOrigin: string | string[] | undefined): string | string[];
|
|
17
11
|
interface CmssyAuthConfig {
|
|
18
12
|
modelSlug: string;
|
|
@@ -26,9 +20,10 @@ interface CmssyNextConfig {
|
|
|
26
20
|
apiUrl?: string;
|
|
27
21
|
workspaceSlug: string;
|
|
28
22
|
draftSecret: string;
|
|
23
|
+
devToken?: string;
|
|
29
24
|
/**
|
|
30
25
|
* Origin allowed to frame your app in the editor. Defaults to
|
|
31
|
-
* {@link
|
|
26
|
+
* {@link DEFAULT_CMSSY_EDITOR_ORIGINS}; set it only for self-hosted admins.
|
|
32
27
|
*/
|
|
33
28
|
editorOrigin?: string | string[];
|
|
34
29
|
/**
|
|
@@ -346,4 +341,4 @@ declare class CmssyWebhookError extends Error {
|
|
|
346
341
|
*/
|
|
347
342
|
declare function verifyCmssyWebhook(options: VerifyCmssyWebhookOptions): CmssyWebhookEvent;
|
|
348
343
|
|
|
349
|
-
export { type BuildCmssyMetadataOptions, CMSSY_CART_COOKIE, CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CMSSY_SESSION_COOKIE, type CmssyAuthConfig, type CmssyAuthMiddleware, type CmssyAuthRouteHandlers, type CmssyCartRouteHandlers, type CmssyCspOptions, type CmssyDraftRouteConfig, type CmssyEditorProps, type CmssyNextConfig, type CmssyOrdersRouteHandlers, type CmssySessionPayload, type CmssySessionUser, CmssyWebhookError, type CmssyWebhookEvent, type CmssyWebhookOrder, type CreateCmssyNotFoundOptions, type CreateCmssyPageOptions, type CreateCmssyRobotsOptions, type CreateCmssySitemapOptions,
|
|
344
|
+
export { type BuildCmssyMetadataOptions, CMSSY_CART_COOKIE, CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CMSSY_SESSION_COOKIE, type CmssyAuthConfig, type CmssyAuthMiddleware, type CmssyAuthRouteHandlers, type CmssyCartRouteHandlers, type CmssyCspOptions, type CmssyDraftRouteConfig, type CmssyEditorProps, type CmssyNextConfig, type CmssyOrdersRouteHandlers, type CmssySessionPayload, type CmssySessionUser, CmssyWebhookError, type CmssyWebhookEvent, type CmssyWebhookOrder, type CreateCmssyNotFoundOptions, type CreateCmssyPageOptions, type CreateCmssyRobotsOptions, type CreateCmssySitemapOptions, DEFAULT_CMSSY_EDITOR_ORIGINS, type FetchProductOptions, type FetchProductsOptions, type MyOrdersResult, SESSION_MAX_AGE_SECONDS, type SessionCookieOptions, type VerifyCmssyWebhookOptions, applyCmssyCsp, assertAuthConfig, buildCmssyMetadata, cmssyCspHeaders, createCmssyAuthMiddleware, createCmssyAuthRoute, createCmssyCartRoute, createCmssyLocaleMiddleware, createCmssyNotFound, createCmssyOrdersRoute, createCmssyPage, createCmssyRobots, createCmssySitemap, createDraftRoute, fetchProduct, fetchProducts, getCmssyAccessToken, getCmssyLocale, getCmssyUser, isAccessExpired, isCmssyEditMode, isCmssyEditRequest, localeForPathname, openSession, resolveEditorOrigin, resolveLocaleFromPathname, sealSession, sessionCookieOptions, splitCmssyLocale, verifyCmssyWebhook };
|
package/dist/index.js
CHANGED
|
@@ -70,14 +70,29 @@ function sessionCookieOptions() {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
// src/config.ts
|
|
73
|
-
var
|
|
73
|
+
var DEFAULT_CMSSY_EDITOR_ORIGINS = [
|
|
74
|
+
"https://cmssy.io",
|
|
75
|
+
"https://www.cmssy.io"
|
|
76
|
+
];
|
|
77
|
+
function parseEditorOriginEnv(raw) {
|
|
78
|
+
if (!raw) return void 0;
|
|
79
|
+
const parts = raw.split(",").map((o) => o.trim()).filter((o) => o.length > 0);
|
|
80
|
+
if (parts.length === 0) return void 0;
|
|
81
|
+
return parts.length === 1 ? parts[0] : parts;
|
|
82
|
+
}
|
|
83
|
+
function isDevelopment() {
|
|
84
|
+
return typeof process !== "undefined" && process.env.NODE_ENV === "development";
|
|
85
|
+
}
|
|
74
86
|
function resolveEditorOrigin(editorOrigin) {
|
|
75
|
-
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
87
|
+
const value = editorOrigin ?? (typeof process !== "undefined" ? parseEditorOriginEnv(process.env.CMSSY_EDITOR_ORIGIN) : void 0);
|
|
88
|
+
if (value === void 0) {
|
|
89
|
+
return isDevelopment() ? "*" : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
90
|
+
}
|
|
91
|
+
if (Array.isArray(value)) {
|
|
92
|
+
const cleaned = value.filter((o) => o && o.trim().length > 0);
|
|
93
|
+
return cleaned.length > 0 ? cleaned : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
79
94
|
}
|
|
80
|
-
return
|
|
95
|
+
return value.trim().length > 0 ? value : DEFAULT_CMSSY_EDITOR_ORIGINS;
|
|
81
96
|
}
|
|
82
97
|
function assertAuthConfig(config) {
|
|
83
98
|
const auth = config.auth;
|
|
@@ -161,6 +176,7 @@ function applyCmssyCsp(response, options) {
|
|
|
161
176
|
return response;
|
|
162
177
|
}
|
|
163
178
|
var EDIT_QUERY_PARAM = "cmssyEdit";
|
|
179
|
+
var DEV_QUERY_PARAM = "cmssyDev";
|
|
164
180
|
function hasEditFlag(value) {
|
|
165
181
|
return Array.isArray(value) ? value.includes("1") : value === "1";
|
|
166
182
|
}
|
|
@@ -184,6 +200,8 @@ function createCmssyPage(config, blocks, options) {
|
|
|
184
200
|
const { isEnabled } = await draftMode();
|
|
185
201
|
const query = searchParams ? await searchParams : {};
|
|
186
202
|
const editMode = isEnabled || hasEditFlag(query[EDIT_QUERY_PARAM]);
|
|
203
|
+
const devMode = isDevelopment() && Boolean(config.devToken?.trim()) && hasEditFlag(query[DEV_QUERY_PARAM]);
|
|
204
|
+
const editorActive = editMode || devMode;
|
|
187
205
|
let locale;
|
|
188
206
|
let pagePath = path;
|
|
189
207
|
let defaultLocale;
|
|
@@ -200,15 +218,19 @@ function createCmssyPage(config, blocks, options) {
|
|
|
200
218
|
locale = split.locale;
|
|
201
219
|
pagePath = split.path;
|
|
202
220
|
}
|
|
221
|
+
const devWorkspaceId = devMode ? await client.resolveWorkspaceId() : void 0;
|
|
203
222
|
const page = await fetchPage(clientConfig, pagePath, {
|
|
204
|
-
previewSecret: editMode ? config.draftSecret : void 0
|
|
223
|
+
previewSecret: editMode ? config.draftSecret : void 0,
|
|
224
|
+
devPreview: devMode || void 0,
|
|
225
|
+
devToken: devMode ? config.devToken : void 0,
|
|
226
|
+
workspaceId: devWorkspaceId
|
|
205
227
|
});
|
|
206
228
|
if (!page) {
|
|
207
229
|
notFound();
|
|
208
230
|
}
|
|
209
|
-
if (
|
|
231
|
+
if (editorActive && !Editor) {
|
|
210
232
|
throw new Error(
|
|
211
|
-
'cmssy: edit mode requires options.editor \u2014 pass a "use client" editor that imports your blocks and renders <CmssyEditablePage blocks={blocks} \u2026 />'
|
|
233
|
+
'cmssy: edit/dev mode requires options.editor \u2014 pass a "use client" editor that imports your blocks and renders <CmssyEditablePage blocks={blocks} \u2026 />'
|
|
212
234
|
);
|
|
213
235
|
}
|
|
214
236
|
const resolvedForms = await resolveForms(
|
|
@@ -223,7 +245,7 @@ function createCmssyPage(config, blocks, options) {
|
|
|
223
245
|
default: defaultLocale,
|
|
224
246
|
enabled: enabledLocales && enabledLocales.length > 0 ? enabledLocales : Array.from(/* @__PURE__ */ new Set([defaultLocale, locale]))
|
|
225
247
|
};
|
|
226
|
-
if (
|
|
248
|
+
if (editorActive && Editor) {
|
|
227
249
|
const bridgeOrigin = resolveBridgeOrigin(config.editorOrigin);
|
|
228
250
|
return /* @__PURE__ */ jsx(CmssyLocaleProvider, { value: localeContext, children: /* @__PURE__ */ jsx(
|
|
229
251
|
Editor,
|
|
@@ -285,9 +307,9 @@ function resolveBridgeOrigin(editorOrigin) {
|
|
|
285
307
|
);
|
|
286
308
|
}
|
|
287
309
|
const origin = toCspOrigin(origins[0].trim());
|
|
288
|
-
if (origin === "*") {
|
|
310
|
+
if (origin === "*" && !isDevelopment()) {
|
|
289
311
|
throw new Error(
|
|
290
|
-
"cmssy: editorOrigin '*' is
|
|
312
|
+
"cmssy: editorOrigin '*' is only allowed in development; set a concrete editor origin (e.g. https://cmssy.io) for production"
|
|
291
313
|
);
|
|
292
314
|
}
|
|
293
315
|
return origin;
|
|
@@ -1617,4 +1639,4 @@ function verifyCmssyWebhook(options) {
|
|
|
1617
1639
|
return parsed;
|
|
1618
1640
|
}
|
|
1619
1641
|
|
|
1620
|
-
export { CMSSY_CART_COOKIE, CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CMSSY_SESSION_COOKIE, CmssyWebhookError,
|
|
1642
|
+
export { CMSSY_CART_COOKIE, CMSSY_EDIT_HEADER, CMSSY_LOCALE_HEADER, CMSSY_SESSION_COOKIE, CmssyWebhookError, DEFAULT_CMSSY_EDITOR_ORIGINS, SESSION_MAX_AGE_SECONDS, applyCmssyCsp, assertAuthConfig, buildCmssyMetadata, cmssyCspHeaders, createCmssyAuthMiddleware, createCmssyAuthRoute, createCmssyCartRoute, createCmssyLocaleMiddleware, createCmssyNotFound, createCmssyOrdersRoute, createCmssyPage, createCmssyRobots, createCmssySitemap, createDraftRoute, fetchProduct, fetchProducts, getCmssyAccessToken, getCmssyLocale, getCmssyUser, isAccessExpired, isCmssyEditMode, isCmssyEditRequest, localeForPathname, openSession, resolveEditorOrigin, resolveLocaleFromPathname, sealSession, sessionCookieOptions, splitCmssyLocale, verifyCmssyWebhook };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dist"
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@cmssy/react": "^0.
|
|
44
|
+
"@cmssy/react": "^0.7.0",
|
|
45
45
|
"next": ">=15",
|
|
46
46
|
"react": "^18.2.0 || ^19.0.0",
|
|
47
47
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"tsup": "^8.3.0",
|
|
55
55
|
"typescript": "^5.6.0",
|
|
56
56
|
"vitest": "^2.1.0",
|
|
57
|
-
"@cmssy/react": "0.
|
|
57
|
+
"@cmssy/react": "0.7.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"jose": "^6.2.3"
|