@cmssy/next 12.8.0 → 12.10.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/dist/{index-BCHSAhKJ.d.cts → index-Q_bLE9vs.d.cts} +2 -1
- package/dist/{index-BCHSAhKJ.d.ts → index-Q_bLE9vs.d.ts} +2 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/server.cjs +11 -6
- package/dist/server.d.cts +5 -3
- package/dist/server.d.ts +5 -3
- package/dist/server.js +11 -6
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CmssyConfig } from '@cmssy/core';
|
|
1
|
+
import { RetryPolicy, CmssyConfig } from '@cmssy/core';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import { CmssyPageData, CmssyFormDefinition, BlockDefinition } from '@cmssy/react';
|
|
@@ -24,6 +24,7 @@ interface CreateCmssyPageOptions {
|
|
|
24
24
|
editor?: ComponentType<CmssyEditorProps>;
|
|
25
25
|
path?: string;
|
|
26
26
|
appContext?: CmssyAppContext;
|
|
27
|
+
retry?: RetryPolicy | false;
|
|
27
28
|
}
|
|
28
29
|
interface CatchAllParams {
|
|
29
30
|
path?: string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CmssyConfig } from '@cmssy/core';
|
|
1
|
+
import { RetryPolicy, CmssyConfig } from '@cmssy/core';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
3
|
import { ComponentType } from 'react';
|
|
4
4
|
import { CmssyPageData, CmssyFormDefinition, BlockDefinition } from '@cmssy/react';
|
|
@@ -24,6 +24,7 @@ interface CreateCmssyPageOptions {
|
|
|
24
24
|
editor?: ComponentType<CmssyEditorProps>;
|
|
25
25
|
path?: string;
|
|
26
26
|
appContext?: CmssyAppContext;
|
|
27
|
+
retry?: RetryPolicy | false;
|
|
27
28
|
}
|
|
28
29
|
interface CatchAllParams {
|
|
29
30
|
path?: string[];
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
|
|
2
|
-
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions } from './index-
|
|
1
|
+
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
|
|
2
|
+
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions } from './index-Q_bLE9vs.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@cmssy/react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
|
|
2
|
-
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions } from './index-
|
|
1
|
+
export { CMSSY_EDIT_HEADER, CMSSY_EDIT_QUERY_PARAM, CMSSY_LOCALE_HEADER, CMSSY_SECRET_QUERY_PARAM, CmssyConfig, CmssyEnvConfig, CmssyPageData, CmssyPageMeta, CmssyPageSummary, CmssyWebhookError, CmssyWebhookEvent, DEFAULT_CMSSY_EDITOR_ORIGINS, RetryPolicy, VerifyCmssyWebhookOptions, defineCmssyConfig, localizeHref, resolveEditorOrigin, verifyCmssyWebhook } from '@cmssy/core';
|
|
2
|
+
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions } from './index-Q_bLE9vs.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import '@cmssy/react';
|
package/dist/server.cjs
CHANGED
|
@@ -42,6 +42,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
42
42
|
workspaceSlug: config.workspaceSlug
|
|
43
43
|
};
|
|
44
44
|
const client = react.createCmssyClient(clientConfig);
|
|
45
|
+
const requestOptions = { retry: options?.retry ?? {} };
|
|
45
46
|
const fixedPath = options?.path?.split("/").map((segment) => segment.trim()).filter(Boolean);
|
|
46
47
|
return async function CmssyCatchAllPage({
|
|
47
48
|
params,
|
|
@@ -62,17 +63,18 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
62
63
|
}
|
|
63
64
|
const editMode = isEnabled || editorActive;
|
|
64
65
|
const devAllowed = internal.isDevelopment() && Boolean(config.devToken?.trim());
|
|
65
|
-
const siteLocales = await internal.resolveSiteLocales(clientConfig);
|
|
66
|
+
const siteLocales = await internal.resolveSiteLocales(clientConfig, requestOptions);
|
|
66
67
|
const { defaultLocale, locales: enabledLocales } = siteLocales;
|
|
67
68
|
const split = internal.splitLocaleFromPath(path, siteLocales);
|
|
68
69
|
const pagePath = split.path;
|
|
69
70
|
const locale = config.resolveLocale ? await config.resolveLocale() : split.locale;
|
|
70
|
-
const devWorkspaceId = devAllowed ? await client.resolveWorkspaceId() : void 0;
|
|
71
|
+
const devWorkspaceId = devAllowed ? await client.resolveWorkspaceId(requestOptions) : void 0;
|
|
71
72
|
const page = await internal.fetchPage(clientConfig, pagePath, {
|
|
72
73
|
previewSecret: editMode ? config.draftSecret : void 0,
|
|
73
74
|
devPreview: devAllowed || void 0,
|
|
74
75
|
devToken: devAllowed ? config.devToken : void 0,
|
|
75
|
-
workspaceId: devWorkspaceId
|
|
76
|
+
workspaceId: devWorkspaceId,
|
|
77
|
+
...requestOptions
|
|
76
78
|
});
|
|
77
79
|
if (!page) {
|
|
78
80
|
navigation.notFound();
|
|
@@ -87,7 +89,8 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
87
89
|
page.blocks,
|
|
88
90
|
internalServer.blocksToSchemas(blocks),
|
|
89
91
|
locale,
|
|
90
|
-
defaultLocale
|
|
92
|
+
defaultLocale,
|
|
93
|
+
requestOptions
|
|
91
94
|
);
|
|
92
95
|
const forms = Object.keys(resolvedForms).length > 0 ? resolvedForms : void 0;
|
|
93
96
|
const localeContext = {
|
|
@@ -128,7 +131,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
128
131
|
let workspace;
|
|
129
132
|
try {
|
|
130
133
|
workspace = {
|
|
131
|
-
id: await client.resolveWorkspaceId(),
|
|
134
|
+
id: await client.resolveWorkspaceId(requestOptions),
|
|
132
135
|
slug: config.workspaceSlug
|
|
133
136
|
};
|
|
134
137
|
} catch {
|
|
@@ -253,7 +256,8 @@ async function CmssyLayoutSlot({
|
|
|
253
256
|
editMode,
|
|
254
257
|
page = "/",
|
|
255
258
|
editable: Editable,
|
|
256
|
-
appContext
|
|
259
|
+
appContext,
|
|
260
|
+
retry
|
|
257
261
|
}) {
|
|
258
262
|
const resolved = await react.resolveCmssyLayoutSlot(config, {
|
|
259
263
|
position,
|
|
@@ -261,6 +265,7 @@ async function CmssyLayoutSlot({
|
|
|
261
265
|
editMode,
|
|
262
266
|
page,
|
|
263
267
|
appContext,
|
|
268
|
+
retry: retry ?? {},
|
|
264
269
|
...explicitLocale !== void 0 ? { locale: explicitLocale } : { path: path ?? [] }
|
|
265
270
|
});
|
|
266
271
|
const { groups, locale, defaultLocale, enabledLocales } = resolved;
|
package/dist/server.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, c as createCmssyEditPage, d as createCmssyPage } from './index-
|
|
2
|
-
import { CmssyConfig, LayoutPosition } from '@cmssy/core';
|
|
1
|
+
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, c as createCmssyEditPage, d as createCmssyPage } from './index-Q_bLE9vs.cjs';
|
|
2
|
+
import { CmssyConfig, LayoutPosition, RetryPolicy } from '@cmssy/core';
|
|
3
|
+
export { RetryPolicy } from '@cmssy/core';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import { ComponentType } from 'react';
|
|
5
6
|
import { BlockDefinition, CmssyLayoutGroup } from '@cmssy/react';
|
|
@@ -32,6 +33,7 @@ interface CmssyLayoutSlotBaseProps {
|
|
|
32
33
|
appContext?: Record<string, unknown>;
|
|
33
34
|
}>;
|
|
34
35
|
appContext?: Record<string, unknown>;
|
|
36
|
+
retry?: RetryPolicy | false;
|
|
35
37
|
}
|
|
36
38
|
type CmssyLayoutSlotLocaleSource = {
|
|
37
39
|
path: string[];
|
|
@@ -41,6 +43,6 @@ type CmssyLayoutSlotLocaleSource = {
|
|
|
41
43
|
path?: never;
|
|
42
44
|
};
|
|
43
45
|
type CmssyLayoutSlotProps = CmssyLayoutSlotBaseProps & CmssyLayoutSlotLocaleSource;
|
|
44
|
-
declare function CmssyLayoutSlot({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, }: CmssyLayoutSlotProps): Promise<react_jsx_runtime.JSX.Element>;
|
|
46
|
+
declare function CmssyLayoutSlot({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, retry, }: CmssyLayoutSlotProps): Promise<react_jsx_runtime.JSX.Element>;
|
|
45
47
|
|
|
46
48
|
export { type CmssyDraftRouteConfig, CmssyLayoutSlot, type CmssyLayoutSlotProps, createDraftRoute, isCmssyEditMode };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, c as createCmssyEditPage, d as createCmssyPage } from './index-
|
|
2
|
-
import { CmssyConfig, LayoutPosition } from '@cmssy/core';
|
|
1
|
+
export { C as CmssyAppContext, a as CmssyEditorProps, b as CreateCmssyPageOptions, c as createCmssyEditPage, d as createCmssyPage } from './index-Q_bLE9vs.js';
|
|
2
|
+
import { CmssyConfig, LayoutPosition, RetryPolicy } from '@cmssy/core';
|
|
3
|
+
export { RetryPolicy } from '@cmssy/core';
|
|
3
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import { ComponentType } from 'react';
|
|
5
6
|
import { BlockDefinition, CmssyLayoutGroup } from '@cmssy/react';
|
|
@@ -32,6 +33,7 @@ interface CmssyLayoutSlotBaseProps {
|
|
|
32
33
|
appContext?: Record<string, unknown>;
|
|
33
34
|
}>;
|
|
34
35
|
appContext?: Record<string, unknown>;
|
|
36
|
+
retry?: RetryPolicy | false;
|
|
35
37
|
}
|
|
36
38
|
type CmssyLayoutSlotLocaleSource = {
|
|
37
39
|
path: string[];
|
|
@@ -41,6 +43,6 @@ type CmssyLayoutSlotLocaleSource = {
|
|
|
41
43
|
path?: never;
|
|
42
44
|
};
|
|
43
45
|
type CmssyLayoutSlotProps = CmssyLayoutSlotBaseProps & CmssyLayoutSlotLocaleSource;
|
|
44
|
-
declare function CmssyLayoutSlot({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, }: CmssyLayoutSlotProps): Promise<react_jsx_runtime.JSX.Element>;
|
|
46
|
+
declare function CmssyLayoutSlot({ config, blocks, position, path, locale: explicitLocale, editMode, page, editable: Editable, appContext, retry, }: CmssyLayoutSlotProps): Promise<react_jsx_runtime.JSX.Element>;
|
|
45
47
|
|
|
46
48
|
export { type CmssyDraftRouteConfig, CmssyLayoutSlot, type CmssyLayoutSlotProps, createDraftRoute, isCmssyEditMode };
|
package/dist/server.js
CHANGED
|
@@ -40,6 +40,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
40
40
|
workspaceSlug: config.workspaceSlug
|
|
41
41
|
};
|
|
42
42
|
const client = createCmssyClient(clientConfig);
|
|
43
|
+
const requestOptions = { retry: options?.retry ?? {} };
|
|
43
44
|
const fixedPath = options?.path?.split("/").map((segment) => segment.trim()).filter(Boolean);
|
|
44
45
|
return async function CmssyCatchAllPage({
|
|
45
46
|
params,
|
|
@@ -60,17 +61,18 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
60
61
|
}
|
|
61
62
|
const editMode = isEnabled || editorActive;
|
|
62
63
|
const devAllowed = isDevelopment() && Boolean(config.devToken?.trim());
|
|
63
|
-
const siteLocales = await resolveSiteLocales(clientConfig);
|
|
64
|
+
const siteLocales = await resolveSiteLocales(clientConfig, requestOptions);
|
|
64
65
|
const { defaultLocale, locales: enabledLocales } = siteLocales;
|
|
65
66
|
const split = splitLocaleFromPath(path, siteLocales);
|
|
66
67
|
const pagePath = split.path;
|
|
67
68
|
const locale = config.resolveLocale ? await config.resolveLocale() : split.locale;
|
|
68
|
-
const devWorkspaceId = devAllowed ? await client.resolveWorkspaceId() : void 0;
|
|
69
|
+
const devWorkspaceId = devAllowed ? await client.resolveWorkspaceId(requestOptions) : void 0;
|
|
69
70
|
const page = await fetchPage(clientConfig, pagePath, {
|
|
70
71
|
previewSecret: editMode ? config.draftSecret : void 0,
|
|
71
72
|
devPreview: devAllowed || void 0,
|
|
72
73
|
devToken: devAllowed ? config.devToken : void 0,
|
|
73
|
-
workspaceId: devWorkspaceId
|
|
74
|
+
workspaceId: devWorkspaceId,
|
|
75
|
+
...requestOptions
|
|
74
76
|
});
|
|
75
77
|
if (!page) {
|
|
76
78
|
notFound();
|
|
@@ -85,7 +87,8 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
85
87
|
page.blocks,
|
|
86
88
|
blocksToSchemas(blocks),
|
|
87
89
|
locale,
|
|
88
|
-
defaultLocale
|
|
90
|
+
defaultLocale,
|
|
91
|
+
requestOptions
|
|
89
92
|
);
|
|
90
93
|
const forms = Object.keys(resolvedForms).length > 0 ? resolvedForms : void 0;
|
|
91
94
|
const localeContext = {
|
|
@@ -126,7 +129,7 @@ function buildCmssyPageRenderer(config, blocks, options, editRoute) {
|
|
|
126
129
|
let workspace;
|
|
127
130
|
try {
|
|
128
131
|
workspace = {
|
|
129
|
-
id: await client.resolveWorkspaceId(),
|
|
132
|
+
id: await client.resolveWorkspaceId(requestOptions),
|
|
130
133
|
slug: config.workspaceSlug
|
|
131
134
|
};
|
|
132
135
|
} catch {
|
|
@@ -251,7 +254,8 @@ async function CmssyLayoutSlot({
|
|
|
251
254
|
editMode,
|
|
252
255
|
page = "/",
|
|
253
256
|
editable: Editable,
|
|
254
|
-
appContext
|
|
257
|
+
appContext,
|
|
258
|
+
retry
|
|
255
259
|
}) {
|
|
256
260
|
const resolved = await resolveCmssyLayoutSlot(config, {
|
|
257
261
|
position,
|
|
@@ -259,6 +263,7 @@ async function CmssyLayoutSlot({
|
|
|
259
263
|
editMode,
|
|
260
264
|
page,
|
|
261
265
|
appContext,
|
|
266
|
+
retry: retry ?? {},
|
|
262
267
|
...explicitLocale !== void 0 ? { locale: explicitLocale } : { path: path ?? [] }
|
|
263
268
|
});
|
|
264
269
|
const { groups, locale, defaultLocale, enabledLocales } = resolved;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmssy/next",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.10.0",
|
|
4
4
|
"description": "Next.js App Router bindings for cmssy headless sites (createCmssyPage + draft preview)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cmssy",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"dist"
|
|
72
72
|
],
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@cmssy/react": "^12.
|
|
74
|
+
"@cmssy/react": "^12.10.0",
|
|
75
75
|
"next": ">=15",
|
|
76
76
|
"react": "^18.2.0 || ^19.0.0",
|
|
77
77
|
"react-dom": "^18.2.0 || ^19.0.0"
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
"tsup": "^8.3.0",
|
|
86
86
|
"typescript": "^5.6.0",
|
|
87
87
|
"vitest": "^2.1.0",
|
|
88
|
-
"@cmssy/react": "12.
|
|
88
|
+
"@cmssy/react": "12.10.0"
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@cmssy/types": "0.35.0",
|
|
92
92
|
"server-only": "^0.0.1",
|
|
93
|
-
"@cmssy/core": "12.
|
|
93
|
+
"@cmssy/core": "12.10.0"
|
|
94
94
|
},
|
|
95
95
|
"scripts": {
|
|
96
96
|
"build": "tsup",
|